/*! jQuery v1.7.2 jquery.com | jquery.org/license */
(function (a, b) { function cy(a) { return f.isWindow(a) ? a : a.nodeType === 9 ? a.defaultView || a.parentWindow : !1; } function cu(a) { if (!cj[a]) { var b = c.body, d = f("<" + a + ">").appendTo(b), e = d.css("display"); d.remove(); if (e === "none" || e === "") { ck || (ck = c.createElement("iframe"), ck.frameBorder = ck.width = ck.height = 0), b.appendChild(ck); if (!cl || !ck.createElement) { cl = (ck.contentWindow || ck.contentDocument).document, cl.write((f.support.boxModel ? "<!doctype html>" : "") + "<html><body>"), cl.close(); } d = cl.createElement(a), cl.body.appendChild(d), e = f.css(d, "display"), b.removeChild(ck); } cj[a] = e; } return cj[a]; } function ct(a, b) { var c = {}; f.each(cp.concat.apply([], cp.slice(0, b)), function () { c[this] = a; }); return c; } function cs() { cq = b; } function cr() { setTimeout(cs, 0); return cq = f.now(); } function ci() { try { return new a.ActiveXObject("Microsoft.XMLHTTP"); } catch (b) { } } function ch() { try { return new a.XMLHttpRequest; } catch (b) { } } function cb(a, c) { a.dataFilter && (c = a.dataFilter(c, a.dataType)); var d = a.dataTypes, e = {}, g, h, i = d.length, j, k = d[0], l, m, n, o, p; for (g = 1; g < i; g++) { if (g === 1) { for (h in a.converters) { typeof h == "string" && (e[h.toLowerCase()] = a.converters[h]); } } l = k, k = d[g]; if (k === "*") { k = l; } else { if (l !== "*" && l !== k) { m = l + " " + k, n = e[m] || e["* " + k]; if (!n) { p = b; for (o in e) { j = o.split(" "); if (j[0] === l || j[0] === "*") { p = e[j[1] + " " + k]; if (p) { o = e[o], o === !0 ? n = p : p === !0 && (n = o); break; } } } } !n && !p && f.error("No conversion from " + m.replace(" ", " to ")), n !== !0 && (c = n ? n(c) : p(o(c))); } } } return c; } function ca(a, c, d) { var e = a.contents, f = a.dataTypes, g = a.responseFields, h, i, j, k; for (i in g) { i in d && (c[g[i]] = d[i]); } while (f[0] === "*") { f.shift(), h === b && (h = a.mimeType || c.getResponseHeader("content-type")); } if (h) { for (i in e) { if (e[i] && e[i].test(h)) { f.unshift(i); break; } } } if (f[0] in d) { j = f[0]; } else { for (i in d) { if (!f[0] || a.converters[i + " " + f[0]]) { j = i; break; } k || (k = i); } j = j || k; } if (j) { j !== f[0] && f.unshift(j); return d[j]; } } function b_(a, b, c, d) { if (f.isArray(b)) { f.each(b, function (b, e) { c || bD.test(a) ? d(a, e) : b_(a + "[" + (typeof e == "object" ? b : "") + "]", e, c, d); }); } else { if (!c && f.type(b) === "object") { for (var e in b) { b_(a + "[" + e + "]", b[e], c, d); } } else { d(a, b); } } } function b$(a, c) { var d, e, g = f.ajaxSettings.flatOptions || {}; for (d in c) { c[d] !== b && ((g[d] ? a : e || (e = {}))[d] = c[d]); } e && f.extend(!0, a, e); } function bZ(a, c, d, e, f, g) { f = f || c.dataTypes[0], g = g || {}, g[f] = !0; var h = a[f], i = 0, j = h ? h.length : 0, k = a === bS, l; for (; i < j && (k || !l) ; i++) { l = h[i](c, d, e), typeof l == "string" && (!k || g[l] ? l = b : (c.dataTypes.unshift(l), l = bZ(a, c, d, e, l, g))); } (k || !l) && !g["*"] && (l = bZ(a, c, d, e, "*", g)); return l; } function bY(a) { return function (b, c) { typeof b != "string" && (c = b, b = "*"); if (f.isFunction(c)) { var d = b.toLowerCase().split(bO), e = 0, g = d.length, h, i, j; for (; e < g; e++) { h = d[e], j = /^\+/.test(h), j && (h = h.substr(1) || "*"), i = a[h] = a[h] || [], i[j ? "unshift" : "push"](c); } } }; } function bB(a, b, c) { var d = b === "width" ? a.offsetWidth : a.offsetHeight, e = b === "width" ? 1 : 0, g = 4; if (d > 0) { if (c !== "border") { for (; e < g; e += 2) { c || (d -= parseFloat(f.css(a, "padding" + bx[e])) || 0), c === "margin" ? d += parseFloat(f.css(a, c + bx[e])) || 0 : d -= parseFloat(f.css(a, "border" + bx[e] + "Width")) || 0; } } return d + "px"; } d = by(a, b); if (d < 0 || d == null) { d = a.style[b]; } if (bt.test(d)) { return d; } d = parseFloat(d) || 0; if (c) { for (; e < g; e += 2) { d += parseFloat(f.css(a, "padding" + bx[e])) || 0, c !== "padding" && (d += parseFloat(f.css(a, "border" + bx[e] + "Width")) || 0), c === "margin" && (d += parseFloat(f.css(a, c + bx[e])) || 0); } } return d + "px"; } function bo(a) { var b = c.createElement("div"); bh.appendChild(b), b.innerHTML = a.outerHTML; return b.firstChild; } function bn(a) { var b = (a.nodeName || "").toLowerCase(); b === "input" ? bm(a) : b !== "script" && typeof a.getElementsByTagName != "undefined" && f.grep(a.getElementsByTagName("input"), bm); } function bm(a) { if (a.type === "checkbox" || a.type === "radio") { a.defaultChecked = a.checked; } } function bl(a) { return typeof a.getElementsByTagName != "undefined" ? a.getElementsByTagName("*") : typeof a.querySelectorAll != "undefined" ? a.querySelectorAll("*") : []; } function bk(a, b) { var c; b.nodeType === 1 && (b.clearAttributes && b.clearAttributes(), b.mergeAttributes && b.mergeAttributes(a), c = b.nodeName.toLowerCase(), c === "object" ? b.outerHTML = a.outerHTML : c !== "input" || a.type !== "checkbox" && a.type !== "radio" ? c === "option" ? b.selected = a.defaultSelected : c === "input" || c === "textarea" ? b.defaultValue = a.defaultValue : c === "script" && b.text !== a.text && (b.text = a.text) : (a.checked && (b.defaultChecked = b.checked = a.checked), b.value !== a.value && (b.value = a.value)), b.removeAttribute(f.expando), b.removeAttribute("_submit_attached"), b.removeAttribute("_change_attached")); } function bj(a, b) { if (b.nodeType === 1 && !!f.hasData(a)) { var c, d, e, g = f._data(a), h = f._data(b, g), i = g.events; if (i) { delete h.handle, h.events = {}; for (c in i) { for (d = 0, e = i[c].length; d < e; d++) { f.event.add(b, c, i[c][d]); } } } h.data && (h.data = f.extend({}, h.data)); } } function bi(a, b) { return f.nodeName(a, "table") ? a.getElementsByTagName("tbody")[0] || a.appendChild(a.ownerDocument.createElement("tbody")) : a; } function U(a) { var b = V.split("|"), c = a.createDocumentFragment(); if (c.createElement) { while (b.length) { c.createElement(b.pop()); } } return c; } function T(a, b, c) { b = b || 0; if (f.isFunction(b)) { return f.grep(a, function (a, d) { var e = !!b.call(a, d, a); return e === c; }); } if (b.nodeType) { return f.grep(a, function (a, d) { return a === b === c; }); } if (typeof b == "string") { var d = f.grep(a, function (a) { return a.nodeType === 1; }); if (O.test(b)) { return f.filter(b, d, !c); } b = f.filter(b, d); } return f.grep(a, function (a, d) { return f.inArray(a, b) >= 0 === c; }); } function S(a) { return !a || !a.parentNode || a.parentNode.nodeType === 11; } function K() { return !0; } function J() { return !1; } function n(a, b, c) { var d = b + "defer", e = b + "queue", g = b + "mark", h = f._data(a, d); h && (c === "queue" || !f._data(a, e)) && (c === "mark" || !f._data(a, g)) && setTimeout(function () { !f._data(a, e) && !f._data(a, g) && (f.removeData(a, d, !0), h.fire()); }, 0); } function m(a) { for (var b in a) { if (b === "data" && f.isEmptyObject(a[b])) { continue; } if (b !== "toJSON") { return !1; } } return !0; } function l(a, c, d) { if (d === b && a.nodeType === 1) { var e = "data-" + c.replace(k, "-$1").toLowerCase(); d = a.getAttribute(e); if (typeof d == "string") { try { d = d === "true" ? !0 : d === "false" ? !1 : d === "null" ? null : f.isNumeric(d) ? +d : j.test(d) ? f.parseJSON(d) : d; } catch (g) { } f.data(a, c, d); } else { d = b; } } return d; } function h(a) { var b = g[a] = {}, c, d; a = a.split(/\s+/); for (c = 0, d = a.length; c < d; c++) { b[a[c]] = !0; } return b; } var c = a.document, d = a.navigator, e = a.location, f = function () { function J() { if (!e.isReady) { try { c.documentElement.doScroll("left"); } catch (a) { setTimeout(J, 1); return; } e.ready(); } } var e = function (a, b) { return new e.fn.init(a, b, h); }, f = a.jQuery, g = a.$, h, i = /^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/, j = /\S/, k = /^\s+/, l = /\s+$/, m = /^<(\w+)\s*\/?>(?:<\/\1>)?$/, n = /^[\],:{}\s]*$/, o = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, p = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, q = /(?:^|:|,)(?:\s*\[)+/g, r = /(webkit)[ \/]([\w.]+)/, s = /(opera)(?:.*version)?[ \/]([\w.]+)/, t = /(msie) ([\w.]+)/, u = /(mozilla)(?:.*? rv:([\w.]+))?/, v = /-([a-z]|[0-9])/ig, w = /^-ms-/, x = function (a, b) { return (b + "").toUpperCase(); }, y = d.userAgent, z, A, B, C = Object.prototype.toString, D = Object.prototype.hasOwnProperty, E = Array.prototype.push, F = Array.prototype.slice, G = String.prototype.trim, H = Array.prototype.indexOf, I = {}; e.fn = e.prototype = { constructor: e, init: function (a, d, f) { var g, h, j, k; if (!a) { return this; } if (a.nodeType) { this.context = this[0] = a, this.length = 1; return this; } if (a === "body" && !d && c.body) { this.context = c, this[0] = c.body, this.selector = a, this.length = 1; return this; } if (typeof a == "string") { a.charAt(0) !== "<" || a.charAt(a.length - 1) !== ">" || a.length < 3 ? g = i.exec(a) : g = [null, a, null]; if (g && (g[1] || !d)) { if (g[1]) { d = d instanceof e ? d[0] : d, k = d ? d.ownerDocument || d : c, j = m.exec(a), j ? e.isPlainObject(d) ? (a = [c.createElement(j[1])], e.fn.attr.call(a, d, !0)) : a = [k.createElement(j[1])] : (j = e.buildFragment([g[1]], [k]), a = (j.cacheable ? e.clone(j.fragment) : j.fragment).childNodes); return e.merge(this, a); } h = c.getElementById(g[2]); if (h && h.parentNode) { if (h.id !== g[2]) { return f.find(a); } this.length = 1, this[0] = h; } this.context = c, this.selector = a; return this; } return !d || d.jquery ? (d || f).find(a) : this.constructor(d).find(a); } if (e.isFunction(a)) { return f.ready(a); } a.selector !== b && (this.selector = a.selector, this.context = a.context); return e.makeArray(a, this); }, selector: "", jquery: "1.7.2", length: 0, size: function () { return this.length; }, toArray: function () { return F.call(this, 0); }, get: function (a) { return a == null ? this.toArray() : a < 0 ? this[this.length + a] : this[a]; }, pushStack: function (a, b, c) { var d = this.constructor(); e.isArray(a) ? E.apply(d, a) : e.merge(d, a), d.prevObject = this, d.context = this.context, b === "find" ? d.selector = this.selector + (this.selector ? " " : "") + c : b && (d.selector = this.selector + "." + b + "(" + c + ")"); return d; }, each: function (a, b) { return e.each(this, a, b); }, ready: function (a) { e.bindReady(), A.add(a); return this; }, eq: function (a) { a = +a; return a === -1 ? this.slice(a) : this.slice(a, a + 1); }, first: function () { return this.eq(0); }, last: function () { return this.eq(-1); }, slice: function () { return this.pushStack(F.apply(this, arguments), "slice", F.call(arguments).join(",")); }, map: function (a) { return this.pushStack(e.map(this, function (b, c) { return a.call(b, c, b); })); }, end: function () { return this.prevObject || this.constructor(null); }, push: E, sort: [].sort, splice: [].splice }, e.fn.init.prototype = e.fn, e.extend = e.fn.extend = function () { var a, c, d, f, g, h, i = arguments[0] || {}, j = 1, k = arguments.length, l = !1; typeof i == "boolean" && (l = i, i = arguments[1] || {}, j = 2), typeof i != "object" && !e.isFunction(i) && (i = {}), k === j && (i = this, --j); for (; j < k; j++) { if ((a = arguments[j]) != null) { for (c in a) { d = i[c], f = a[c]; if (i === f) { continue; } l && f && (e.isPlainObject(f) || (g = e.isArray(f))) ? (g ? (g = !1, h = d && e.isArray(d) ? d : []) : h = d && e.isPlainObject(d) ? d : {}, i[c] = e.extend(l, h, f)) : f !== b && (i[c] = f); } } } return i; }, e.extend({ noConflict: function (b) { a.$ === e && (a.$ = g), b && a.jQuery === e && (a.jQuery = f); return e; }, isReady: !1, readyWait: 1, holdReady: function (a) { a ? e.readyWait++ : e.ready(!0); }, ready: function (a) { if (a === !0 && !--e.readyWait || a !== !0 && !e.isReady) { if (!c.body) { return setTimeout(e.ready, 1); } e.isReady = !0; if (a !== !0 && --e.readyWait > 0) { return; } A.fireWith(c, [e]), e.fn.trigger && e(c).trigger("ready").off("ready"); } }, bindReady: function () { if (!A) { A = e.Callbacks("once memory"); if (c.readyState === "complete") { return setTimeout(e.ready, 1); } if (c.addEventListener) { c.addEventListener("DOMContentLoaded", B, !1), a.addEventListener("load", e.ready, !1); } else { if (c.attachEvent) { c.attachEvent("onreadystatechange", B), a.attachEvent("onload", e.ready); var b = !1; try { b = a.frameElement == null; } catch (d) { } c.documentElement.doScroll && b && J(); } } } }, isFunction: function (a) { return e.type(a) === "function"; }, isArray: Array.isArray || function (a) { return e.type(a) === "array"; }, isWindow: function (a) { return a != null && a == a.window; }, isNumeric: function (a) { return !isNaN(parseFloat(a)) && isFinite(a); }, type: function (a) { return a == null ? String(a) : I[C.call(a)] || "object"; }, isPlainObject: function (a) { if (!a || e.type(a) !== "object" || a.nodeType || e.isWindow(a)) { return !1; } try { if (a.constructor && !D.call(a, "constructor") && !D.call(a.constructor.prototype, "isPrototypeOf")) { return !1; } } catch (c) { return !1; } var d; for (d in a) { } return d === b || D.call(a, d); }, isEmptyObject: function (a) { for (var b in a) { return !1; } return !0; }, error: function (a) { throw new Error(a); }, parseJSON: function (b) { if (typeof b != "string" || !b) { return null; } b = e.trim(b); if (a.JSON && a.JSON.parse) { return a.JSON.parse(b); } if (n.test(b.replace(o, "@").replace(p, "]").replace(q, ""))) { return (new Function("return " + b))(); } e.error("Invalid JSON: " + b); }, parseXML: function (c) { if (typeof c != "string" || !c) { return null; } var d, f; try { a.DOMParser ? (f = new DOMParser, d = f.parseFromString(c, "text/xml")) : (d = new ActiveXObject("Microsoft.XMLDOM"), d.async = "false", d.loadXML(c)); } catch (g) { d = b; } (!d || !d.documentElement || d.getElementsByTagName("parsererror").length) && e.error("Invalid XML: " + c); return d; }, noop: function () { }, globalEval: function (b) { b && j.test(b) && (a.execScript || function (b) { a.eval.call(a, b); })(b); }, camelCase: function (a) { return a.replace(w, "ms-").replace(v, x); }, nodeName: function (a, b) { return a.nodeName && a.nodeName.toUpperCase() === b.toUpperCase(); }, each: function (a, c, d) { var f, g = 0, h = a.length, i = h === b || e.isFunction(a); if (d) { if (i) { for (f in a) { if (c.apply(a[f], d) === !1) { break; } } } else { for (; g < h;) { if (c.apply(a[g++], d) === !1) { break; } } } } else { if (i) { for (f in a) { if (c.call(a[f], f, a[f]) === !1) { break; } } } else { for (; g < h;) { if (c.call(a[g], g, a[g++]) === !1) { break; } } } } return a; }, trim: G ? function (a) { return a == null ? "" : G.call(a); } : function (a) { return a == null ? "" : (a + "").replace(k, "").replace(l, ""); }, makeArray: function (a, b) { var c = b || []; if (a != null) { var d = e.type(a); a.length == null || d === "string" || d === "function" || d === "regexp" || e.isWindow(a) ? E.call(c, a) : e.merge(c, a); } return c; }, inArray: function (a, b, c) { var d; if (b) { if (H) { return H.call(b, a, c); } d = b.length, c = c ? c < 0 ? Math.max(0, d + c) : c : 0; for (; c < d; c++) { if (c in b && b[c] === a) { return c; } } } return -1; }, merge: function (a, c) { var d = a.length, e = 0; if (typeof c.length == "number") { for (var f = c.length; e < f; e++) { a[d++] = c[e]; } } else { while (c[e] !== b) { a[d++] = c[e++]; } } a.length = d; return a; }, grep: function (a, b, c) { var d = [], e; c = !!c; for (var f = 0, g = a.length; f < g; f++) { e = !!b(a[f], f), c !== e && d.push(a[f]); } return d; }, map: function (a, c, d) { var f, g, h = [], i = 0, j = a.length, k = a instanceof e || j !== b && typeof j == "number" && (j > 0 && a[0] && a[j - 1] || j === 0 || e.isArray(a)); if (k) { for (; i < j; i++) { f = c(a[i], i, d), f != null && (h[h.length] = f); } } else { for (g in a) { f = c(a[g], g, d), f != null && (h[h.length] = f); } } return h.concat.apply([], h); }, guid: 1, proxy: function (a, c) { if (typeof c == "string") { var d = a[c]; c = a, a = d; } if (!e.isFunction(a)) { return b; } var f = F.call(arguments, 2), g = function () { return a.apply(c, f.concat(F.call(arguments))); }; g.guid = a.guid = a.guid || g.guid || e.guid++; return g; }, access: function (a, c, d, f, g, h, i) { var j, k = d == null, l = 0, m = a.length; if (d && typeof d == "object") { for (l in d) { e.access(a, c, l, d[l], 1, h, f); } g = 1; } else { if (f !== b) { j = i === b && e.isFunction(f), k && (j ? (j = c, c = function (a, b, c) { return j.call(e(a), c); }) : (c.call(a, f), c = null)); if (c) { for (; l < m; l++) { c(a[l], d, j ? f.call(a[l], l, c(a[l], d)) : f, i); } } g = 1; } } return g ? a : k ? c.call(a) : m ? c(a[0], d) : h; }, now: function () { return (new Date).getTime(); }, uaMatch: function (a) { a = a.toLowerCase(); var b = r.exec(a) || s.exec(a) || t.exec(a) || a.indexOf("compatible") < 0 && u.exec(a) || []; return { browser: b[1] || "", version: b[2] || "0" }; }, sub: function () { function a(b, c) { return new a.fn.init(b, c); } e.extend(!0, a, this), a.superclass = this, a.fn = a.prototype = this(), a.fn.constructor = a, a.sub = this.sub, a.fn.init = function (d, f) { f && f instanceof e && !(f instanceof a) && (f = a(f)); return e.fn.init.call(this, d, f, b); }, a.fn.init.prototype = a.fn; var b = a(c); return a; }, browser: {} }), e.each("Boolean Number String Function Array Date RegExp Object".split(" "), function (a, b) { I["[object " + b + "]"] = b.toLowerCase(); }), z = e.uaMatch(y), z.browser && (e.browser[z.browser] = !0, e.browser.version = z.version), e.browser.webkit && (e.browser.safari = !0), j.test(" ") && (k = /^[\s\xA0]+/, l = /[\s\xA0]+$/), h = e(c), c.addEventListener ? B = function () { c.removeEventListener("DOMContentLoaded", B, !1), e.ready(); } : c.attachEvent && (B = function () { c.readyState === "complete" && (c.detachEvent("onreadystatechange", B), e.ready()); }); return e; }(), g = {}; f.Callbacks = function (a) { a = a ? g[a] || h(a) : {}; var c = [], d = [], e, i, j, k, l, m, n = function (b) { var d, e, g, h, i; for (d = 0, e = b.length; d < e; d++) { g = b[d], h = f.type(g), h === "array" ? n(g) : h === "function" && (!a.unique || !p.has(g)) && c.push(g); } }, o = function (b, f) { f = f || [], e = !a.memory || [b, f], i = !0, j = !0, m = k || 0, k = 0, l = c.length; for (; c && m < l; m++) { if (c[m].apply(b, f) === !1 && a.stopOnFalse) { e = !0; break; } } j = !1, c && (a.once ? e === !0 ? p.disable() : c = [] : d && d.length && (e = d.shift(), p.fireWith(e[0], e[1]))); }, p = { add: function () { if (c) { var a = c.length; n(arguments), j ? l = c.length : e && e !== !0 && (k = a, o(e[0], e[1])); } return this; }, remove: function () { if (c) { var b = arguments, d = 0, e = b.length; for (; d < e; d++) { for (var f = 0; f < c.length; f++) { if (b[d] === c[f]) { j && f <= l && (l--, f <= m && m--), c.splice(f--, 1); if (a.unique) { break; } } } } } return this; }, has: function (a) { if (c) { var b = 0, d = c.length; for (; b < d; b++) { if (a === c[b]) { return !0; } } } return !1; }, empty: function () { c = []; return this; }, disable: function () { c = d = e = b; return this; }, disabled: function () { return !c; }, lock: function () { d = b, (!e || e === !0) && p.disable(); return this; }, locked: function () { return !d; }, fireWith: function (b, c) { d && (j ? a.once || d.push([b, c]) : (!a.once || !e) && o(b, c)); return this; }, fire: function () { p.fireWith(this, arguments); return this; }, fired: function () { return !!i; } }; return p; }; var i = [].slice; f.extend({ Deferred: function (a) { var b = f.Callbacks("once memory"), c = f.Callbacks("once memory"), d = f.Callbacks("memory"), e = "pending", g = { resolve: b, reject: c, notify: d }, h = { done: b.add, fail: c.add, progress: d.add, state: function () { return e; }, isResolved: b.fired, isRejected: c.fired, then: function (a, b, c) { i.done(a).fail(b).progress(c); return this; }, always: function () { i.done.apply(i, arguments).fail.apply(i, arguments); return this; }, pipe: function (a, b, c) { return f.Deferred(function (d) { f.each({ done: [a, "resolve"], fail: [b, "reject"], progress: [c, "notify"] }, function (a, b) { var c = b[0], e = b[1], g; f.isFunction(c) ? i[a](function () { g = c.apply(this, arguments), g && f.isFunction(g.promise) ? g.promise().then(d.resolve, d.reject, d.notify) : d[e + "With"](this === i ? d : this, [g]); }) : i[a](d[e]); }); }).promise(); }, promise: function (a) { if (a == null) { a = h; } else { for (var b in h) { a[b] = h[b]; } } return a; } }, i = h.promise({}), j; for (j in g) { i[j] = g[j].fire, i[j + "With"] = g[j].fireWith; } i.done(function () { e = "resolved"; }, c.disable, d.lock).fail(function () { e = "rejected"; }, b.disable, d.lock), a && a.call(i, i); return i; }, when: function (a) { function m(a) { return function (b) { e[a] = arguments.length > 1 ? i.call(arguments, 0) : b, j.notifyWith(k, e); }; } function l(a) { return function (c) { b[a] = arguments.length > 1 ? i.call(arguments, 0) : c, --g || j.resolveWith(j, b); }; } var b = i.call(arguments, 0), c = 0, d = b.length, e = Array(d), g = d, h = d, j = d <= 1 && a && f.isFunction(a.promise) ? a : f.Deferred(), k = j.promise(); if (d > 1) { for (; c < d; c++) { b[c] && b[c].promise && f.isFunction(b[c].promise) ? b[c].promise().then(l(c), j.reject, m(c)) : --g; } g || j.resolveWith(j, b); } else { j !== a && j.resolveWith(j, d ? [a] : []); } return k; } }), f.support = function () { var b, d, e, g, h, i, j, k, l, m, n, o, p = c.createElement("div"), q = c.documentElement; p.setAttribute("className", "t"), p.innerHTML = "   <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>", d = p.getElementsByTagName("*"), e = p.getElementsByTagName("a")[0]; if (!d || !d.length || !e) { return {}; } g = c.createElement("select"), h = g.appendChild(c.createElement("option")), i = p.getElementsByTagName("input")[0], b = { leadingWhitespace: p.firstChild.nodeType === 3, tbody: !p.getElementsByTagName("tbody").length, htmlSerialize: !!p.getElementsByTagName("link").length, style: /top/.test(e.getAttribute("style")), hrefNormalized: e.getAttribute("href") === "/a", opacity: /^0.55/.test(e.style.opacity), cssFloat: !!e.style.cssFloat, checkOn: i.value === "on", optSelected: h.selected, getSetAttribute: p.className !== "t", enctype: !!c.createElement("form").enctype, html5Clone: c.createElement("nav").cloneNode(!0).outerHTML !== "<:nav></:nav>", submitBubbles: !0, changeBubbles: !0, focusinBubbles: !1, deleteExpando: !0, noCloneEvent: !0, inlineBlockNeedsLayout: !1, shrinkWrapBlocks: !1, reliableMarginRight: !0, pixelMargin: !0 }, f.boxModel = b.boxModel = c.compatMode === "CSS1Compat", i.checked = !0, b.noCloneChecked = i.cloneNode(!0).checked, g.disabled = !0, b.optDisabled = !h.disabled; try { delete p.test; } catch (r) { b.deleteExpando = !1; } !p.addEventListener && p.attachEvent && p.fireEvent && (p.attachEvent("onclick", function () { b.noCloneEvent = !1; }), p.cloneNode(!0).fireEvent("onclick")), i = c.createElement("input"), i.value = "t", i.setAttribute("type", "radio"), b.radioValue = i.value === "t", i.setAttribute("checked", "checked"), i.setAttribute("name", "t"), p.appendChild(i), j = c.createDocumentFragment(), j.appendChild(p.lastChild), b.checkClone = j.cloneNode(!0).cloneNode(!0).lastChild.checked, b.appendChecked = i.checked, j.removeChild(i), j.appendChild(p); if (p.attachEvent) { for (n in { submit: 1, change: 1, focusin: 1 }) { m = "on" + n, o = m in p, o || (p.setAttribute(m, "return;"), o = typeof p[m] == "function"), b[n + "Bubbles"] = o; } } j.removeChild(p), j = g = h = p = i = null, f(function () { var d, e, g, h, i, j, l, m, n, q, r, s, t, u = c.getElementsByTagName("body")[0]; !u || (m = 1, t = "padding:0;margin:0;border:", r = "position:absolute;top:0;left:0;width:1px;height:1px;", s = t + "0;visibility:hidden;", n = "style='" + r + t + "5px solid #000;", q = "<div " + n + "display:block;'><div style='" + t + "0;display:block;overflow:hidden;'></div></div><table " + n + "' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>", d = c.createElement("div"), d.style.cssText = s + "width:0;height:0;position:static;top:0;margin-top:" + m + "px", u.insertBefore(d, u.firstChild), p = c.createElement("div"), d.appendChild(p), p.innerHTML = "<table><tr><td style='" + t + "0;display:none'></td><td>t</td></tr></table>", k = p.getElementsByTagName("td"), o = k[0].offsetHeight === 0, k[0].style.display = "", k[1].style.display = "none", b.reliableHiddenOffsets = o && k[0].offsetHeight === 0, a.getComputedStyle && (p.innerHTML = "", l = c.createElement("div"), l.style.width = "0", l.style.marginRight = "0", p.style.width = "2px", p.appendChild(l), b.reliableMarginRight = (parseInt((a.getComputedStyle(l, null) || { marginRight: 0 }).marginRight, 10) || 0) === 0), typeof p.style.zoom != "undefined" && (p.innerHTML = "", p.style.width = p.style.padding = "1px", p.style.border = 0, p.style.overflow = "hidden", p.style.display = "inline", p.style.zoom = 1, b.inlineBlockNeedsLayout = p.offsetWidth === 3, p.style.display = "block", p.style.overflow = "visible", p.innerHTML = "<div style='width:5px;'></div>", b.shrinkWrapBlocks = p.offsetWidth !== 3), p.style.cssText = r + s, p.innerHTML = q, e = p.firstChild, g = e.firstChild, i = e.nextSibling.firstChild.firstChild, j = { doesNotAddBorder: g.offsetTop !== 5, doesAddBorderForTableAndCells: i.offsetTop === 5 }, g.style.position = "fixed", g.style.top = "20px", j.fixedPosition = g.offsetTop === 20 || g.offsetTop === 15, g.style.position = g.style.top = "", e.style.overflow = "hidden", e.style.position = "relative", j.subtractsBorderForOverflowNotVisible = g.offsetTop === -5, j.doesNotIncludeMarginInBodyOffset = u.offsetTop !== m, a.getComputedStyle && (p.style.marginTop = "1%", b.pixelMargin = (a.getComputedStyle(p, null) || { marginTop: 0 }).marginTop !== "1%"), typeof d.style.zoom != "undefined" && (d.style.zoom = 1), u.removeChild(d), l = p = d = null, f.extend(b, j)); }); return b; }(); var j = /^(?:\{.*\}|\[.*\])$/, k = /([A-Z])/g; f.extend({ cache: {}, uuid: 0, expando: "jQuery" + (f.fn.jquery + Math.random()).replace(/\D/g, ""), noData: { embed: !0, object: "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000", applet: !0 }, hasData: function (a) { a = a.nodeType ? f.cache[a[f.expando]] : a[f.expando]; return !!a && !m(a); }, data: function (a, c, d, e) { if (!!f.acceptData(a)) { var g, h, i, j = f.expando, k = typeof c == "string", l = a.nodeType, m = l ? f.cache : a, n = l ? a[j] : a[j] && j, o = c === "events"; if ((!n || !m[n] || !o && !e && !m[n].data) && k && d === b) { return; } n || (l ? a[j] = n = ++f.uuid : n = j), m[n] || (m[n] = {}, l || (m[n].toJSON = f.noop)); if (typeof c == "object" || typeof c == "function") { e ? m[n] = f.extend(m[n], c) : m[n].data = f.extend(m[n].data, c); } g = h = m[n], e || (h.data || (h.data = {}), h = h.data), d !== b && (h[f.camelCase(c)] = d); if (o && !h[c]) { return g.events; } k ? (i = h[c], i == null && (i = h[f.camelCase(c)])) : i = h; return i; } }, removeData: function (a, b, c) { if (!!f.acceptData(a)) { var d, e, g, h = f.expando, i = a.nodeType, j = i ? f.cache : a, k = i ? a[h] : h; if (!j[k]) { return; } if (b) { d = c ? j[k] : j[k].data; if (d) { f.isArray(b) || (b in d ? b = [b] : (b = f.camelCase(b), b in d ? b = [b] : b = b.split(" "))); for (e = 0, g = b.length; e < g; e++) { delete d[b[e]]; } if (!(c ? m : f.isEmptyObject)(d)) { return; } } } if (!c) { delete j[k].data; if (!m(j[k])) { return; } } f.support.deleteExpando || !j.setInterval ? delete j[k] : j[k] = null, i && (f.support.deleteExpando ? delete a[h] : a.removeAttribute ? a.removeAttribute(h) : a[h] = null); } }, _data: function (a, b, c) { return f.data(a, b, c, !0); }, acceptData: function (a) { if (a.nodeName) { var b = f.noData[a.nodeName.toLowerCase()]; if (b) { return b !== !0 && a.getAttribute("classid") === b; } } return !0; } }), f.fn.extend({ data: function (a, c) { var d, e, g, h, i, j = this[0], k = 0, m = null; if (a === b) { if (this.length) { m = f.data(j); if (j.nodeType === 1 && !f._data(j, "parsedAttrs")) { g = j.attributes; for (i = g.length; k < i; k++) { h = g[k].name, h.indexOf("data-") === 0 && (h = f.camelCase(h.substring(5)), l(j, h, m[h])); } f._data(j, "parsedAttrs", !0); } } return m; } if (typeof a == "object") { return this.each(function () { f.data(this, a); }); } d = a.split(".", 2), d[1] = d[1] ? "." + d[1] : "", e = d[1] + "!"; return f.access(this, function (c) { if (c === b) { m = this.triggerHandler("getData" + e, [d[0]]), m === b && j && (m = f.data(j, a), m = l(j, a, m)); return m === b && d[1] ? this.data(d[0]) : m; } d[1] = c, this.each(function () { var b = f(this); b.triggerHandler("setData" + e, d), f.data(this, a, c), b.triggerHandler("changeData" + e, d); }); }, null, c, arguments.length > 1, null, !1); }, removeData: function (a) { return this.each(function () { f.removeData(this, a); }); } }), f.extend({ _mark: function (a, b) { a && (b = (b || "fx") + "mark", f._data(a, b, (f._data(a, b) || 0) + 1)); }, _unmark: function (a, b, c) { a !== !0 && (c = b, b = a, a = !1); if (b) { c = c || "fx"; var d = c + "mark", e = a ? 0 : (f._data(b, d) || 1) - 1; e ? f._data(b, d, e) : (f.removeData(b, d, !0), n(b, c, "mark")); } }, queue: function (a, b, c) { var d; if (a) { b = (b || "fx") + "queue", d = f._data(a, b), c && (!d || f.isArray(c) ? d = f._data(a, b, f.makeArray(c)) : d.push(c)); return d || []; } }, dequeue: function (a, b) { b = b || "fx"; var c = f.queue(a, b), d = c.shift(), e = {}; d === "inprogress" && (d = c.shift()), d && (b === "fx" && c.unshift("inprogress"), f._data(a, b + ".run", e), d.call(a, function () { f.dequeue(a, b); }, e)), c.length || (f.removeData(a, b + "queue " + b + ".run", !0), n(a, b, "queue")); } }), f.fn.extend({ queue: function (a, c) { var d = 2; typeof a != "string" && (c = a, a = "fx", d--); if (arguments.length < d) { return f.queue(this[0], a); } return c === b ? this : this.each(function () { var b = f.queue(this, a, c); a === "fx" && b[0] !== "inprogress" && f.dequeue(this, a); }); }, dequeue: function (a) { return this.each(function () { f.dequeue(this, a); }); }, delay: function (a, b) { a = f.fx ? f.fx.speeds[a] || a : a, b = b || "fx"; return this.queue(b, function (b, c) { var d = setTimeout(b, a); c.stop = function () { clearTimeout(d); }; }); }, clearQueue: function (a) { return this.queue(a || "fx", []); }, promise: function (a, c) { function m() { --h || d.resolveWith(e, [e]); } typeof a != "string" && (c = a, a = b), a = a || "fx"; var d = f.Deferred(), e = this, g = e.length, h = 1, i = a + "defer", j = a + "queue", k = a + "mark", l; while (g--) { if (l = f.data(e[g], i, b, !0) || (f.data(e[g], j, b, !0) || f.data(e[g], k, b, !0)) && f.data(e[g], i, f.Callbacks("once memory"), !0)) { h++, l.add(m); } } m(); return d.promise(c); } }); var o = /[\n\t\r]/g, p = /\s+/, q = /\r/g, r = /^(?:button|input)$/i, s = /^(?:button|input|object|select|textarea)$/i, t = /^a(?:rea)?$/i, u = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i, v = f.support.getSetAttribute, w, x, y; f.fn.extend({ attr: function (a, b) { return f.access(this, f.attr, a, b, arguments.length > 1); }, removeAttr: function (a) { return this.each(function () { f.removeAttr(this, a); }); }, prop: function (a, b) { return f.access(this, f.prop, a, b, arguments.length > 1); }, removeProp: function (a) { a = f.propFix[a] || a; return this.each(function () { try { this[a] = b, delete this[a]; } catch (c) { } }); }, addClass: function (a) { var b, c, d, e, g, h, i; if (f.isFunction(a)) { return this.each(function (b) { f(this).addClass(a.call(this, b, this.className)); }); } if (a && typeof a == "string") { b = a.split(p); for (c = 0, d = this.length; c < d; c++) { e = this[c]; if (e.nodeType === 1) { if (!e.className && b.length === 1) { e.className = a; } else { g = " " + e.className + " "; for (h = 0, i = b.length; h < i; h++) { ~g.indexOf(" " + b[h] + " ") || (g += b[h] + " "); } e.className = f.trim(g); } } } } return this; }, removeClass: function (a) { var c, d, e, g, h, i, j; if (f.isFunction(a)) { return this.each(function (b) { f(this).removeClass(a.call(this, b, this.className)); }); } if (a && typeof a == "string" || a === b) { c = (a || "").split(p); for (d = 0, e = this.length; d < e; d++) { g = this[d]; if (g.nodeType === 1 && g.className) { if (a) { h = (" " + g.className + " ").replace(o, " "); for (i = 0, j = c.length; i < j; i++) { h = h.replace(" " + c[i] + " ", " "); } g.className = f.trim(h); } else { g.className = ""; } } } } return this; }, toggleClass: function (a, b) { var c = typeof a, d = typeof b == "boolean"; if (f.isFunction(a)) { return this.each(function (c) { f(this).toggleClass(a.call(this, c, this.className, b), b); }); } return this.each(function () { if (c === "string") { var e, g = 0, h = f(this), i = b, j = a.split(p); while (e = j[g++]) { i = d ? i : !h.hasClass(e), h[i ? "addClass" : "removeClass"](e); } } else { if (c === "undefined" || c === "boolean") { this.className && f._data(this, "__className__", this.className), this.className = this.className || a === !1 ? "" : f._data(this, "__className__") || ""; } } }); }, hasClass: function (a) { var b = " " + a + " ", c = 0, d = this.length; for (; c < d; c++) { if (this[c].nodeType === 1 && (" " + this[c].className + " ").replace(o, " ").indexOf(b) > -1) { return !0; } } return !1; }, val: function (a) { var c, d, e, g = this[0]; if (!!arguments.length) { e = f.isFunction(a); return this.each(function (d) { var g = f(this), h; if (this.nodeType === 1) { e ? h = a.call(this, d, g.val()) : h = a, h == null ? h = "" : typeof h == "number" ? h += "" : f.isArray(h) && (h = f.map(h, function (a) { return a == null ? "" : a + ""; })), c = f.valHooks[this.type] || f.valHooks[this.nodeName.toLowerCase()]; if (!c || !("set" in c) || c.set(this, h, "value") === b) { this.value = h; } } }); } if (g) { c = f.valHooks[g.type] || f.valHooks[g.nodeName.toLowerCase()]; if (c && "get" in c && (d = c.get(g, "value")) !== b) { return d; } d = g.value; return typeof d == "string" ? d.replace(q, "") : d == null ? "" : d; } } }), f.extend({ valHooks: { option: { get: function (a) { var b = a.attributes.value; return !b || b.specified ? a.value : a.text; } }, select: { get: function (a) { var b, c, d, e, g = a.selectedIndex, h = [], i = a.options, j = a.type === "select-one"; if (g < 0) { return null; } c = j ? g : 0, d = j ? g + 1 : i.length; for (; c < d; c++) { e = i[c]; if (e.selected && (f.support.optDisabled ? !e.disabled : e.getAttribute("disabled") === null) && (!e.parentNode.disabled || !f.nodeName(e.parentNode, "optgroup"))) { b = f(e).val(); if (j) { return b; } h.push(b); } } if (j && !h.length && i.length) { return f(i[g]).val(); } return h; }, set: function (a, b) { var c = f.makeArray(b); f(a).find("option").each(function () { this.selected = f.inArray(f(this).val(), c) >= 0; }), c.length || (a.selectedIndex = -1); return c; } } }, attrFn: { val: !0, css: !0, html: !0, text: !0, data: !0, width: !0, height: !0, offset: !0 }, attr: function (a, c, d, e) { var g, h, i, j = a.nodeType; if (!!a && j !== 3 && j !== 8 && j !== 2) { if (e && c in f.attrFn) { return f(a)[c](d); } if (typeof a.getAttribute == "undefined") { return f.prop(a, c, d); } i = j !== 1 || !f.isXMLDoc(a), i && (c = c.toLowerCase(), h = f.attrHooks[c] || (u.test(c) ? x : w)); if (d !== b) { if (d === null) { f.removeAttr(a, c); return; } if (h && "set" in h && i && (g = h.set(a, d, c)) !== b) { return g; } a.setAttribute(c, "" + d); return d; } if (h && "get" in h && i && (g = h.get(a, c)) !== null) { return g; } g = a.getAttribute(c); return g === null ? b : g; } }, removeAttr: function (a, b) { var c, d, e, g, h, i = 0; if (b && a.nodeType === 1) { d = b.toLowerCase().split(p), g = d.length; for (; i < g; i++) { e = d[i], e && (c = f.propFix[e] || e, h = u.test(e), h || f.attr(a, e, ""), a.removeAttribute(v ? e : c), h && c in a && (a[c] = !1)); } } }, attrHooks: { type: { set: function (a, b) { if (r.test(a.nodeName) && a.parentNode) { f.error("type property can't be changed"); } else { if (!f.support.radioValue && b === "radio" && f.nodeName(a, "input")) { var c = a.value; a.setAttribute("type", b), c && (a.value = c); return b; } } } }, value: { get: function (a, b) { if (w && f.nodeName(a, "button")) { return w.get(a, b); } return b in a ? a.value : null; }, set: function (a, b, c) { if (w && f.nodeName(a, "button")) { return w.set(a, b, c); } a.value = b; } } }, propFix: { tabindex: "tabIndex", readonly: "readOnly", "for": "htmlFor", "class": "className", maxlength: "maxLength", cellspacing: "cellSpacing", cellpadding: "cellPadding", rowspan: "rowSpan", colspan: "colSpan", usemap: "useMap", frameborder: "frameBorder", contenteditable: "contentEditable" }, prop: function (a, c, d) { var e, g, h, i = a.nodeType; if (!!a && i !== 3 && i !== 8 && i !== 2) { h = i !== 1 || !f.isXMLDoc(a), h && (c = f.propFix[c] || c, g = f.propHooks[c]); return d !== b ? g && "set" in g && (e = g.set(a, d, c)) !== b ? e : a[c] = d : g && "get" in g && (e = g.get(a, c)) !== null ? e : a[c]; } }, propHooks: { tabIndex: { get: function (a) { var c = a.getAttributeNode("tabindex"); return c && c.specified ? parseInt(c.value, 10) : s.test(a.nodeName) || t.test(a.nodeName) && a.href ? 0 : b; } } } }), f.attrHooks.tabindex = f.propHooks.tabIndex, x = { get: function (a, c) { var d, e = f.prop(a, c); return e === !0 || typeof e != "boolean" && (d = a.getAttributeNode(c)) && d.nodeValue !== !1 ? c.toLowerCase() : b; }, set: function (a, b, c) { var d; b === !1 ? f.removeAttr(a, c) : (d = f.propFix[c] || c, d in a && (a[d] = !0), a.setAttribute(c, c.toLowerCase())); return c; } }, v || (y = { name: !0, id: !0, coords: !0 }, w = f.valHooks.button = { get: function (a, c) { var d; d = a.getAttributeNode(c); return d && (y[c] ? d.nodeValue !== "" : d.specified) ? d.nodeValue : b; }, set: function (a, b, d) { var e = a.getAttributeNode(d); e || (e = c.createAttribute(d), a.setAttributeNode(e)); return e.nodeValue = b + ""; } }, f.attrHooks.tabindex.set = w.set, f.each(["width", "height"], function (a, b) { f.attrHooks[b] = f.extend(f.attrHooks[b], { set: function (a, c) { if (c === "") { a.setAttribute(b, "auto"); return c; } } }); }), f.attrHooks.contenteditable = { get: w.get, set: function (a, b, c) { b === "" && (b = "false"), w.set(a, b, c); } }), f.support.hrefNormalized || f.each(["href", "src", "width", "height"], function (a, c) { f.attrHooks[c] = f.extend(f.attrHooks[c], { get: function (a) { var d = a.getAttribute(c, 2); return d === null ? b : d; } }); }), f.support.style || (f.attrHooks.style = { get: function (a) { return a.style.cssText.toLowerCase() || b; }, set: function (a, b) { return a.style.cssText = "" + b; } }), f.support.optSelected || (f.propHooks.selected = f.extend(f.propHooks.selected, { get: function (a) { var b = a.parentNode; b && (b.selectedIndex, b.parentNode && b.parentNode.selectedIndex); return null; } })), f.support.enctype || (f.propFix.enctype = "encoding"), f.support.checkOn || f.each(["radio", "checkbox"], function () { f.valHooks[this] = { get: function (a) { return a.getAttribute("value") === null ? "on" : a.value; } }; }), f.each(["radio", "checkbox"], function () { f.valHooks[this] = f.extend(f.valHooks[this], { set: function (a, b) { if (f.isArray(b)) { return a.checked = f.inArray(f(a).val(), b) >= 0; } } }); }); var z = /^(?:textarea|input|select)$/i, A = /^([^\.]*)?(?:\.(.+))?$/, B = /(?:^|\s)hover(\.\S+)?\b/, C = /^key/, D = /^(?:mouse|contextmenu)|click/, E = /^(?:focusinfocus|focusoutblur)$/, F = /^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/, G = function (a) { var b = F.exec(a); b && (b[1] = (b[1] || "").toLowerCase(), b[3] = b[3] && new RegExp("(?:^|\\s)" + b[3] + "(?:\\s|$)")); return b; }, H = function (a, b) { var c = a.attributes || {}; return (!b[1] || a.nodeName.toLowerCase() === b[1]) && (!b[2] || (c.id || {}).value === b[2]) && (!b[3] || b[3].test((c["class"] || {}).value)); }, I = function (a) { return f.event.special.hover ? a : a.replace(B, "mouseenter$1 mouseleave$1"); }; f.event = { add: function (a, c, d, e, g) { var h, i, j, k, l, m, n, o, p, q, r, s; if (!(a.nodeType === 3 || a.nodeType === 8 || !c || !d || !(h = f._data(a)))) { d.handler && (p = d, d = p.handler, g = p.selector), d.guid || (d.guid = f.guid++), j = h.events, j || (h.events = j = {}), i = h.handle, i || (h.handle = i = function (a) { return typeof f != "undefined" && (!a || f.event.triggered !== a.type) ? f.event.dispatch.apply(i.elem, arguments) : b; }, i.elem = a), c = f.trim(I(c)).split(" "); for (k = 0; k < c.length; k++) { l = A.exec(c[k]) || [], m = l[1], n = (l[2] || "").split(".").sort(), s = f.event.special[m] || {}, m = (g ? s.delegateType : s.bindType) || m, s = f.event.special[m] || {}, o = f.extend({ type: m, origType: l[1], data: e, handler: d, guid: d.guid, selector: g, quick: g && G(g), namespace: n.join(".") }, p), r = j[m]; if (!r) { r = j[m] = [], r.delegateCount = 0; if (!s.setup || s.setup.call(a, e, n, i) === !1) { a.addEventListener ? a.addEventListener(m, i, !1) : a.attachEvent && a.attachEvent("on" + m, i); } } s.add && (s.add.call(a, o), o.handler.guid || (o.handler.guid = d.guid)), g ? r.splice(r.delegateCount++, 0, o) : r.push(o), f.event.global[m] = !0; } a = null; } }, global: {}, remove: function (a, b, c, d, e) { var g = f.hasData(a) && f._data(a), h, i, j, k, l, m, n, o, p, q, r, s; if (!!g && !!(o = g.events)) { b = f.trim(I(b || "")).split(" "); for (h = 0; h < b.length; h++) { i = A.exec(b[h]) || [], j = k = i[1], l = i[2]; if (!j) { for (j in o) { f.event.remove(a, j + b[h], c, d, !0); } continue; } p = f.event.special[j] || {}, j = (d ? p.delegateType : p.bindType) || j, r = o[j] || [], m = r.length, l = l ? new RegExp("(^|\\.)" + l.split(".").sort().join("\\.(?:.*\\.)?") + "(\\.|$)") : null; for (n = 0; n < r.length; n++) { s = r[n], (e || k === s.origType) && (!c || c.guid === s.guid) && (!l || l.test(s.namespace)) && (!d || d === s.selector || d === "**" && s.selector) && (r.splice(n--, 1), s.selector && r.delegateCount--, p.remove && p.remove.call(a, s)); } r.length === 0 && m !== r.length && ((!p.teardown || p.teardown.call(a, l) === !1) && f.removeEvent(a, j, g.handle), delete o[j]); } f.isEmptyObject(o) && (q = g.handle, q && (q.elem = null), f.removeData(a, ["events", "handle"], !0)); } }, customEvent: { getData: !0, setData: !0, changeData: !0 }, trigger: function (c, d, e, g) { if (!e || e.nodeType !== 3 && e.nodeType !== 8) { var h = c.type || c, i = [], j, k, l, m, n, o, p, q, r, s; if (E.test(h + f.event.triggered)) { return; } h.indexOf("!") >= 0 && (h = h.slice(0, -1), k = !0), h.indexOf(".") >= 0 && (i = h.split("."), h = i.shift(), i.sort()); if ((!e || f.event.customEvent[h]) && !f.event.global[h]) { return; } c = typeof c == "object" ? c[f.expando] ? c : new f.Event(h, c) : new f.Event(h), c.type = h, c.isTrigger = !0, c.exclusive = k, c.namespace = i.join("."), c.namespace_re = c.namespace ? new RegExp("(^|\\.)" + i.join("\\.(?:.*\\.)?") + "(\\.|$)") : null, o = h.indexOf(":") < 0 ? "on" + h : ""; if (!e) { j = f.cache; for (l in j) { j[l].events && j[l].events[h] && f.event.trigger(c, d, j[l].handle.elem, !0); } return; } c.result = b, c.target || (c.target = e), d = d != null ? f.makeArray(d) : [], d.unshift(c), p = f.event.special[h] || {}; if (p.trigger && p.trigger.apply(e, d) === !1) { return; } r = [[e, p.bindType || h]]; if (!g && !p.noBubble && !f.isWindow(e)) { s = p.delegateType || h, m = E.test(s + h) ? e : e.parentNode, n = null; for (; m; m = m.parentNode) { r.push([m, s]), n = m; } n && n === e.ownerDocument && r.push([n.defaultView || n.parentWindow || a, s]); } for (l = 0; l < r.length && !c.isPropagationStopped() ; l++) { m = r[l][0], c.type = r[l][1], q = (f._data(m, "events") || {})[c.type] && f._data(m, "handle"), q && q.apply(m, d), q = o && m[o], q && f.acceptData(m) && q.apply(m, d) === !1 && c.preventDefault(); } c.type = h, !g && !c.isDefaultPrevented() && (!p._default || p._default.apply(e.ownerDocument, d) === !1) && (h !== "click" || !f.nodeName(e, "a")) && f.acceptData(e) && o && e[h] && (h !== "focus" && h !== "blur" || c.target.offsetWidth !== 0) && !f.isWindow(e) && (n = e[o], n && (e[o] = null), f.event.triggered = h, e[h](), f.event.triggered = b, n && (e[o] = n)); return c.result; } }, dispatch: function (c) { c = f.event.fix(c || a.event); var d = (f._data(this, "events") || {})[c.type] || [], e = d.delegateCount, g = [].slice.call(arguments, 0), h = !c.exclusive && !c.namespace, i = f.event.special[c.type] || {}, j = [], k, l, m, n, o, p, q, r, s, t, u; g[0] = c, c.delegateTarget = this; if (!i.preDispatch || i.preDispatch.call(this, c) !== !1) { if (e && (!c.button || c.type !== "click")) { n = f(this), n.context = this.ownerDocument || this; for (m = c.target; m != this; m = m.parentNode || this) { if (m.disabled !== !0) { p = {}, r = [], n[0] = m; for (k = 0; k < e; k++) { s = d[k], t = s.selector, p[t] === b && (p[t] = s.quick ? H(m, s.quick) : n.is(t)), p[t] && r.push(s); } r.length && j.push({ elem: m, matches: r }); } } } d.length > e && j.push({ elem: this, matches: d.slice(e) }); for (k = 0; k < j.length && !c.isPropagationStopped() ; k++) { q = j[k], c.currentTarget = q.elem; for (l = 0; l < q.matches.length && !c.isImmediatePropagationStopped() ; l++) { s = q.matches[l]; if (h || !c.namespace && !s.namespace || c.namespace_re && c.namespace_re.test(s.namespace)) { c.data = s.data, c.handleObj = s, o = ((f.event.special[s.origType] || {}).handle || s.handler).apply(q.elem, g), o !== b && (c.result = o, o === !1 && (c.preventDefault(), c.stopPropagation())); } } } i.postDispatch && i.postDispatch.call(this, c); return c.result; } }, props: "attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "), fixHooks: {}, keyHooks: { props: "char charCode key keyCode".split(" "), filter: function (a, b) { a.which == null && (a.which = b.charCode != null ? b.charCode : b.keyCode); return a; } }, mouseHooks: { props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "), filter: function (a, d) { var e, f, g, h = d.button, i = d.fromElement; a.pageX == null && d.clientX != null && (e = a.target.ownerDocument || c, f = e.documentElement, g = e.body, a.pageX = d.clientX + (f && f.scrollLeft || g && g.scrollLeft || 0) - (f && f.clientLeft || g && g.clientLeft || 0), a.pageY = d.clientY + (f && f.scrollTop || g && g.scrollTop || 0) - (f && f.clientTop || g && g.clientTop || 0)), !a.relatedTarget && i && (a.relatedTarget = i === a.target ? d.toElement : i), !a.which && h !== b && (a.which = h & 1 ? 1 : h & 2 ? 3 : h & 4 ? 2 : 0); return a; } }, fix: function (a) { if (a[f.expando]) { return a; } var d, e, g = a, h = f.event.fixHooks[a.type] || {}, i = h.props ? this.props.concat(h.props) : this.props; a = f.Event(g); for (d = i.length; d;) { e = i[--d], a[e] = g[e]; } a.target || (a.target = g.srcElement || c), a.target.nodeType === 3 && (a.target = a.target.parentNode), a.metaKey === b && (a.metaKey = a.ctrlKey); return h.filter ? h.filter(a, g) : a; }, special: { ready: { setup: f.bindReady }, load: { noBubble: !0 }, focus: { delegateType: "focusin" }, blur: { delegateType: "focusout" }, beforeunload: { setup: function (a, b, c) { f.isWindow(this) && (this.onbeforeunload = c); }, teardown: function (a, b) { this.onbeforeunload === b && (this.onbeforeunload = null); } } }, simulate: function (a, b, c, d) { var e = f.extend(new f.Event, c, { type: a, isSimulated: !0, originalEvent: {} }); d ? f.event.trigger(e, null, b) : f.event.dispatch.call(b, e), e.isDefaultPrevented() && c.preventDefault(); } }, f.event.handle = f.event.dispatch, f.removeEvent = c.removeEventListener ? function (a, b, c) { a.removeEventListener && a.removeEventListener(b, c, !1); } : function (a, b, c) { a.detachEvent && a.detachEvent("on" + b, c); }, f.Event = function (a, b) { if (!(this instanceof f.Event)) { return new f.Event(a, b); } a && a.type ? (this.originalEvent = a, this.type = a.type, this.isDefaultPrevented = a.defaultPrevented || a.returnValue === !1 || a.getPreventDefault && a.getPreventDefault() ? K : J) : this.type = a, b && f.extend(this, b), this.timeStamp = a && a.timeStamp || f.now(), this[f.expando] = !0; }, f.Event.prototype = { preventDefault: function () { this.isDefaultPrevented = K; var a = this.originalEvent; !a || (a.preventDefault ? a.preventDefault() : a.returnValue = !1); }, stopPropagation: function () { this.isPropagationStopped = K; var a = this.originalEvent; !a || (a.stopPropagation && a.stopPropagation(), a.cancelBubble = !0); }, stopImmediatePropagation: function () { this.isImmediatePropagationStopped = K, this.stopPropagation(); }, isDefaultPrevented: J, isPropagationStopped: J, isImmediatePropagationStopped: J }, f.each({ mouseenter: "mouseover", mouseleave: "mouseout" }, function (a, b) { f.event.special[a] = { delegateType: b, bindType: b, handle: function (a) { var c = this, d = a.relatedTarget, e = a.handleObj, g = e.selector, h; if (!d || d !== c && !f.contains(c, d)) { a.type = e.origType, h = e.handler.apply(this, arguments), a.type = b; } return h; } }; }), f.support.submitBubbles || (f.event.special.submit = { setup: function () { if (f.nodeName(this, "form")) { return !1; } f.event.add(this, "click._submit keypress._submit", function (a) { var c = a.target, d = f.nodeName(c, "input") || f.nodeName(c, "button") ? c.form : b; d && !d._submit_attached && (f.event.add(d, "submit._submit", function (a) { a._submit_bubble = !0; }), d._submit_attached = !0); }); }, postDispatch: function (a) { a._submit_bubble && (delete a._submit_bubble, this.parentNode && !a.isTrigger && f.event.simulate("submit", this.parentNode, a, !0)); }, teardown: function () { if (f.nodeName(this, "form")) { return !1; } f.event.remove(this, "._submit"); } }), f.support.changeBubbles || (f.event.special.change = { setup: function () { if (z.test(this.nodeName)) { if (this.type === "checkbox" || this.type === "radio") { f.event.add(this, "propertychange._change", function (a) { a.originalEvent.propertyName === "checked" && (this._just_changed = !0); }), f.event.add(this, "click._change", function (a) { this._just_changed && !a.isTrigger && (this._just_changed = !1, f.event.simulate("change", this, a, !0)); }); } return !1; } f.event.add(this, "beforeactivate._change", function (a) { var b = a.target; z.test(b.nodeName) && !b._change_attached && (f.event.add(b, "change._change", function (a) { this.parentNode && !a.isSimulated && !a.isTrigger && f.event.simulate("change", this.parentNode, a, !0); }), b._change_attached = !0); }); }, handle: function (a) { var b = a.target; if (this !== b || a.isSimulated || a.isTrigger || b.type !== "radio" && b.type !== "checkbox") { return a.handleObj.handler.apply(this, arguments); } }, teardown: function () { f.event.remove(this, "._change"); return z.test(this.nodeName); } }), f.support.focusinBubbles || f.each({ focus: "focusin", blur: "focusout" }, function (a, b) { var d = 0, e = function (a) { f.event.simulate(b, a.target, f.event.fix(a), !0); }; f.event.special[b] = { setup: function () { d++ === 0 && c.addEventListener(a, e, !0); }, teardown: function () { --d === 0 && c.removeEventListener(a, e, !0); } }; }), f.fn.extend({ on: function (a, c, d, e, g) { var h, i; if (typeof a == "object") { typeof c != "string" && (d = d || c, c = b); for (i in a) { this.on(i, c, d, a[i], g); } return this; } d == null && e == null ? (e = c, d = c = b) : e == null && (typeof c == "string" ? (e = d, d = b) : (e = d, d = c, c = b)); if (e === !1) { e = J; } else { if (!e) { return this; } } g === 1 && (h = e, e = function (a) { f().off(a); return h.apply(this, arguments); }, e.guid = h.guid || (h.guid = f.guid++)); return this.each(function () { f.event.add(this, a, e, d, c); }); }, one: function (a, b, c, d) { return this.on(a, b, c, d, 1); }, off: function (a, c, d) { if (a && a.preventDefault && a.handleObj) { var e = a.handleObj; f(a.delegateTarget).off(e.namespace ? e.origType + "." + e.namespace : e.origType, e.selector, e.handler); return this; } if (typeof a == "object") { for (var g in a) { this.off(g, c, a[g]); } return this; } if (c === !1 || typeof c == "function") { d = c, c = b; } d === !1 && (d = J); return this.each(function () { f.event.remove(this, a, d, c); }); }, bind: function (a, b, c) { return this.on(a, null, b, c); }, unbind: function (a, b) { return this.off(a, null, b); }, live: function (a, b, c) { f(this.context).on(a, this.selector, b, c); return this; }, die: function (a, b) { f(this.context).off(a, this.selector || "**", b); return this; }, delegate: function (a, b, c, d) { return this.on(b, a, c, d); }, undelegate: function (a, b, c) { return arguments.length == 1 ? this.off(a, "**") : this.off(b, a, c); }, trigger: function (a, b) { return this.each(function () { f.event.trigger(a, b, this); }); }, triggerHandler: function (a, b) { if (this[0]) { return f.event.trigger(a, b, this[0], !0); } }, toggle: function (a) { var b = arguments, c = a.guid || f.guid++, d = 0, e = function (c) { var e = (f._data(this, "lastToggle" + a.guid) || 0) % d; f._data(this, "lastToggle" + a.guid, e + 1), c.preventDefault(); return b[e].apply(this, arguments) || !1; }; e.guid = c; while (d < b.length) { b[d++].guid = c; } return this.click(e); }, hover: function (a, b) { return this.mouseenter(a).mouseleave(b || a); } }), f.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) { f.fn[b] = function (a, c) { c == null && (c = a, a = null); return arguments.length > 0 ? this.on(b, null, a, c) : this.trigger(b); }, f.attrFn && (f.attrFn[b] = !0), C.test(b) && (f.event.fixHooks[b] = f.event.keyHooks), D.test(b) && (f.event.fixHooks[b] = f.event.mouseHooks); }), function () { function x(a, b, c, e, f, g) { for (var h = 0, i = e.length; h < i; h++) { var j = e[h]; if (j) { var k = !1; j = j[a]; while (j) { if (j[d] === c) { k = e[j.sizset]; break; } if (j.nodeType === 1) { g || (j[d] = c, j.sizset = h); if (typeof b != "string") { if (j === b) { k = !0; break; } } else { if (m.filter(b, [j]).length > 0) { k = j; break; } } } j = j[a]; } e[h] = k; } } } function w(a, b, c, e, f, g) { for (var h = 0, i = e.length; h < i; h++) { var j = e[h]; if (j) { var k = !1; j = j[a]; while (j) { if (j[d] === c) { k = e[j.sizset]; break; } j.nodeType === 1 && !g && (j[d] = c, j.sizset = h); if (j.nodeName.toLowerCase() === b) { k = j; break; } j = j[a]; } e[h] = k; } } } var a = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g, d = "sizcache" + (Math.random() + "").replace(".", ""), e = 0, g = Object.prototype.toString, h = !1, i = !0, j = /\\/g, k = /\r\n/g, l = /\W/;[0, 0].sort(function () { i = !1; return 0; }); var m = function (b, d, e, f) { e = e || [], d = d || c; var h = d; if (d.nodeType !== 1 && d.nodeType !== 9) { return []; } if (!b || typeof b != "string") { return e; } var i, j, k, l, n, q, r, t, u = !0, v = m.isXML(d), w = [], x = b; do { a.exec(""), i = a.exec(x); if (i) { x = i[3], w.push(i[1]); if (i[2]) { l = i[3]; break; } } } while (i); if (w.length > 1 && p.exec(b)) { if (w.length === 2 && o.relative[w[0]]) { j = y(w[0] + w[1], d, f); } else { j = o.relative[w[0]] ? [d] : m(w.shift(), d); while (w.length) { b = w.shift(), o.relative[b] && (b += w.shift()), j = y(b, j, f); } } } else { !f && w.length > 1 && d.nodeType === 9 && !v && o.match.ID.test(w[0]) && !o.match.ID.test(w[w.length - 1]) && (n = m.find(w.shift(), d, v), d = n.expr ? m.filter(n.expr, n.set)[0] : n.set[0]); if (d) { n = f ? { expr: w.pop(), set: s(f) } : m.find(w.pop(), w.length === 1 && (w[0] === "~" || w[0] === "+") && d.parentNode ? d.parentNode : d, v), j = n.expr ? m.filter(n.expr, n.set) : n.set, w.length > 0 ? k = s(j) : u = !1; while (w.length) { q = w.pop(), r = q, o.relative[q] ? r = w.pop() : q = "", r == null && (r = d), o.relative[q](k, r, v); } } else { k = w = []; } } k || (k = j), k || m.error(q || b); if (g.call(k) === "[object Array]") { if (!u) { e.push.apply(e, k); } else { if (d && d.nodeType === 1) { for (t = 0; k[t] != null; t++) { k[t] && (k[t] === !0 || k[t].nodeType === 1 && m.contains(d, k[t])) && e.push(j[t]); } } else { for (t = 0; k[t] != null; t++) { k[t] && k[t].nodeType === 1 && e.push(j[t]); } } } } else { s(k, e); } l && (m(l, h, e, f), m.uniqueSort(e)); return e; }; m.uniqueSort = function (a) { if (u) { h = i, a.sort(u); if (h) { for (var b = 1; b < a.length; b++) { a[b] === a[b - 1] && a.splice(b--, 1); } } } return a; }, m.matches = function (a, b) { return m(a, null, null, b); }, m.matchesSelector = function (a, b) { return m(b, null, null, [a]).length > 0; }, m.find = function (a, b, c) { var d, e, f, g, h, i; if (!a) { return []; } for (e = 0, f = o.order.length; e < f; e++) { h = o.order[e]; if (g = o.leftMatch[h].exec(a)) { i = g[1], g.splice(1, 1); if (i.substr(i.length - 1) !== "\\") { g[1] = (g[1] || "").replace(j, ""), d = o.find[h](g, b, c); if (d != null) { a = a.replace(o.match[h], ""); break; } } } } d || (d = typeof b.getElementsByTagName != "undefined" ? b.getElementsByTagName("*") : []); return { set: d, expr: a }; }, m.filter = function (a, c, d, e) { var f, g, h, i, j, k, l, n, p, q = a, r = [], s = c, t = c && c[0] && m.isXML(c[0]); while (a && c.length) { for (h in o.filter) { if ((f = o.leftMatch[h].exec(a)) != null && f[2]) { k = o.filter[h], l = f[1], g = !1, f.splice(1, 1); if (l.substr(l.length - 1) === "\\") { continue; } s === r && (r = []); if (o.preFilter[h]) { f = o.preFilter[h](f, s, d, r, e, t); if (!f) { g = i = !0; } else { if (f === !0) { continue; } } } if (f) { for (n = 0; (j = s[n]) != null; n++) { j && (i = k(j, f, n, s), p = e ^ i, d && i != null ? p ? g = !0 : s[n] = !1 : p && (r.push(j), g = !0)); } } if (i !== b) { d || (s = r), a = a.replace(o.match[h], ""); if (!g) { return []; } break; } } } if (a === q) { if (g == null) { m.error(a); } else { break; } } q = a; } return s; }, m.error = function (a) { throw new Error("Syntax error, unrecognized expression: " + a); }; var n = m.getText = function (a) { var b, c, d = a.nodeType, e = ""; if (d) { if (d === 1 || d === 9 || d === 11) { if (typeof a.textContent == "string") { return a.textContent; } if (typeof a.innerText == "string") { return a.innerText.replace(k, ""); } for (a = a.firstChild; a; a = a.nextSibling) { e += n(a); } } else { if (d === 3 || d === 4) { return a.nodeValue; } } } else { for (b = 0; c = a[b]; b++) { c.nodeType !== 8 && (e += n(c)); } } return e; }, o = m.selectors = { order: ["ID", "NAME", "TAG"], match: { ID: /#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/, CLASS: /\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/, NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/, ATTR: /\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/, TAG: /^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/, CHILD: /:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/, POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/, PSEUDO: /:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/ }, leftMatch: {}, attrMap: { "class": "className", "for": "htmlFor" }, attrHandle: { href: function (a) { return a.getAttribute("href"); }, type: function (a) { return a.getAttribute("type"); } }, relative: { "+": function (a, b) { var c = typeof b == "string", d = c && !l.test(b), e = c && !d; d && (b = b.toLowerCase()); for (var f = 0, g = a.length, h; f < g; f++) { if (h = a[f]) { while ((h = h.previousSibling) && h.nodeType !== 1) { } a[f] = e || h && h.nodeName.toLowerCase() === b ? h || !1 : h === b; } } e && m.filter(b, a, !0); }, ">": function (a, b) { var c, d = typeof b == "string", e = 0, f = a.length; if (d && !l.test(b)) { b = b.toLowerCase(); for (; e < f; e++) { c = a[e]; if (c) { var g = c.parentNode; a[e] = g.nodeName.toLowerCase() === b ? g : !1; } } } else { for (; e < f; e++) { c = a[e], c && (a[e] = d ? c.parentNode : c.parentNode === b); } d && m.filter(b, a, !0); } }, "": function (a, b, c) { var d, f = e++, g = x; typeof b == "string" && !l.test(b) && (b = b.toLowerCase(), d = b, g = w), g("parentNode", b, f, a, d, c); }, "~": function (a, b, c) { var d, f = e++, g = x; typeof b == "string" && !l.test(b) && (b = b.toLowerCase(), d = b, g = w), g("previousSibling", b, f, a, d, c); } }, find: { ID: function (a, b, c) { if (typeof b.getElementById != "undefined" && !c) { var d = b.getElementById(a[1]); return d && d.parentNode ? [d] : []; } }, NAME: function (a, b) { if (typeof b.getElementsByName != "undefined") { var c = [], d = b.getElementsByName(a[1]); for (var e = 0, f = d.length; e < f; e++) { d[e].getAttribute("name") === a[1] && c.push(d[e]); } return c.length === 0 ? null : c; } }, TAG: function (a, b) { if (typeof b.getElementsByTagName != "undefined") { return b.getElementsByTagName(a[1]); } } }, preFilter: { CLASS: function (a, b, c, d, e, f) { a = " " + a[1].replace(j, "") + " "; if (f) { return a; } for (var g = 0, h; (h = b[g]) != null; g++) { h && (e ^ (h.className && (" " + h.className + " ").replace(/[\t\n\r]/g, " ").indexOf(a) >= 0) ? c || d.push(h) : c && (b[g] = !1)); } return !1; }, ID: function (a) { return a[1].replace(j, ""); }, TAG: function (a, b) { return a[1].replace(j, "").toLowerCase(); }, CHILD: function (a) { if (a[1] === "nth") { a[2] || m.error(a[0]), a[2] = a[2].replace(/^\+|\s*/g, ""); var b = /(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2] === "even" && "2n" || a[2] === "odd" && "2n+1" || !/\D/.test(a[2]) && "0n+" + a[2] || a[2]); a[2] = b[1] + (b[2] || 1) - 0, a[3] = b[3] - 0; } else { a[2] && m.error(a[0]); } a[0] = e++; return a; }, ATTR: function (a, b, c, d, e, f) { var g = a[1] = a[1].replace(j, ""); !f && o.attrMap[g] && (a[1] = o.attrMap[g]), a[4] = (a[4] || a[5] || "").replace(j, ""), a[2] === "~=" && (a[4] = " " + a[4] + " "); return a; }, PSEUDO: function (b, c, d, e, f) { if (b[1] === "not") { if ((a.exec(b[3]) || "").length > 1 || /^\w/.test(b[3])) { b[3] = m(b[3], null, null, c); } else { var g = m.filter(b[3], c, d, !0 ^ f); d || e.push.apply(e, g); return !1; } } else { if (o.match.POS.test(b[0]) || o.match.CHILD.test(b[0])) { return !0; } } return b; }, POS: function (a) { a.unshift(!0); return a; } }, filters: { enabled: function (a) { return a.disabled === !1 && a.type !== "hidden"; }, disabled: function (a) { return a.disabled === !0; }, checked: function (a) { return a.checked === !0; }, selected: function (a) { a.parentNode && a.parentNode.selectedIndex; return a.selected === !0; }, parent: function (a) { return !!a.firstChild; }, empty: function (a) { return !a.firstChild; }, has: function (a, b, c) { return !!m(c[3], a).length; }, header: function (a) { return /h\d/i.test(a.nodeName); }, text: function (a) { var b = a.getAttribute("type"), c = a.type; return a.nodeName.toLowerCase() === "input" && "text" === c && (b === c || b === null); }, radio: function (a) { return a.nodeName.toLowerCase() === "input" && "radio" === a.type; }, checkbox: function (a) { return a.nodeName.toLowerCase() === "input" && "checkbox" === a.type; }, file: function (a) { return a.nodeName.toLowerCase() === "input" && "file" === a.type; }, password: function (a) { return a.nodeName.toLowerCase() === "input" && "password" === a.type; }, submit: function (a) { var b = a.nodeName.toLowerCase(); return (b === "input" || b === "button") && "submit" === a.type; }, image: function (a) { return a.nodeName.toLowerCase() === "input" && "image" === a.type; }, reset: function (a) { var b = a.nodeName.toLowerCase(); return (b === "input" || b === "button") && "reset" === a.type; }, button: function (a) { var b = a.nodeName.toLowerCase(); return b === "input" && "button" === a.type || b === "button"; }, input: function (a) { return /input|select|textarea|button/i.test(a.nodeName); }, focus: function (a) { return a === a.ownerDocument.activeElement; } }, setFilters: { first: function (a, b) { return b === 0; }, last: function (a, b, c, d) { return b === d.length - 1; }, even: function (a, b) { return b % 2 === 0; }, odd: function (a, b) { return b % 2 === 1; }, lt: function (a, b, c) { return b < c[3] - 0; }, gt: function (a, b, c) { return b > c[3] - 0; }, nth: function (a, b, c) { return c[3] - 0 === b; }, eq: function (a, b, c) { return c[3] - 0 === b; } }, filter: { PSEUDO: function (a, b, c, d) { var e = b[1], f = o.filters[e]; if (f) { return f(a, c, b, d); } if (e === "contains") { return (a.textContent || a.innerText || n([a]) || "").indexOf(b[3]) >= 0; } if (e === "not") { var g = b[3]; for (var h = 0, i = g.length; h < i; h++) { if (g[h] === a) { return !1; } } return !0; } m.error(e); }, CHILD: function (a, b) { var c, e, f, g, h, i, j, k = b[1], l = a; switch (k) { case "only": case "first": while (l = l.previousSibling) { if (l.nodeType === 1) { return !1; } } if (k === "first") { return !0; } l = a; case "last": while (l = l.nextSibling) { if (l.nodeType === 1) { return !1; } } return !0; case "nth": c = b[2], e = b[3]; if (c === 1 && e === 0) { return !0; } f = b[0], g = a.parentNode; if (g && (g[d] !== f || !a.nodeIndex)) { i = 0; for (l = g.firstChild; l; l = l.nextSibling) { l.nodeType === 1 && (l.nodeIndex = ++i); } g[d] = f; } j = a.nodeIndex - e; return c === 0 ? j === 0 : j % c === 0 && j / c >= 0; } }, ID: function (a, b) { return a.nodeType === 1 && a.getAttribute("id") === b; }, TAG: function (a, b) { return b === "*" && a.nodeType === 1 || !!a.nodeName && a.nodeName.toLowerCase() === b; }, CLASS: function (a, b) { return (" " + (a.className || a.getAttribute("class")) + " ").indexOf(b) > -1; }, ATTR: function (a, b) { var c = b[1], d = m.attr ? m.attr(a, c) : o.attrHandle[c] ? o.attrHandle[c](a) : a[c] != null ? a[c] : a.getAttribute(c), e = d + "", f = b[2], g = b[4]; return d == null ? f === "!=" : !f && m.attr ? d != null : f === "=" ? e === g : f === "*=" ? e.indexOf(g) >= 0 : f === "~=" ? (" " + e + " ").indexOf(g) >= 0 : g ? f === "!=" ? e !== g : f === "^=" ? e.indexOf(g) === 0 : f === "$=" ? e.substr(e.length - g.length) === g : f === "|=" ? e === g || e.substr(0, g.length + 1) === g + "-" : !1 : e && d !== !1; }, POS: function (a, b, c, d) { var e = b[2], f = o.setFilters[e]; if (f) { return f(a, c, b, d); } } } }, p = o.match.POS, q = function (a, b) { return "\\" + (b - 0 + 1); }; for (var r in o.match) { o.match[r] = new RegExp(o.match[r].source + /(?![^\[]*\])(?![^\(]*\))/.source), o.leftMatch[r] = new RegExp(/(^(?:.|\r|\n)*?)/.source + o.match[r].source.replace(/\\(\d+)/g, q)); } o.match.globalPOS = p; var s = function (a, b) { a = Array.prototype.slice.call(a, 0); if (b) { b.push.apply(b, a); return b; } return a; }; try { Array.prototype.slice.call(c.documentElement.childNodes, 0)[0].nodeType; } catch (t) { s = function (a, b) { var c = 0, d = b || []; if (g.call(a) === "[object Array]") { Array.prototype.push.apply(d, a); } else { if (typeof a.length == "number") { for (var e = a.length; c < e; c++) { d.push(a[c]); } } else { for (; a[c]; c++) { d.push(a[c]); } } } return d; }; } var u, v; c.documentElement.compareDocumentPosition ? u = function (a, b) { if (a === b) { h = !0; return 0; } if (!a.compareDocumentPosition || !b.compareDocumentPosition) { return a.compareDocumentPosition ? -1 : 1; } return a.compareDocumentPosition(b) & 4 ? -1 : 1; } : (u = function (a, b) { if (a === b) { h = !0; return 0; } if (a.sourceIndex && b.sourceIndex) { return a.sourceIndex - b.sourceIndex; } var c, d, e = [], f = [], g = a.parentNode, i = b.parentNode, j = g; if (g === i) { return v(a, b); } if (!g) { return -1; } if (!i) { return 1; } while (j) { e.unshift(j), j = j.parentNode; } j = i; while (j) { f.unshift(j), j = j.parentNode; } c = e.length, d = f.length; for (var k = 0; k < c && k < d; k++) { if (e[k] !== f[k]) { return v(e[k], f[k]); } } return k === c ? v(a, f[k], -1) : v(e[k], b, 1); }, v = function (a, b, c) { if (a === b) { return c; } var d = a.nextSibling; while (d) { if (d === b) { return -1; } d = d.nextSibling; } return 1; }), function () { var a = c.createElement("div"), d = "script" + (new Date).getTime(), e = c.documentElement; a.innerHTML = "<a name='" + d + "'/>", e.insertBefore(a, e.firstChild), c.getElementById(d) && (o.find.ID = function (a, c, d) { if (typeof c.getElementById != "undefined" && !d) { var e = c.getElementById(a[1]); return e ? e.id === a[1] || typeof e.getAttributeNode != "undefined" && e.getAttributeNode("id").nodeValue === a[1] ? [e] : b : []; } }, o.filter.ID = function (a, b) { var c = typeof a.getAttributeNode != "undefined" && a.getAttributeNode("id"); return a.nodeType === 1 && c && c.nodeValue === b; }), e.removeChild(a), e = a = null; }(), function () { var a = c.createElement("div"); a.appendChild(c.createComment("")), a.getElementsByTagName("*").length > 0 && (o.find.TAG = function (a, b) { var c = b.getElementsByTagName(a[1]); if (a[1] === "*") { var d = []; for (var e = 0; c[e]; e++) { c[e].nodeType === 1 && d.push(c[e]); } c = d; } return c; }), a.innerHTML = "<a href='#'></a>", a.firstChild && typeof a.firstChild.getAttribute != "undefined" && a.firstChild.getAttribute("href") !== "#" && (o.attrHandle.href = function (a) { return a.getAttribute("href", 2); }), a = null; }(), c.querySelectorAll && function () { var a = m, b = c.createElement("div"), d = "__sizzle__"; b.innerHTML = "<p class='TEST'></p>"; if (!b.querySelectorAll || b.querySelectorAll(".TEST").length !== 0) { m = function (b, e, f, g) { e = e || c; if (!g && !m.isXML(e)) { var h = /^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b); if (h && (e.nodeType === 1 || e.nodeType === 9)) { if (h[1]) { return s(e.getElementsByTagName(b), f); } if (h[2] && o.find.CLASS && e.getElementsByClassName) { return s(e.getElementsByClassName(h[2]), f); } } if (e.nodeType === 9) { if (b === "body" && e.body) { return s([e.body], f); } if (h && h[3]) { var i = e.getElementById(h[3]); if (!i || !i.parentNode) { return s([], f); } if (i.id === h[3]) { return s([i], f); } } try { return s(e.querySelectorAll(b), f); } catch (j) { } } else { if (e.nodeType === 1 && e.nodeName.toLowerCase() !== "object") { var k = e, l = e.getAttribute("id"), n = l || d, p = e.parentNode, q = /^\s*[+~]/.test(b); l ? n = n.replace(/'/g, "\\$&") : e.setAttribute("id", n), q && p && (e = e.parentNode); try { if (!q || p) { return s(e.querySelectorAll("[id='" + n + "'] " + b), f); } } catch (r) { } finally { l || k.removeAttribute("id"); } } } } return a(b, e, f, g); }; for (var e in a) { m[e] = a[e]; } b = null; } }(), function () { var a = c.documentElement, b = a.matchesSelector || a.mozMatchesSelector || a.webkitMatchesSelector || a.msMatchesSelector; if (b) { var d = !b.call(c.createElement("div"), "div"), e = !1; try { b.call(c.documentElement, "[test!='']:sizzle"); } catch (f) { e = !0; } m.matchesSelector = function (a, c) { c = c.replace(/\=\s*([^'"\]]*)\s*\]/g, "='$1']"); if (!m.isXML(a)) { try { if (e || !o.match.PSEUDO.test(c) && !/!=/.test(c)) { var f = b.call(a, c); if (f || !d || a.document && a.document.nodeType !== 11) { return f; } } } catch (g) { } } return m(c, null, null, [a]).length > 0; }; } }(), function () { var a = c.createElement("div"); a.innerHTML = "<div class='test e'></div><div class='test'></div>"; if (!!a.getElementsByClassName && a.getElementsByClassName("e").length !== 0) { a.lastChild.className = "e"; if (a.getElementsByClassName("e").length === 1) { return; } o.order.splice(1, 0, "CLASS"), o.find.CLASS = function (a, b, c) { if (typeof b.getElementsByClassName != "undefined" && !c) { return b.getElementsByClassName(a[1]); } }, a = null; } }(), c.documentElement.contains ? m.contains = function (a, b) { return a !== b && (a.contains ? a.contains(b) : !0); } : c.documentElement.compareDocumentPosition ? m.contains = function (a, b) { return !!(a.compareDocumentPosition(b) & 16); } : m.contains = function () { return !1; }, m.isXML = function (a) { var b = (a ? a.ownerDocument || a : 0).documentElement; return b ? b.nodeName !== "HTML" : !1; }; var y = function (a, b, c) { var d, e = [], f = "", g = b.nodeType ? [b] : b; while (d = o.match.PSEUDO.exec(a)) { f += d[0], a = a.replace(o.match.PSEUDO, ""); } a = o.relative[a] ? a + "*" : a; for (var h = 0, i = g.length; h < i; h++) { m(a, g[h], e, c); } return m.filter(f, e); }; m.attr = f.attr, m.selectors.attrMap = {}, f.find = m, f.expr = m.selectors, f.expr[":"] = f.expr.filters, f.unique = m.uniqueSort, f.text = m.getText, f.isXMLDoc = m.isXML, f.contains = m.contains; }(); var L = /Until$/, M = /^(?:parents|prevUntil|prevAll)/, N = /,/, O = /^.[^:#\[\.,]*$/, P = Array.prototype.slice, Q = f.expr.match.globalPOS, R = { children: !0, contents: !0, next: !0, prev: !0 }; f.fn.extend({ find: function (a) { var b = this, c, d; if (typeof a != "string") { return f(a).filter(function () { for (c = 0, d = b.length; c < d; c++) { if (f.contains(b[c], this)) { return !0; } } }); } var e = this.pushStack("", "find", a), g, h, i; for (c = 0, d = this.length; c < d; c++) { g = e.length, f.find(a, this[c], e); if (c > 0) { for (h = g; h < e.length; h++) { for (i = 0; i < g; i++) { if (e[i] === e[h]) { e.splice(h--, 1); break; } } } } } return e; }, has: function (a) { var b = f(a); return this.filter(function () { for (var a = 0, c = b.length; a < c; a++) { if (f.contains(this, b[a])) { return !0; } } }); }, not: function (a) { return this.pushStack(T(this, a, !1), "not", a); }, filter: function (a) { return this.pushStack(T(this, a, !0), "filter", a); }, is: function (a) { return !!a && (typeof a == "string" ? Q.test(a) ? f(a, this.context).index(this[0]) >= 0 : f.filter(a, this).length > 0 : this.filter(a).length > 0); }, closest: function (a, b) { var c = [], d, e, g = this[0]; if (f.isArray(a)) { var h = 1; while (g && g.ownerDocument && g !== b) { for (d = 0; d < a.length; d++) { f(g).is(a[d]) && c.push({ selector: a[d], elem: g, level: h }); } g = g.parentNode, h++; } return c; } var i = Q.test(a) || typeof a != "string" ? f(a, b || this.context) : 0; for (d = 0, e = this.length; d < e; d++) { g = this[d]; while (g) { if (i ? i.index(g) > -1 : f.find.matchesSelector(g, a)) { c.push(g); break; } g = g.parentNode; if (!g || !g.ownerDocument || g === b || g.nodeType === 11) { break; } } } c = c.length > 1 ? f.unique(c) : c; return this.pushStack(c, "closest", a); }, index: function (a) { if (!a) { return this[0] && this[0].parentNode ? this.prevAll().length : -1; } if (typeof a == "string") { return f.inArray(this[0], f(a)); } return f.inArray(a.jquery ? a[0] : a, this); }, add: function (a, b) { var c = typeof a == "string" ? f(a, b) : f.makeArray(a && a.nodeType ? [a] : a), d = f.merge(this.get(), c); return this.pushStack(S(c[0]) || S(d[0]) ? d : f.unique(d)); }, andSelf: function () { return this.add(this.prevObject); } }), f.each({ parent: function (a) { var b = a.parentNode; return b && b.nodeType !== 11 ? b : null; }, parents: function (a) { return f.dir(a, "parentNode"); }, parentsUntil: function (a, b, c) { return f.dir(a, "parentNode", c); }, next: function (a) { return f.nth(a, 2, "nextSibling"); }, prev: function (a) { return f.nth(a, 2, "previousSibling"); }, nextAll: function (a) { return f.dir(a, "nextSibling"); }, prevAll: function (a) { return f.dir(a, "previousSibling"); }, nextUntil: function (a, b, c) { return f.dir(a, "nextSibling", c); }, prevUntil: function (a, b, c) { return f.dir(a, "previousSibling", c); }, siblings: function (a) { return f.sibling((a.parentNode || {}).firstChild, a); }, children: function (a) { return f.sibling(a.firstChild); }, contents: function (a) { return f.nodeName(a, "iframe") ? a.contentDocument || a.contentWindow.document : f.makeArray(a.childNodes); } }, function (a, b) { f.fn[a] = function (c, d) { var e = f.map(this, b, c); L.test(a) || (d = c), d && typeof d == "string" && (e = f.filter(d, e)), e = this.length > 1 && !R[a] ? f.unique(e) : e, (this.length > 1 || N.test(d)) && M.test(a) && (e = e.reverse()); return this.pushStack(e, a, P.call(arguments).join(",")); }; }), f.extend({ filter: function (a, b, c) { c && (a = ":not(" + a + ")"); return b.length === 1 ? f.find.matchesSelector(b[0], a) ? [b[0]] : [] : f.find.matches(a, b); }, dir: function (a, c, d) { var e = [], g = a[c]; while (g && g.nodeType !== 9 && (d === b || g.nodeType !== 1 || !f(g).is(d))) { g.nodeType === 1 && e.push(g), g = g[c]; } return e; }, nth: function (a, b, c, d) { b = b || 1; var e = 0; for (; a; a = a[c]) { if (a.nodeType === 1 && ++e === b) { break; } } return a; }, sibling: function (a, b) { var c = []; for (; a; a = a.nextSibling) { a.nodeType === 1 && a !== b && c.push(a); } return c; } }); var V = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video", W = / jQuery\d+="(?:\d+|null)"/g, X = /^\s+/, Y = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig, Z = /<([\w:]+)/, $ = /<tbody/i, _ = /<|&#?\w+;/, ba = /<(?:script|style)/i, bb = /<(?:script|object|embed|option|style)/i, bc = new RegExp("<(?:" + V + ")[\\s/>]", "i"), bd = /checked\s*(?:[^=]|=\s*.checked.)/i, be = /\/(java|ecma)script/i, bf = /^\s*<!(?:\[CDATA\[|\-\-)/, bg = { option: [1, "<select multiple='multiple'>", "</select>"], legend: [1, "<fieldset>", "</fieldset>"], thead: [1, "<table>", "</table>"], tr: [2, "<table><tbody>", "</tbody></table>"], td: [3, "<table><tbody><tr>", "</tr></tbody></table>"], col: [2, "<table><tbody></tbody><colgroup>", "</colgroup></table>"], area: [1, "<map>", "</map>"], _default: [0, "", ""] }, bh = U(c); bg.optgroup = bg.option, bg.tbody = bg.tfoot = bg.colgroup = bg.caption = bg.thead, bg.th = bg.td, f.support.htmlSerialize || (bg._default = [1, "div<div>", "</div>"]), f.fn.extend({ text: function (a) { return f.access(this, function (a) { return a === b ? f.text(this) : this.empty().append((this[0] && this[0].ownerDocument || c).createTextNode(a)); }, null, a, arguments.length); }, wrapAll: function (a) { if (f.isFunction(a)) { return this.each(function (b) { f(this).wrapAll(a.call(this, b)); }); } if (this[0]) { var b = f(a, this[0].ownerDocument).eq(0).clone(!0); this[0].parentNode && b.insertBefore(this[0]), b.map(function () { var a = this; while (a.firstChild && a.firstChild.nodeType === 1) { a = a.firstChild; } return a; }).append(this); } return this; }, wrapInner: function (a) { if (f.isFunction(a)) { return this.each(function (b) { f(this).wrapInner(a.call(this, b)); }); } return this.each(function () { var b = f(this), c = b.contents(); c.length ? c.wrapAll(a) : b.append(a); }); }, wrap: function (a) { var b = f.isFunction(a); return this.each(function (c) { f(this).wrapAll(b ? a.call(this, c) : a); }); }, unwrap: function () { return this.parent().each(function () { f.nodeName(this, "body") || f(this).replaceWith(this.childNodes); }).end(); }, append: function () { return this.domManip(arguments, !0, function (a) { this.nodeType === 1 && this.appendChild(a); }); }, prepend: function () { return this.domManip(arguments, !0, function (a) { this.nodeType === 1 && this.insertBefore(a, this.firstChild); }); }, before: function () { if (this[0] && this[0].parentNode) { return this.domManip(arguments, !1, function (a) { this.parentNode.insertBefore(a, this); }); } if (arguments.length) { var a = f.clean(arguments); a.push.apply(a, this.toArray()); return this.pushStack(a, "before", arguments); } }, after: function () { if (this[0] && this[0].parentNode) { return this.domManip(arguments, !1, function (a) { this.parentNode.insertBefore(a, this.nextSibling); }); } if (arguments.length) { var a = this.pushStack(this, "after", arguments); a.push.apply(a, f.clean(arguments)); return a; } }, remove: function (a, b) { for (var c = 0, d; (d = this[c]) != null; c++) { if (!a || f.filter(a, [d]).length) { !b && d.nodeType === 1 && (f.cleanData(d.getElementsByTagName("*")), f.cleanData([d])), d.parentNode && d.parentNode.removeChild(d); } } return this; }, empty: function () { for (var a = 0, b; (b = this[a]) != null; a++) { b.nodeType === 1 && f.cleanData(b.getElementsByTagName("*")); while (b.firstChild) { b.removeChild(b.firstChild); } } return this; }, clone: function (a, b) { a = a == null ? !1 : a, b = b == null ? a : b; return this.map(function () { return f.clone(this, a, b); }); }, html: function (a) { return f.access(this, function (a) { var c = this[0] || {}, d = 0, e = this.length; if (a === b) { return c.nodeType === 1 ? c.innerHTML.replace(W, "") : null; } if (typeof a == "string" && !ba.test(a) && (f.support.leadingWhitespace || !X.test(a)) && !bg[(Z.exec(a) || ["", ""])[1].toLowerCase()]) { a = a.replace(Y, "<$1></$2>"); try { for (; d < e; d++) { c = this[d] || {}, c.nodeType === 1 && (f.cleanData(c.getElementsByTagName("*")), c.innerHTML = a); } c = 0; } catch (g) { } } c && this.empty().append(a); }, null, a, arguments.length); }, replaceWith: function (a) { if (this[0] && this[0].parentNode) { if (f.isFunction(a)) { return this.each(function (b) { var c = f(this), d = c.html(); c.replaceWith(a.call(this, b, d)); }); } typeof a != "string" && (a = f(a).detach()); return this.each(function () { var b = this.nextSibling, c = this.parentNode; f(this).remove(), b ? f(b).before(a) : f(c).append(a); }); } return this.length ? this.pushStack(f(f.isFunction(a) ? a() : a), "replaceWith", a) : this; }, detach: function (a) { return this.remove(a, !0); }, domManip: function (a, c, d) { var e, g, h, i, j = a[0], k = []; if (!f.support.checkClone && arguments.length === 3 && typeof j == "string" && bd.test(j)) { return this.each(function () { f(this).domManip(a, c, d, !0); }); } if (f.isFunction(j)) { return this.each(function (e) { var g = f(this); a[0] = j.call(this, e, c ? g.html() : b), g.domManip(a, c, d); }); } if (this[0]) { i = j && j.parentNode, f.support.parentNode && i && i.nodeType === 11 && i.childNodes.length === this.length ? e = { fragment: i } : e = f.buildFragment(a, this, k), h = e.fragment, h.childNodes.length === 1 ? g = h = h.firstChild : g = h.firstChild; if (g) { c = c && f.nodeName(g, "tr"); for (var l = 0, m = this.length, n = m - 1; l < m; l++) { d.call(c ? bi(this[l], g) : this[l], e.cacheable || m > 1 && l < n ? f.clone(h, !0, !0) : h); } } k.length && f.each(k, function (a, b) { b.src ? f.ajax({ type: "GET", global: !1, url: b.src, async: !1, dataType: "script" }) : f.globalEval((b.text || b.textContent || b.innerHTML || "").replace(bf, "/*$0*/")), b.parentNode && b.parentNode.removeChild(b); }); } return this; } }), f.buildFragment = function (a, b, d) { var e, g, h, i, j = a[0]; b && b[0] && (i = b[0].ownerDocument || b[0]), i.createDocumentFragment || (i = c), a.length === 1 && typeof j == "string" && j.length < 512 && i === c && j.charAt(0) === "<" && !bb.test(j) && (f.support.checkClone || !bd.test(j)) && (f.support.html5Clone || !bc.test(j)) && (g = !0, h = f.fragments[j], h && h !== 1 && (e = h)), e || (e = i.createDocumentFragment(), f.clean(a, i, e, d)), g && (f.fragments[j] = h ? e : 1); return { fragment: e, cacheable: g }; }, f.fragments = {}, f.each({ appendTo: "append", prependTo: "prepend", insertBefore: "before", insertAfter: "after", replaceAll: "replaceWith" }, function (a, b) { f.fn[a] = function (c) { var d = [], e = f(c), g = this.length === 1 && this[0].parentNode; if (g && g.nodeType === 11 && g.childNodes.length === 1 && e.length === 1) { e[b](this[0]); return this; } for (var h = 0, i = e.length; h < i; h++) { var j = (h > 0 ? this.clone(!0) : this).get(); f(e[h])[b](j), d = d.concat(j); } return this.pushStack(d, a, e.selector); }; }), f.extend({ clone: function (a, b, c) { var d, e, g, h = f.support.html5Clone || f.isXMLDoc(a) || !bc.test("<" + a.nodeName + ">") ? a.cloneNode(!0) : bo(a); if ((!f.support.noCloneEvent || !f.support.noCloneChecked) && (a.nodeType === 1 || a.nodeType === 11) && !f.isXMLDoc(a)) { bk(a, h), d = bl(a), e = bl(h); for (g = 0; d[g]; ++g) { e[g] && bk(d[g], e[g]); } } if (b) { bj(a, h); if (c) { d = bl(a), e = bl(h); for (g = 0; d[g]; ++g) { bj(d[g], e[g]); } } } d = e = null; return h; }, clean: function (a, b, d, e) { var g, h, i, j = []; b = b || c, typeof b.createElement == "undefined" && (b = b.ownerDocument || b[0] && b[0].ownerDocument || c); for (var k = 0, l; (l = a[k]) != null; k++) { typeof l == "number" && (l += ""); if (!l) { continue; } if (typeof l == "string") { if (!_.test(l)) { l = b.createTextNode(l); } else { l = l.replace(Y, "<$1></$2>"); var m = (Z.exec(l) || ["", ""])[1].toLowerCase(), n = bg[m] || bg._default, o = n[0], p = b.createElement("div"), q = bh.childNodes, r; b === c ? bh.appendChild(p) : U(b).appendChild(p), p.innerHTML = n[1] + l + n[2]; while (o--) { p = p.lastChild; } if (!f.support.tbody) { var s = $.test(l), t = m === "table" && !s ? p.firstChild && p.firstChild.childNodes : n[1] === "<table>" && !s ? p.childNodes : []; for (i = t.length - 1; i >= 0; --i) { f.nodeName(t[i], "tbody") && !t[i].childNodes.length && t[i].parentNode.removeChild(t[i]); } } !f.support.leadingWhitespace && X.test(l) && p.insertBefore(b.createTextNode(X.exec(l)[0]), p.firstChild), l = p.childNodes, p && (p.parentNode.removeChild(p), q.length > 0 && (r = q[q.length - 1], r && r.parentNode && r.parentNode.removeChild(r))); } } var u; if (!f.support.appendChecked) { if (l[0] && typeof (u = l.length) == "number") { for (i = 0; i < u; i++) { bn(l[i]); } } else { bn(l); } } l.nodeType ? j.push(l) : j = f.merge(j, l); } if (d) { g = function (a) { return !a.type || be.test(a.type); }; for (k = 0; j[k]; k++) { h = j[k]; if (e && f.nodeName(h, "script") && (!h.type || be.test(h.type))) { e.push(h.parentNode ? h.parentNode.removeChild(h) : h); } else { if (h.nodeType === 1) { var v = f.grep(h.getElementsByTagName("script"), g); j.splice.apply(j, [k + 1, 0].concat(v)); } d.appendChild(h); } } } return j; }, cleanData: function (a) { var b, c, d = f.cache, e = f.event.special, g = f.support.deleteExpando; for (var h = 0, i; (i = a[h]) != null; h++) { if (i.nodeName && f.noData[i.nodeName.toLowerCase()]) { continue; } c = i[f.expando]; if (c) { b = d[c]; if (b && b.events) { for (var j in b.events) { e[j] ? f.event.remove(i, j) : f.removeEvent(i, j, b.handle); } b.handle && (b.handle.elem = null); } g ? delete i[f.expando] : i.removeAttribute && i.removeAttribute(f.expando), delete d[c]; } } } }); var bp = /alpha\([^)]*\)/i, bq = /opacity=([^)]*)/, br = /([A-Z]|^ms)/g, bs = /^[\-+]?(?:\d*\.)?\d+$/i, bt = /^-?(?:\d*\.)?\d+(?!px)[^\d\s]+$/i, bu = /^([\-+])=([\-+.\de]+)/, bv = /^margin/, bw = { position: "absolute", visibility: "hidden", display: "block" }, bx = ["Top", "Right", "Bottom", "Left"], by, bz, bA; f.fn.css = function (a, c) { return f.access(this, function (a, c, d) { return d !== b ? f.style(a, c, d) : f.css(a, c); }, a, c, arguments.length > 1); }, f.extend({ cssHooks: { opacity: { get: function (a, b) { if (b) { var c = by(a, "opacity"); return c === "" ? "1" : c; } return a.style.opacity; } } }, cssNumber: { fillOpacity: !0, fontWeight: !0, lineHeight: !0, opacity: !0, orphans: !0, widows: !0, zIndex: !0, zoom: !0 }, cssProps: { "float": f.support.cssFloat ? "cssFloat" : "styleFloat" }, style: function (a, c, d, e) { if (!!a && a.nodeType !== 3 && a.nodeType !== 8 && !!a.style) { var g, h, i = f.camelCase(c), j = a.style, k = f.cssHooks[i]; c = f.cssProps[i] || i; if (d === b) { if (k && "get" in k && (g = k.get(a, !1, e)) !== b) { return g; } return j[c]; } h = typeof d, h === "string" && (g = bu.exec(d)) && (d = +(g[1] + 1) * +g[2] + parseFloat(f.css(a, c)), h = "number"); if (d == null || h === "number" && isNaN(d)) { return; } h === "number" && !f.cssNumber[i] && (d += "px"); if (!k || !("set" in k) || (d = k.set(a, d)) !== b) { try { j[c] = d; } catch (l) { } } } }, css: function (a, c, d) { var e, g; c = f.camelCase(c), g = f.cssHooks[c], c = f.cssProps[c] || c, c === "cssFloat" && (c = "float"); if (g && "get" in g && (e = g.get(a, !0, d)) !== b) { return e; } if (by) { return by(a, c); } }, swap: function (a, b, c) { var d = {}, e, f; for (f in b) { d[f] = a.style[f], a.style[f] = b[f]; } e = c.call(a); for (f in b) { a.style[f] = d[f]; } return e; } }), f.curCSS = f.css, c.defaultView && c.defaultView.getComputedStyle && (bz = function (a, b) { var c, d, e, g, h = a.style; b = b.replace(br, "-$1").toLowerCase(), (d = a.ownerDocument.defaultView) && (e = d.getComputedStyle(a, null)) && (c = e.getPropertyValue(b), c === "" && !f.contains(a.ownerDocument.documentElement, a) && (c = f.style(a, b))), !f.support.pixelMargin && e && bv.test(b) && bt.test(c) && (g = h.width, h.width = c, c = e.width, h.width = g); return c; }), c.documentElement.currentStyle && (bA = function (a, b) { var c, d, e, f = a.currentStyle && a.currentStyle[b], g = a.style; f == null && g && (e = g[b]) && (f = e), bt.test(f) && (c = g.left, d = a.runtimeStyle && a.runtimeStyle.left, d && (a.runtimeStyle.left = a.currentStyle.left), g.left = b === "fontSize" ? "1em" : f, f = g.pixelLeft + "px", g.left = c, d && (a.runtimeStyle.left = d)); return f === "" ? "auto" : f; }), by = bz || bA, f.each(["height", "width"], function (a, b) { f.cssHooks[b] = { get: function (a, c, d) { if (c) { return a.offsetWidth !== 0 ? bB(a, b, d) : f.swap(a, bw, function () { return bB(a, b, d); }); } }, set: function (a, b) { return bs.test(b) ? b + "px" : b; } }; }), f.support.opacity || (f.cssHooks.opacity = { get: function (a, b) { return bq.test((b && a.currentStyle ? a.currentStyle.filter : a.style.filter) || "") ? parseFloat(RegExp.$1) / 100 + "" : b ? "1" : ""; }, set: function (a, b) { var c = a.style, d = a.currentStyle, e = f.isNumeric(b) ? "alpha(opacity=" + b * 100 + ")" : "", g = d && d.filter || c.filter || ""; c.zoom = 1; if (b >= 1 && f.trim(g.replace(bp, "")) === "") { c.removeAttribute("filter"); if (d && !d.filter) { return; } } c.filter = bp.test(g) ? g.replace(bp, e) : g + " " + e; } }), f(function () { f.support.reliableMarginRight || (f.cssHooks.marginRight = { get: function (a, b) { return f.swap(a, { display: "inline-block" }, function () { return b ? by(a, "margin-right") : a.style.marginRight; }); } }); }), f.expr && f.expr.filters && (f.expr.filters.hidden = function (a) { var b = a.offsetWidth, c = a.offsetHeight; return b === 0 && c === 0 || !f.support.reliableHiddenOffsets && (a.style && a.style.display || f.css(a, "display")) === "none"; }, f.expr.filters.visible = function (a) { return !f.expr.filters.hidden(a); }), f.each({ margin: "", padding: "", border: "Width" }, function (a, b) { f.cssHooks[a + b] = { expand: function (c) { var d, e = typeof c == "string" ? c.split(" ") : [c], f = {}; for (d = 0; d < 4; d++) { f[a + bx[d] + b] = e[d] || e[d - 2] || e[0]; } return f; } }; }); var bC = /%20/g, bD = /\[\]$/, bE = /\r?\n/g, bF = /#.*$/, bG = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, bH = /^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i, bI = /^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/, bJ = /^(?:GET|HEAD)$/, bK = /^\/\//, bL = /\?/, bM = /<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, bN = /^(?:select|textarea)/i, bO = /\s+/, bP = /([?&])_=[^&]*/, bQ = /^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/, bR = f.fn.load, bS = {}, bT = {}, bU, bV, bW = ["*/"] + ["*"]; try { bU = e.href; } catch (bX) { bU = c.createElement("a"), bU.href = "", bU = bU.href; } bV = bQ.exec(bU.toLowerCase()) || [], f.fn.extend({ load: function (a, c, d) { if (typeof a != "string" && bR) { return bR.apply(this, arguments); } if (!this.length) { return this; } var e = a.indexOf(" "); if (e >= 0) { var g = a.slice(e, a.length); a = a.slice(0, e); } var h = "GET"; c && (f.isFunction(c) ? (d = c, c = b) : typeof c == "object" && (c = f.param(c, f.ajaxSettings.traditional), h = "POST")); var i = this; f.ajax({ url: a, type: h, dataType: "html", data: c, complete: function (a, b, c) { c = a.responseText, a.isResolved() && (a.done(function (a) { c = a; }), i.html(g ? f("<div>").append(c.replace(bM, "")).find(g) : c)), d && i.each(d, [c, b, a]); } }); return this; }, serialize: function () { return f.param(this.serializeArray()); }, serializeArray: function () { return this.map(function () { return this.elements ? f.makeArray(this.elements) : this; }).filter(function () { return this.name && !this.disabled && (this.checked || bN.test(this.nodeName) || bH.test(this.type)); }).map(function (a, b) { var c = f(this).val(); return c == null ? null : f.isArray(c) ? f.map(c, function (a, c) { return { name: b.name, value: a.replace(bE, "\r\n") }; }) : { name: b.name, value: c.replace(bE, "\r\n") }; }).get(); } }), f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "), function (a, b) { f.fn[b] = function (a) { return this.on(b, a); }; }), f.each(["get", "post"], function (a, c) { f[c] = function (a, d, e, g) { f.isFunction(d) && (g = g || e, e = d, d = b); return f.ajax({ type: c, url: a, data: d, success: e, dataType: g }); }; }), f.extend({ getScript: function (a, c) { return f.get(a, b, c, "script"); }, getJSON: function (a, b, c) { return f.get(a, b, c, "json"); }, ajaxSetup: function (a, b) { b ? b$(a, f.ajaxSettings) : (b = a, a = f.ajaxSettings), b$(a, b); return a; }, ajaxSettings: { url: bU, isLocal: bI.test(bV[1]), global: !0, type: "GET", contentType: "application/x-www-form-urlencoded; charset=UTF-8", processData: !0, async: !0, accepts: { xml: "application/xml, text/xml", html: "text/html", text: "text/plain", json: "application/json, text/javascript", "*": bW }, contents: { xml: /xml/, html: /html/, json: /json/ }, responseFields: { xml: "responseXML", text: "responseText" }, converters: { "* text": a.String, "text html": !0, "text json": f.parseJSON, "text xml": f.parseXML }, flatOptions: { context: !0, url: !0 } }, ajaxPrefilter: bY(bS), ajaxTransport: bY(bT), ajax: function (a, c) { function w(a, c, l, m) { if (s !== 2) { s = 2, q && clearTimeout(q), p = b, n = m || "", v.readyState = a > 0 ? 4 : 0; var o, r, u, w = c, x = l ? ca(d, v, l) : b, y, z; if (a >= 200 && a < 300 || a === 304) { if (d.ifModified) { if (y = v.getResponseHeader("Last-Modified")) { f.lastModified[k] = y; } if (z = v.getResponseHeader("Etag")) { f.etag[k] = z; } } if (a === 304) { w = "notmodified", o = !0; } else { try { r = cb(d, x), w = "success", o = !0; } catch (A) { w = "parsererror", u = A; } } } else { u = w; if (!w || a) { w = "error", a < 0 && (a = 0); } } v.status = a, v.statusText = "" + (c || w), o ? h.resolveWith(e, [r, w, v]) : h.rejectWith(e, [v, w, u]), v.statusCode(j), j = b, t && g.trigger("ajax" + (o ? "Success" : "Error"), [v, d, o ? r : u]), i.fireWith(e, [v, w]), t && (g.trigger("ajaxComplete", [v, d]), --f.active || f.event.trigger("ajaxStop")); } } typeof a == "object" && (c = a, a = b), c = c || {}; var d = f.ajaxSetup({}, c), e = d.context || d, g = e !== d && (e.nodeType || e instanceof f) ? f(e) : f.event, h = f.Deferred(), i = f.Callbacks("once memory"), j = d.statusCode || {}, k, l = {}, m = {}, n, o, p, q, r, s = 0, t, u, v = { readyState: 0, setRequestHeader: function (a, b) { if (!s) { var c = a.toLowerCase(); a = m[c] = m[c] || a, l[a] = b; } return this; }, getAllResponseHeaders: function () { return s === 2 ? n : null; }, getResponseHeader: function (a) { var c; if (s === 2) { if (!o) { o = {}; while (c = bG.exec(n)) { o[c[1].toLowerCase()] = c[2]; } } c = o[a.toLowerCase()]; } return c === b ? null : c; }, overrideMimeType: function (a) { s || (d.mimeType = a); return this; }, abort: function (a) { a = a || "abort", p && p.abort(a), w(0, a); return this; } }; h.promise(v), v.success = v.done, v.error = v.fail, v.complete = i.add, v.statusCode = function (a) { if (a) { var b; if (s < 2) { for (b in a) { j[b] = [j[b], a[b]]; } } else { b = a[v.status], v.then(b, b); } } return this; }, d.url = ((a || d.url) + "").replace(bF, "").replace(bK, bV[1] + "//"), d.dataTypes = f.trim(d.dataType || "*").toLowerCase().split(bO), d.crossDomain == null && (r = bQ.exec(d.url.toLowerCase()), d.crossDomain = !(!r || r[1] == bV[1] && r[2] == bV[2] && (r[3] || (r[1] === "http:" ? 80 : 443)) == (bV[3] || (bV[1] === "http:" ? 80 : 443)))), d.data && d.processData && typeof d.data != "string" && (d.data = f.param(d.data, d.traditional)), bZ(bS, d, c, v); if (s === 2) { return !1; } t = d.global, d.type = d.type.toUpperCase(), d.hasContent = !bJ.test(d.type), t && f.active++ === 0 && f.event.trigger("ajaxStart"); if (!d.hasContent) { d.data && (d.url += (bL.test(d.url) ? "&" : "?") + d.data, delete d.data), k = d.url; if (d.cache === !1) { var x = f.now(), y = d.url.replace(bP, "$1_=" + x); d.url = y + (y === d.url ? (bL.test(d.url) ? "&" : "?") + "_=" + x : ""); } } (d.data && d.hasContent && d.contentType !== !1 || c.contentType) && v.setRequestHeader("Content-Type", d.contentType), d.ifModified && (k = k || d.url, f.lastModified[k] && v.setRequestHeader("If-Modified-Since", f.lastModified[k]), f.etag[k] && v.setRequestHeader("If-None-Match", f.etag[k])), v.setRequestHeader("Accept", d.dataTypes[0] && d.accepts[d.dataTypes[0]] ? d.accepts[d.dataTypes[0]] + (d.dataTypes[0] !== "*" ? ", " + bW + "; q=0.01" : "") : d.accepts["*"]); for (u in d.headers) { v.setRequestHeader(u, d.headers[u]); } if (d.beforeSend && (d.beforeSend.call(e, v, d) === !1 || s === 2)) { v.abort(); return !1; } for (u in { success: 1, error: 1, complete: 1 }) { v[u](d[u]); } p = bZ(bT, d, c, v); if (!p) { w(-1, "No Transport"); } else { v.readyState = 1, t && g.trigger("ajaxSend", [v, d]), d.async && d.timeout > 0 && (q = setTimeout(function () { v.abort("timeout"); }, d.timeout)); try { s = 1, p.send(l, w); } catch (z) { if (s < 2) { w(-1, z); } else { throw z; } } } return v; }, param: function (a, c) { var d = [], e = function (a, b) { b = f.isFunction(b) ? b() : b, d[d.length] = encodeURIComponent(a) + "=" + encodeURIComponent(b); }; c === b && (c = f.ajaxSettings.traditional); if (f.isArray(a) || a.jquery && !f.isPlainObject(a)) { f.each(a, function () { e(this.name, this.value); }); } else { for (var g in a) { b_(g, a[g], c, e); } } return d.join("&").replace(bC, "+"); } }), f.extend({ active: 0, lastModified: {}, etag: {} }); var cc = f.now(), cd = /(\=)\?(&|$)|\?\?/i; f.ajaxSetup({ jsonp: "callback", jsonpCallback: function () { return f.expando + "_" + cc++; } }), f.ajaxPrefilter("json jsonp", function (b, c, d) { var e = typeof b.data == "string" && /^application\/x\-www\-form\-urlencoded/.test(b.contentType); if (b.dataTypes[0] === "jsonp" || b.jsonp !== !1 && (cd.test(b.url) || e && cd.test(b.data))) { var g, h = b.jsonpCallback = f.isFunction(b.jsonpCallback) ? b.jsonpCallback() : b.jsonpCallback, i = a[h], j = b.url, k = b.data, l = "$1" + h + "$2"; b.jsonp !== !1 && (j = j.replace(cd, l), b.url === j && (e && (k = k.replace(cd, l)), b.data === k && (j += (/\?/.test(j) ? "&" : "?") + b.jsonp + "=" + h))), b.url = j, b.data = k, a[h] = function (a) { g = [a]; }, d.always(function () { a[h] = i, g && f.isFunction(i) && a[h](g[0]); }), b.converters["script json"] = function () { g || f.error(h + " was not called"); return g[0]; }, b.dataTypes[0] = "json"; return "script"; } }), f.ajaxSetup({ accepts: { script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript" }, contents: { script: /javascript|ecmascript/ }, converters: { "text script": function (a) { f.globalEval(a); return a; } } }), f.ajaxPrefilter("script", function (a) { a.cache === b && (a.cache = !1), a.crossDomain && (a.type = "GET", a.global = !1); }), f.ajaxTransport("script", function (a) { if (a.crossDomain) { var d, e = c.head || c.getElementsByTagName("head")[0] || c.documentElement; return { send: function (f, g) { d = c.createElement("script"), d.async = "async", a.scriptCharset && (d.charset = a.scriptCharset), d.src = a.url, d.onload = d.onreadystatechange = function (a, c) { if (c || !d.readyState || /loaded|complete/.test(d.readyState)) { d.onload = d.onreadystatechange = null, e && d.parentNode && e.removeChild(d), d = b, c || g(200, "success"); } }, e.insertBefore(d, e.firstChild); }, abort: function () { d && d.onload(0, 1); } }; } }); var ce = a.ActiveXObject ? function () { for (var a in cg) { cg[a](0, 1); } } : !1, cf = 0, cg; f.ajaxSettings.xhr = a.ActiveXObject ? function () { return !this.isLocal && ch() || ci(); } : ch, function (a) { f.extend(f.support, { ajax: !!a, cors: !!a && "withCredentials" in a }); }(f.ajaxSettings.xhr()), f.support.ajax && f.ajaxTransport(function (c) { if (!c.crossDomain || f.support.cors) { var d; return { send: function (e, g) { var h = c.xhr(), i, j; c.username ? h.open(c.type, c.url, c.async, c.username, c.password) : h.open(c.type, c.url, c.async); if (c.xhrFields) { for (j in c.xhrFields) { h[j] = c.xhrFields[j]; } } c.mimeType && h.overrideMimeType && h.overrideMimeType(c.mimeType), !c.crossDomain && !e["X-Requested-With"] && (e["X-Requested-With"] = "XMLHttpRequest"); try { for (j in e) { h.setRequestHeader(j, e[j]); } } catch (k) { } h.send(c.hasContent && c.data || null), d = function (a, e) { var j, k, l, m, n; try { if (d && (e || h.readyState === 4)) { d = b, i && (h.onreadystatechange = f.noop, ce && delete cg[i]); if (e) { h.readyState !== 4 && h.abort(); } else { j = h.status, l = h.getAllResponseHeaders(), m = {}, n = h.responseXML, n && n.documentElement && (m.xml = n); try { m.text = h.responseText; } catch (a) { } try { k = h.statusText; } catch (o) { k = ""; } !j && c.isLocal && !c.crossDomain ? j = m.text ? 200 : 404 : j === 1223 && (j = 204); } } } catch (p) { e || g(-1, p); } m && g(j, k, m, l); }, !c.async || h.readyState === 4 ? d() : (i = ++cf, ce && (cg || (cg = {}, f(a).unload(ce)), cg[i] = d), h.onreadystatechange = d); }, abort: function () { d && d(0, 1); } }; } }); var cj = {}, ck, cl, cm = /^(?:toggle|show|hide)$/, cn = /^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i, co, cp = [["height", "marginTop", "marginBottom", "paddingTop", "paddingBottom"], ["width", "marginLeft", "marginRight", "paddingLeft", "paddingRight"], ["opacity"]], cq; f.fn.extend({ show: function (a, b, c) { var d, e; if (a || a === 0) { return this.animate(ct("show", 3), a, b, c); } for (var g = 0, h = this.length; g < h; g++) { d = this[g], d.style && (e = d.style.display, !f._data(d, "olddisplay") && e === "none" && (e = d.style.display = ""), (e === "" && f.css(d, "display") === "none" || !f.contains(d.ownerDocument.documentElement, d)) && f._data(d, "olddisplay", cu(d.nodeName))); } for (g = 0; g < h; g++) { d = this[g]; if (d.style) { e = d.style.display; if (e === "" || e === "none") { d.style.display = f._data(d, "olddisplay") || ""; } } } return this; }, hide: function (a, b, c) { if (a || a === 0) { return this.animate(ct("hide", 3), a, b, c); } var d, e, g = 0, h = this.length; for (; g < h; g++) { d = this[g], d.style && (e = f.css(d, "display"), e !== "none" && !f._data(d, "olddisplay") && f._data(d, "olddisplay", e)); } for (g = 0; g < h; g++) { this[g].style && (this[g].style.display = "none"); } return this; }, _toggle: f.fn.toggle, toggle: function (a, b, c) { var d = typeof a == "boolean"; f.isFunction(a) && f.isFunction(b) ? this._toggle.apply(this, arguments) : a == null || d ? this.each(function () { var b = d ? a : f(this).is(":hidden"); f(this)[b ? "show" : "hide"](); }) : this.animate(ct("toggle", 3), a, b, c); return this; }, fadeTo: function (a, b, c, d) { return this.filter(":hidden").css("opacity", 0).show().end().animate({ opacity: b }, a, c, d); }, animate: function (a, b, c, d) { function g() { e.queue === !1 && f._mark(this); var b = f.extend({}, e), c = this.nodeType === 1, d = c && f(this).is(":hidden"), g, h, i, j, k, l, m, n, o, p, q; b.animatedProperties = {}; for (i in a) { g = f.camelCase(i), i !== g && (a[g] = a[i], delete a[i]); if ((k = f.cssHooks[g]) && "expand" in k) { l = k.expand(a[g]), delete a[g]; for (i in l) { i in a || (a[i] = l[i]); } } } for (g in a) { h = a[g], f.isArray(h) ? (b.animatedProperties[g] = h[1], h = a[g] = h[0]) : b.animatedProperties[g] = b.specialEasing && b.specialEasing[g] || b.easing || "swing"; if (h === "hide" && d || h === "show" && !d) { return b.complete.call(this); } c && (g === "height" || g === "width") && (b.overflow = [this.style.overflow, this.style.overflowX, this.style.overflowY], f.css(this, "display") === "inline" && f.css(this, "float") === "none" && (!f.support.inlineBlockNeedsLayout || cu(this.nodeName) === "inline" ? this.style.display = "inline-block" : this.style.zoom = 1)); } b.overflow != null && (this.style.overflow = "hidden"); for (i in a) { j = new f.fx(this, b, i), h = a[i], cm.test(h) ? (q = f._data(this, "toggle" + i) || (h === "toggle" ? d ? "show" : "hide" : 0), q ? (f._data(this, "toggle" + i, q === "show" ? "hide" : "show"), j[q]()) : j[h]()) : (m = cn.exec(h), n = j.cur(), m ? (o = parseFloat(m[2]), p = m[3] || (f.cssNumber[i] ? "" : "px"), p !== "px" && (f.style(this, i, (o || 1) + p), n = (o || 1) / j.cur() * n, f.style(this, i, n + p)), m[1] && (o = (m[1] === "-=" ? -1 : 1) * o + n), j.custom(n, o, p)) : j.custom(n, h, "")); } return !0; } var e = f.speed(b, c, d); if (f.isEmptyObject(a)) { return this.each(e.complete, [!1]); } a = f.extend({}, a); return e.queue === !1 ? this.each(g) : this.queue(e.queue, g); }, stop: function (a, c, d) { typeof a != "string" && (d = c, c = a, a = b), c && a !== !1 && this.queue(a || "fx", []); return this.each(function () { function h(a, b, c) { var e = b[c]; f.removeData(a, c, !0), e.stop(d); } var b, c = !1, e = f.timers, g = f._data(this); d || f._unmark(!0, this); if (a == null) { for (b in g) { g[b] && g[b].stop && b.indexOf(".run") === b.length - 4 && h(this, g, b); } } else { g[b = a + ".run"] && g[b].stop && h(this, g, b); } for (b = e.length; b--;) { e[b].elem === this && (a == null || e[b].queue === a) && (d ? e[b](!0) : e[b].saveState(), c = !0, e.splice(b, 1)); } (!d || !c) && f.dequeue(this, a); }); } }), f.each({ slideDown: ct("show", 1), slideUp: ct("hide", 1), slideToggle: ct("toggle", 1), fadeIn: { opacity: "show" }, fadeOut: { opacity: "hide" }, fadeToggle: { opacity: "toggle" } }, function (a, b) { f.fn[a] = function (a, c, d) { return this.animate(b, a, c, d); }; }), f.extend({ speed: function (a, b, c) { var d = a && typeof a == "object" ? f.extend({}, a) : { complete: c || !c && b || f.isFunction(a) && a, duration: a, easing: c && b || b && !f.isFunction(b) && b }; d.duration = f.fx.off ? 0 : typeof d.duration == "number" ? d.duration : d.duration in f.fx.speeds ? f.fx.speeds[d.duration] : f.fx.speeds._default; if (d.queue == null || d.queue === !0) { d.queue = "fx"; } d.old = d.complete, d.complete = function (a) { f.isFunction(d.old) && d.old.call(this), d.queue ? f.dequeue(this, d.queue) : a !== !1 && f._unmark(this); }; return d; }, easing: { linear: function (a) { return a; }, swing: function (a) { return -Math.cos(a * Math.PI) / 2 + 0.5; } }, timers: [], fx: function (a, b, c) { this.options = b, this.elem = a, this.prop = c, b.orig = b.orig || {}; } }), f.fx.prototype = { update: function () { this.options.step && this.options.step.call(this.elem, this.now, this), (f.fx.step[this.prop] || f.fx.step._default)(this); }, cur: function () { if (this.elem[this.prop] != null && (!this.elem.style || this.elem.style[this.prop] == null)) { return this.elem[this.prop]; } var a, b = f.css(this.elem, this.prop); return isNaN(a = parseFloat(b)) ? !b || b === "auto" ? 0 : b : a; }, custom: function (a, c, d) { function h(a) { return e.step(a); } var e = this, g = f.fx; this.startTime = cq || cr(), this.end = c, this.now = this.start = a, this.pos = this.state = 0, this.unit = d || this.unit || (f.cssNumber[this.prop] ? "" : "px"), h.queue = this.options.queue, h.elem = this.elem, h.saveState = function () { f._data(e.elem, "fxshow" + e.prop) === b && (e.options.hide ? f._data(e.elem, "fxshow" + e.prop, e.start) : e.options.show && f._data(e.elem, "fxshow" + e.prop, e.end)); }, h() && f.timers.push(h) && !co && (co = setInterval(g.tick, g.interval)); }, show: function () { var a = f._data(this.elem, "fxshow" + this.prop); this.options.orig[this.prop] = a || f.style(this.elem, this.prop), this.options.show = !0, a !== b ? this.custom(this.cur(), a) : this.custom(this.prop === "width" || this.prop === "height" ? 1 : 0, this.cur()), f(this.elem).show(); }, hide: function () { this.options.orig[this.prop] = f._data(this.elem, "fxshow" + this.prop) || f.style(this.elem, this.prop), this.options.hide = !0, this.custom(this.cur(), 0); }, step: function (a) { var b, c, d, e = cq || cr(), g = !0, h = this.elem, i = this.options; if (a || e >= i.duration + this.startTime) { this.now = this.end, this.pos = this.state = 1, this.update(), i.animatedProperties[this.prop] = !0; for (b in i.animatedProperties) { i.animatedProperties[b] !== !0 && (g = !1); } if (g) { i.overflow != null && !f.support.shrinkWrapBlocks && f.each(["", "X", "Y"], function (a, b) { h.style["overflow" + b] = i.overflow[a]; }), i.hide && f(h).hide(); if (i.hide || i.show) { for (b in i.animatedProperties) { f.style(h, b, i.orig[b]), f.removeData(h, "fxshow" + b, !0), f.removeData(h, "toggle" + b, !0); } } d = i.complete, d && (i.complete = !1, d.call(h)); } return !1; } i.duration == Infinity ? this.now = e : (c = e - this.startTime, this.state = c / i.duration, this.pos = f.easing[i.animatedProperties[this.prop]](this.state, c, 0, 1, i.duration), this.now = this.start + (this.end - this.start) * this.pos), this.update(); return !0; } }, f.extend(f.fx, { tick: function () { var a, b = f.timers, c = 0; for (; c < b.length; c++) { a = b[c], !a() && b[c] === a && b.splice(c--, 1); } b.length || f.fx.stop(); }, interval: 13, stop: function () { clearInterval(co), co = null; }, speeds: { slow: 600, fast: 200, _default: 400 }, step: { opacity: function (a) { f.style(a.elem, "opacity", a.now); }, _default: function (a) { a.elem.style && a.elem.style[a.prop] != null ? a.elem.style[a.prop] = a.now + a.unit : a.elem[a.prop] = a.now; } } }), f.each(cp.concat.apply([], cp), function (a, b) { b.indexOf("margin") && (f.fx.step[b] = function (a) { f.style(a.elem, b, Math.max(0, a.now) + a.unit); }); }), f.expr && f.expr.filters && (f.expr.filters.animated = function (a) { return f.grep(f.timers, function (b) { return a === b.elem; }).length; }); var cv, cw = /^t(?:able|d|h)$/i, cx = /^(?:body|html)$/i; "getBoundingClientRect" in c.documentElement ? cv = function (a, b, c, d) { try { d = a.getBoundingClientRect(); } catch (e) { } if (!d || !f.contains(c, a)) { return d ? { top: d.top, left: d.left } : { top: 0, left: 0 }; } var g = b.body, h = cy(b), i = c.clientTop || g.clientTop || 0, j = c.clientLeft || g.clientLeft || 0, k = h.pageYOffset || f.support.boxModel && c.scrollTop || g.scrollTop, l = h.pageXOffset || f.support.boxModel && c.scrollLeft || g.scrollLeft, m = d.top + k - i, n = d.left + l - j; return { top: m, left: n }; } : cv = function (a, b, c) { var d, e = a.offsetParent, g = a, h = b.body, i = b.defaultView, j = i ? i.getComputedStyle(a, null) : a.currentStyle, k = a.offsetTop, l = a.offsetLeft; while ((a = a.parentNode) && a !== h && a !== c) { if (f.support.fixedPosition && j.position === "fixed") { break; } d = i ? i.getComputedStyle(a, null) : a.currentStyle, k -= a.scrollTop, l -= a.scrollLeft, a === e && (k += a.offsetTop, l += a.offsetLeft, f.support.doesNotAddBorder && (!f.support.doesAddBorderForTableAndCells || !cw.test(a.nodeName)) && (k += parseFloat(d.borderTopWidth) || 0, l += parseFloat(d.borderLeftWidth) || 0), g = e, e = a.offsetParent), f.support.subtractsBorderForOverflowNotVisible && d.overflow !== "visible" && (k += parseFloat(d.borderTopWidth) || 0, l += parseFloat(d.borderLeftWidth) || 0), j = d; } if (j.position === "relative" || j.position === "static") { k += h.offsetTop, l += h.offsetLeft; } f.support.fixedPosition && j.position === "fixed" && (k += Math.max(c.scrollTop, h.scrollTop), l += Math.max(c.scrollLeft, h.scrollLeft)); return { top: k, left: l }; }, f.fn.offset = function (a) { if (arguments.length) { return a === b ? this : this.each(function (b) { f.offset.setOffset(this, a, b); }); } var c = this[0], d = c && c.ownerDocument; if (!d) { return null; } if (c === d.body) { return f.offset.bodyOffset(c); } return cv(c, d, d.documentElement); }, f.offset = { bodyOffset: function (a) { var b = a.offsetTop, c = a.offsetLeft; f.support.doesNotIncludeMarginInBodyOffset && (b += parseFloat(f.css(a, "marginTop")) || 0, c += parseFloat(f.css(a, "marginLeft")) || 0); return { top: b, left: c }; }, setOffset: function (a, b, c) { var d = f.css(a, "position"); d === "static" && (a.style.position = "relative"); var e = f(a), g = e.offset(), h = f.css(a, "top"), i = f.css(a, "left"), j = (d === "absolute" || d === "fixed") && f.inArray("auto", [h, i]) > -1, k = {}, l = {}, m, n; j ? (l = e.position(), m = l.top, n = l.left) : (m = parseFloat(h) || 0, n = parseFloat(i) || 0), f.isFunction(b) && (b = b.call(a, c, g)), b.top != null && (k.top = b.top - g.top + m), b.left != null && (k.left = b.left - g.left + n), "using" in b ? b.using.call(a, k) : e.css(k); } }, f.fn.extend({ position: function () { if (!this[0]) { return null; } var a = this[0], b = this.offsetParent(), c = this.offset(), d = cx.test(b[0].nodeName) ? { top: 0, left: 0 } : b.offset(); c.top -= parseFloat(f.css(a, "marginTop")) || 0, c.left -= parseFloat(f.css(a, "marginLeft")) || 0, d.top += parseFloat(f.css(b[0], "borderTopWidth")) || 0, d.left += parseFloat(f.css(b[0], "borderLeftWidth")) || 0; return { top: c.top - d.top, left: c.left - d.left }; }, offsetParent: function () { return this.map(function () { var a = this.offsetParent || c.body; while (a && !cx.test(a.nodeName) && f.css(a, "position") === "static") { a = a.offsetParent; } return a; }); } }), f.each({ scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function (a, c) { var d = /Y/.test(c); f.fn[a] = function (e) { return f.access(this, function (a, e, g) { var h = cy(a); if (g === b) { return h ? c in h ? h[c] : f.support.boxModel && h.document.documentElement[e] || h.document.body[e] : a[e]; } h ? h.scrollTo(d ? f(h).scrollLeft() : g, d ? g : f(h).scrollTop()) : a[e] = g; }, a, e, arguments.length, null); }; }), f.each({ Height: "height", Width: "width" }, function (a, c) { var d = "client" + a, e = "scroll" + a, g = "offset" + a; f.fn["inner" + a] = function () { var a = this[0]; return a ? a.style ? parseFloat(f.css(a, c, "padding")) : this[c]() : null; }, f.fn["outer" + a] = function (a) { var b = this[0]; return b ? b.style ? parseFloat(f.css(b, c, a ? "margin" : "border")) : this[c]() : null; }, f.fn[c] = function (a) { return f.access(this, function (a, c, h) { var i, j, k, l; if (f.isWindow(a)) { i = a.document, j = i.documentElement[d]; return f.support.boxModel && j || i.body && i.body[d] || j; } if (a.nodeType === 9) { i = a.documentElement; if (i[d] >= i[e]) { return i[d]; } return Math.max(a.body[e], i[e], a.body[g], i[g]); } if (h === b) { k = f.css(a, c), l = parseFloat(k); return f.isNumeric(l) ? l : k; } f(a).css(c, h); }, c, a, arguments.length, null); }; }), a.jQuery = a.$ = f, typeof define == "function" && define.amd && define.amd.jQuery && define("jquery", [], function () { return f; }); })(window);
/************
 Classes to set up the drop-down control
 ************/

function optionDiv(options) {
    var control = document.createElement('DIV');
    control.className = "dropDownItemDiv";
    control.title = options.title;
    control.id = options.id;
    control.innerHTML = options.name;
    google.maps.event.addDomListener(control, 'click', options.action);
    return control;
}

function checkBox(options) {
    //first make the outer container
    var container = document.createElement('DIV');
    container.className = "checkboxContainer";
    container.title = options.title;

    var span = document.createElement('SPAN');
    span.role = "checkbox";
    span.className = "checkboxSpan";

    var bDiv = document.createElement('DIV');
    bDiv.className = "blankDiv";
    bDiv.id = options.id;

    var image = document.createElement('IMG');
    image.className = "blankImg";
    image.src = "http://maps.gstatic.com/mapfiles/mv/imgs8.png";

    var label = document.createElement('LABEL');
    label.className = "checkboxLabel";
    label.innerHTML = options.label;

    bDiv.appendChild(image);
    span.appendChild(bDiv);
    container.appendChild(span);
    container.appendChild(label);

    google.maps.event.addDomListener(container, 'click', function () {
        (document.getElementById(bDiv.id).style.display == 'block') ? document.getElementById(bDiv.id).style.display = 'none' : document.getElementById(bDiv.id).style.display = 'block';
        options.action();
    })
    return container;
}
function separator() {
    var sep = document.createElement('DIV');
    sep.className = "separatorDiv";
    return sep;
}

function dropDownOptionsDiv(options) {
    //alert(options.items[1]);
    var container = document.createElement('DIV');
    container.className = "dropDownOptionsDiv";
    container.id = options.id;


    for (i = 0; i < options.items.length; i++) {
        //alert(options.items[i]);
        container.appendChild(options.items[i]);
    }

    //for(item in options.items){
    //container.appendChild(item);
    //alert(item);
    //}        
    return container;
}

function dropDownControl(options) {
    var container = document.createElement('DIV');
    container.className = 'container';

    var control = document.createElement('DIV');
    control.className = 'dropDownControl';
    control.innerHTML = options.name;
    control.id = options.id;
    var arrow = document.createElement('IMG');
    arrow.src = "http://maps.gstatic.com/mapfiles/arrow-down.png";
    arrow.className = 'dropDownArrow';
    control.appendChild(arrow);
    container.appendChild(control);
    container.appendChild(options.dropDown);

    options.gmap.controls[options.position].push(container);
    google.maps.event.addDomListener(container, 'click', function () {
        (document.getElementById('myddOptsDiv').style.display == 'block') ? document.getElementById('myddOptsDiv').style.display = 'none' : document.getElementById('myddOptsDiv').style.display = 'block';
        //document.getElementById('myddOptsDiv').style.display = 'block';

        //setTimeout( function(){
        //	document.getElementById('myddOptsDiv').style.display = 'none';
        //}, 1500);
    })
}

function buttonControl(options) {
    var control = document.createElement('DIV');
    control.innerHTML = options.name;
    control.className = 'button';
    control.index = 1;

    // Add the control to the map
    options.gmap.controls[options.position].push(control);

    // When the button is clicked pan to sydney
    google.maps.event.addDomListener(control, 'click', options.action);
    return control;
}
/* @preserve
 * Leaflet 1.8.0, a JS library for interactive maps. https://leafletjs.com
 * (c) 2010-2022 Vladimir Agafonkin, (c) 2010-2011 CloudMade
 */
!function(t,i){"object"==typeof exports&&"undefined"!=typeof module?i(exports):"function"==typeof define&&define.amd?define(["exports"],i):i((t="undefined"!=typeof globalThis?globalThis:t||self).leaflet={})}(this,function(t){"use strict";function l(t){for(var i,e,n=1,o=arguments.length;n<o;n++)for(i in e=arguments[n])t[i]=e[i];return t}var R=Object.create||function(t){return N.prototype=t,new N};function N(){}function a(t,i){var e=Array.prototype.slice;if(t.bind)return t.bind.apply(t,e.call(arguments,1));var n=e.call(arguments,2);return function(){return t.apply(i,n.length?n.concat(e.call(arguments)):arguments)}}var D=0;function h(t){return"_leaflet_id"in t||(t._leaflet_id=++D),t._leaflet_id}function j(t,i,e){var n,o,s=function(){n=!1,o&&(r.apply(e,o),o=!1)},r=function(){n?o=arguments:(t.apply(e,arguments),setTimeout(s,i),n=!0)};return r}function H(t,i,e){var n=i[1],i=i[0],o=n-i;return t===n&&e?t:((t-i)%o+o)%o+i}function u(){return!1}function e(t,i){if(!1===i)return t;i=Math.pow(10,void 0===i?6:i);return Math.round(t*i)/i}function W(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function F(t){return W(t).split(/\s+/)}function c(t,i){for(var e in Object.prototype.hasOwnProperty.call(t,"options")||(t.options=t.options?R(t.options):{}),i)t.options[e]=i[e];return t.options}function U(t,i,e){var n,o=[];for(n in t)o.push(encodeURIComponent(e?n.toUpperCase():n)+"="+encodeURIComponent(t[n]));return(i&&-1!==i.indexOf("?")?"&":"?")+o.join("&")}var V=/\{ *([\w_ -]+) *\}/g;function q(t,e){return t.replace(V,function(t,i){i=e[i];if(void 0===i)throw new Error("No value provided for variable "+t);return i="function"==typeof i?i(e):i})}var d=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function G(t,i){for(var e=0;e<t.length;e++)if(t[e]===i)return e;return-1}var K="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";function Y(t){return window["webkit"+t]||window["moz"+t]||window["ms"+t]}var X=0;function J(t){var i=+new Date,e=Math.max(0,16-(i-X));return X=i+e,window.setTimeout(t,e)}var $=window.requestAnimationFrame||Y("RequestAnimationFrame")||J,Q=window.cancelAnimationFrame||Y("CancelAnimationFrame")||Y("CancelRequestAnimationFrame")||function(t){window.clearTimeout(t)};function x(t,i,e){if(!e||$!==J)return $.call(window,a(t,i));t.call(i)}function r(t){t&&Q.call(window,t)}var tt={__proto__:null,extend:l,create:R,bind:a,get lastId(){return D},stamp:h,throttle:j,wrapNum:H,falseFn:u,formatNum:e,trim:W,splitWords:F,setOptions:c,getParamString:U,template:q,isArray:d,indexOf:G,emptyImageUrl:K,requestFn:$,cancelFn:Q,requestAnimFrame:x,cancelAnimFrame:r};function it(){}it.extend=function(t){function i(){c(this),this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()}var e,n=i.__super__=this.prototype,o=R(n);for(e in(o.constructor=i).prototype=o,this)Object.prototype.hasOwnProperty.call(this,e)&&"prototype"!==e&&"__super__"!==e&&(i[e]=this[e]);if(t.statics&&l(i,t.statics),t.includes){var s=t.includes;if("undefined"!=typeof L&&L&&L.Mixin){s=d(s)?s:[s];for(var r=0;r<s.length;r++)s[r]===L.Mixin.Events&&console.warn("Deprecated include of L.Mixin.Events: this property will be removed in future releases, please inherit from L.Evented instead.",(new Error).stack)}l.apply(null,[o].concat(t.includes))}return l(o,t),delete o.statics,delete o.includes,o.options&&(o.options=n.options?R(n.options):{},l(o.options,t.options)),o._initHooks=[],o.callInitHooks=function(){if(!this._initHooksCalled){n.callInitHooks&&n.callInitHooks.call(this),this._initHooksCalled=!0;for(var t=0,i=o._initHooks.length;t<i;t++)o._initHooks[t].call(this)}},i},it.include=function(t){var i=this.prototype.options;return l(this.prototype,t),t.options&&(this.prototype.options=i,this.mergeOptions(t.options)),this},it.mergeOptions=function(t){return l(this.prototype.options,t),this},it.addInitHook=function(t){var i=Array.prototype.slice.call(arguments,1),e="function"==typeof t?t:function(){this[t].apply(this,i)};return this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(e),this};var i={on:function(t,i,e){if("object"==typeof t)for(var n in t)this._on(n,t[n],i);else for(var o=0,s=(t=F(t)).length;o<s;o++)this._on(t[o],i,e);return this},off:function(t,i,e){if(arguments.length)if("object"==typeof t)for(var n in t)this._off(n,t[n],i);else{t=F(t);for(var o=1===arguments.length,s=0,r=t.length;s<r;s++)o?this._off(t[s]):this._off(t[s],i,e)}else delete this._events;return this},_on:function(t,i,e){if("function"!=typeof i)console.warn("wrong listener type: "+typeof i);else{this._events=this._events||{};for(var n=this._events[t],t=(n||(this._events[t]=n=[]),{fn:i,ctx:e=e===this?void 0:e}),o=n,s=0,r=o.length;s<r;s++)if(o[s].fn===i&&o[s].ctx===e)return;o.push(t)}},_off:function(t,i,e){var n,o,s;if(this._events&&(n=this._events[t]))if(1===arguments.length){if(this._firingCount)for(o=0,s=n.length;o<s;o++)n[o].fn=u;delete this._events[t]}else if(e===this&&(e=void 0),"function"!=typeof i)console.warn("wrong listener type: "+typeof i);else{for(o=0,s=n.length;o<s;o++){var r=n[o];if(r.ctx===e&&r.fn===i)return this._firingCount&&(r.fn=u,this._events[t]=n=n.slice()),void n.splice(o,1)}console.warn("listener not found")}},fire:function(t,i,e){if(!this.listens(t,e))return this;var n=l({},i,{type:t,target:this,sourceTarget:i&&i.sourceTarget||this});if(this._events){var o=this._events[t];if(o){this._firingCount=this._firingCount+1||1;for(var s=0,r=o.length;s<r;s++){var a=o[s];a.fn.call(a.ctx||this,n)}this._firingCount--}}return e&&this._propagateEvent(n),this},listens:function(t,i){"string"!=typeof t&&console.warn('"string" type argument expected');var e=this._events&&this._events[t];if(e&&e.length)return!0;if(i)for(var n in this._eventParents)if(this._eventParents[n].listens(t,i))return!0;return!1},once:function(t,i,e){if("object"==typeof t){for(var n in t)this.once(n,t[n],i);return this}var o=a(function(){this.off(t,i,e).off(t,o,e)},this);return this.on(t,i,e).on(t,o,e)},addEventParent:function(t){return this._eventParents=this._eventParents||{},this._eventParents[h(t)]=t,this},removeEventParent:function(t){return this._eventParents&&delete this._eventParents[h(t)],this},_propagateEvent:function(t){for(var i in this._eventParents)this._eventParents[i].fire(t.type,l({layer:t.target,propagatedFrom:t.target},t),!0)}},et=(i.addEventListener=i.on,i.removeEventListener=i.clearAllEventListeners=i.off,i.addOneTimeEventListener=i.once,i.fireEvent=i.fire,i.hasEventListeners=i.listens,it.extend(i));function p(t,i,e){this.x=e?Math.round(t):t,this.y=e?Math.round(i):i}var nt=Math.trunc||function(t){return 0<t?Math.floor(t):Math.ceil(t)};function _(t,i,e){return t instanceof p?t:d(t)?new p(t[0],t[1]):null==t?t:"object"==typeof t&&"x"in t&&"y"in t?new p(t.x,t.y):new p(t,i,e)}function m(t,i){if(t)for(var e=i?[t,i]:t,n=0,o=e.length;n<o;n++)this.extend(e[n])}function f(t,i){return!t||t instanceof m?t:new m(t,i)}function s(t,i){if(t)for(var e=i?[t,i]:t,n=0,o=e.length;n<o;n++)this.extend(e[n])}function g(t,i){return t instanceof s?t:new s(t,i)}function v(t,i,e){if(isNaN(t)||isNaN(i))throw new Error("Invalid LatLng object: ("+t+", "+i+")");this.lat=+t,this.lng=+i,void 0!==e&&(this.alt=+e)}function w(t,i,e){return t instanceof v?t:d(t)&&"object"!=typeof t[0]?3===t.length?new v(t[0],t[1],t[2]):2===t.length?new v(t[0],t[1]):null:null==t?t:"object"==typeof t&&"lat"in t?new v(t.lat,"lng"in t?t.lng:t.lon,t.alt):void 0===i?null:new v(t,i,e)}p.prototype={clone:function(){return new p(this.x,this.y)},add:function(t){return this.clone()._add(_(t))},_add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.clone()._subtract(_(t))},_subtract:function(t){return this.x-=t.x,this.y-=t.y,this},divideBy:function(t){return this.clone()._divideBy(t)},_divideBy:function(t){return this.x/=t,this.y/=t,this},multiplyBy:function(t){return this.clone()._multiplyBy(t)},_multiplyBy:function(t){return this.x*=t,this.y*=t,this},scaleBy:function(t){return new p(this.x*t.x,this.y*t.y)},unscaleBy:function(t){return new p(this.x/t.x,this.y/t.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=nt(this.x),this.y=nt(this.y),this},distanceTo:function(t){var i=(t=_(t)).x-this.x,t=t.y-this.y;return Math.sqrt(i*i+t*t)},equals:function(t){return(t=_(t)).x===this.x&&t.y===this.y},contains:function(t){return t=_(t),Math.abs(t.x)<=Math.abs(this.x)&&Math.abs(t.y)<=Math.abs(this.y)},toString:function(){return"Point("+e(this.x)+", "+e(this.y)+")"}},m.prototype={extend:function(t){return t=_(t),this.min||this.max?(this.min.x=Math.min(t.x,this.min.x),this.max.x=Math.max(t.x,this.max.x),this.min.y=Math.min(t.y,this.min.y),this.max.y=Math.max(t.y,this.max.y)):(this.min=t.clone(),this.max=t.clone()),this},getCenter:function(t){return new p((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,t)},getBottomLeft:function(){return new p(this.min.x,this.max.y)},getTopRight:function(){return new p(this.max.x,this.min.y)},getTopLeft:function(){return this.min},getBottomRight:function(){return this.max},getSize:function(){return this.max.subtract(this.min)},contains:function(t){var i,e;return(t=("number"==typeof t[0]||t instanceof p?_:f)(t))instanceof m?(i=t.min,e=t.max):i=e=t,i.x>=this.min.x&&e.x<=this.max.x&&i.y>=this.min.y&&e.y<=this.max.y},intersects:function(t){t=f(t);var i=this.min,e=this.max,n=t.min,t=t.max,o=t.x>=i.x&&n.x<=e.x,t=t.y>=i.y&&n.y<=e.y;return o&&t},overlaps:function(t){t=f(t);var i=this.min,e=this.max,n=t.min,t=t.max,o=t.x>i.x&&n.x<e.x,t=t.y>i.y&&n.y<e.y;return o&&t},isValid:function(){return!(!this.min||!this.max)}},s.prototype={extend:function(t){var i,e,n=this._southWest,o=this._northEast;if(t instanceof v)e=i=t;else{if(!(t instanceof s))return t?this.extend(w(t)||g(t)):this;if(i=t._southWest,e=t._northEast,!i||!e)return this}return n||o?(n.lat=Math.min(i.lat,n.lat),n.lng=Math.min(i.lng,n.lng),o.lat=Math.max(e.lat,o.lat),o.lng=Math.max(e.lng,o.lng)):(this._southWest=new v(i.lat,i.lng),this._northEast=new v(e.lat,e.lng)),this},pad:function(t){var i=this._southWest,e=this._northEast,n=Math.abs(i.lat-e.lat)*t,t=Math.abs(i.lng-e.lng)*t;return new s(new v(i.lat-n,i.lng-t),new v(e.lat+n,e.lng+t))},getCenter:function(){return new v((this._southWest.lat+this._northEast.lat)/2,(this._southWest.lng+this._northEast.lng)/2)},getSouthWest:function(){return this._southWest},getNorthEast:function(){return this._northEast},getNorthWest:function(){return new v(this.getNorth(),this.getWest())},getSouthEast:function(){return new v(this.getSouth(),this.getEast())},getWest:function(){return this._southWest.lng},getSouth:function(){return this._southWest.lat},getEast:function(){return this._northEast.lng},getNorth:function(){return this._northEast.lat},contains:function(t){t=("number"==typeof t[0]||t instanceof v||"lat"in t?w:g)(t);var i,e,n=this._southWest,o=this._northEast;return t instanceof s?(i=t.getSouthWest(),e=t.getNorthEast()):i=e=t,i.lat>=n.lat&&e.lat<=o.lat&&i.lng>=n.lng&&e.lng<=o.lng},intersects:function(t){t=g(t);var i=this._southWest,e=this._northEast,n=t.getSouthWest(),t=t.getNorthEast(),o=t.lat>=i.lat&&n.lat<=e.lat,t=t.lng>=i.lng&&n.lng<=e.lng;return o&&t},overlaps:function(t){t=g(t);var i=this._southWest,e=this._northEast,n=t.getSouthWest(),t=t.getNorthEast(),o=t.lat>i.lat&&n.lat<e.lat,t=t.lng>i.lng&&n.lng<e.lng;return o&&t},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(t,i){return!!t&&(t=g(t),this._southWest.equals(t.getSouthWest(),i)&&this._northEast.equals(t.getNorthEast(),i))},isValid:function(){return!(!this._southWest||!this._northEast)}};var ot={latLngToPoint:function(t,i){t=this.projection.project(t),i=this.scale(i);return this.transformation._transform(t,i)},pointToLatLng:function(t,i){i=this.scale(i),t=this.transformation.untransform(t,i);return this.projection.unproject(t)},project:function(t){return this.projection.project(t)},unproject:function(t){return this.projection.unproject(t)},scale:function(t){return 256*Math.pow(2,t)},zoom:function(t){return Math.log(t/256)/Math.LN2},getProjectedBounds:function(t){if(this.infinite)return null;var i=this.projection.bounds,t=this.scale(t);return new m(this.transformation.transform(i.min,t),this.transformation.transform(i.max,t))},infinite:!(v.prototype={equals:function(t,i){return!!t&&(t=w(t),Math.max(Math.abs(this.lat-t.lat),Math.abs(this.lng-t.lng))<=(void 0===i?1e-9:i))},toString:function(t){return"LatLng("+e(this.lat,t)+", "+e(this.lng,t)+")"},distanceTo:function(t){return st.distance(this,w(t))},wrap:function(){return st.wrapLatLng(this)},toBounds:function(t){var t=180*t/40075017,i=t/Math.cos(Math.PI/180*this.lat);return g([this.lat-t,this.lng-i],[this.lat+t,this.lng+i])},clone:function(){return new v(this.lat,this.lng,this.alt)}}),wrapLatLng:function(t){var i=this.wrapLng?H(t.lng,this.wrapLng,!0):t.lng;return new v(this.wrapLat?H(t.lat,this.wrapLat,!0):t.lat,i,t.alt)},wrapLatLngBounds:function(t){var i=t.getCenter(),e=this.wrapLatLng(i),n=i.lat-e.lat,i=i.lng-e.lng;if(0==n&&0==i)return t;e=t.getSouthWest(),t=t.getNorthEast();return new s(new v(e.lat-n,e.lng-i),new v(t.lat-n,t.lng-i))}},st=l({},ot,{wrapLng:[-180,180],R:6371e3,distance:function(t,i){var e=Math.PI/180,n=t.lat*e,o=i.lat*e,s=Math.sin((i.lat-t.lat)*e/2),i=Math.sin((i.lng-t.lng)*e/2),t=s*s+Math.cos(n)*Math.cos(o)*i*i,e=2*Math.atan2(Math.sqrt(t),Math.sqrt(1-t));return this.R*e}}),rt=6378137,rt={R:rt,MAX_LATITUDE:85.0511287798,project:function(t){var i=Math.PI/180,e=this.MAX_LATITUDE,e=Math.max(Math.min(e,t.lat),-e),e=Math.sin(e*i);return new p(this.R*t.lng*i,this.R*Math.log((1+e)/(1-e))/2)},unproject:function(t){var i=180/Math.PI;return new v((2*Math.atan(Math.exp(t.y/this.R))-Math.PI/2)*i,t.x*i/this.R)},bounds:new m([-(rt=rt*Math.PI),-rt],[rt,rt])};function at(t,i,e,n){if(d(t))return this._a=t[0],this._b=t[1],this._c=t[2],void(this._d=t[3]);this._a=t,this._b=i,this._c=e,this._d=n}function ht(t,i,e,n){return new at(t,i,e,n)}at.prototype={transform:function(t,i){return this._transform(t.clone(),i)},_transform:function(t,i){return t.x=(i=i||1)*(this._a*t.x+this._b),t.y=i*(this._c*t.y+this._d),t},untransform:function(t,i){return new p((t.x/(i=i||1)-this._b)/this._a,(t.y/i-this._d)/this._c)}};var lt=l({},st,{code:"EPSG:3857",projection:rt,transformation:ht(lt=.5/(Math.PI*rt.R),.5,-lt,.5)}),ut=l({},lt,{code:"EPSG:900913"});function ct(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function dt(t,i){for(var e,n,o,s,r="",a=0,h=t.length;a<h;a++){for(e=0,n=(o=t[a]).length;e<n;e++)r+=(e?"L":"M")+(s=o[e]).x+" "+s.y;r+=i?P.svg?"z":"x":""}return r||"M0 0"}var _t=document.documentElement.style,pt="ActiveXObject"in window,mt=pt&&!document.addEventListener,n="msLaunchUri"in navigator&&!("documentMode"in document),ft=y("webkit"),gt=y("android"),vt=y("android 2")||y("android 3"),yt=parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1],10),yt=gt&&y("Google")&&yt<537&&!("AudioNode"in window),xt=!!window.opera,wt=!n&&y("chrome"),Pt=y("gecko")&&!ft&&!xt&&!pt,bt=!wt&&y("safari"),Lt=y("phantom"),o="OTransition"in _t,Tt=0===navigator.platform.indexOf("Win"),zt=pt&&"transition"in _t,Mt="WebKitCSSMatrix"in window&&"m11"in new window.WebKitCSSMatrix&&!vt,_t="MozPerspective"in _t,Ct=!window.L_DISABLE_3D&&(zt||Mt||_t)&&!o&&!Lt,Zt="undefined"!=typeof orientation||y("mobile"),St=Zt&&ft,kt=Zt&&Mt,Et=!window.PointerEvent&&window.MSPointerEvent,Bt=!(!window.PointerEvent&&!Et),At="ontouchstart"in window||!!window.TouchEvent,It=!window.L_NO_TOUCH&&(At||Bt),Ot=Zt&&xt,Rt=Zt&&Pt,Nt=1<(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI),Dt=function(){var t=!1;try{var i=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("testPassiveEventSupport",u,i),window.removeEventListener("testPassiveEventSupport",u,i)}catch(t){}return t}(),jt=!!document.createElement("canvas").getContext,Ht=!(!document.createElementNS||!ct("svg").createSVGRect),Wt=!!Ht&&((Wt=document.createElement("div")).innerHTML="<svg/>","http://www.w3.org/2000/svg"===(Wt.firstChild&&Wt.firstChild.namespaceURI));function y(t){return 0<=navigator.userAgent.toLowerCase().indexOf(t)}var P={ie:pt,ielt9:mt,edge:n,webkit:ft,android:gt,android23:vt,androidStock:yt,opera:xt,chrome:wt,gecko:Pt,safari:bt,phantom:Lt,opera12:o,win:Tt,ie3d:zt,webkit3d:Mt,gecko3d:_t,any3d:Ct,mobile:Zt,mobileWebkit:St,mobileWebkit3d:kt,msPointer:Et,pointer:Bt,touch:It,touchNative:At,mobileOpera:Ot,mobileGecko:Rt,retina:Nt,passiveEvents:Dt,canvas:jt,svg:Ht,vml:!Ht&&function(){try{var t=document.createElement("div"),i=(t.innerHTML='<v:shape adj="1"/>',t.firstChild);return i.style.behavior="url(#default#VML)",i&&"object"==typeof i.adj}catch(t){return!1}}(),inlineSvg:Wt},Ft=P.msPointer?"MSPointerDown":"pointerdown",Ut=P.msPointer?"MSPointerMove":"pointermove",Vt=P.msPointer?"MSPointerUp":"pointerup",qt=P.msPointer?"MSPointerCancel":"pointercancel",Gt={touchstart:Ft,touchmove:Ut,touchend:Vt,touchcancel:qt},Kt={touchstart:function(t,i){i.MSPOINTER_TYPE_TOUCH&&i.pointerType===i.MSPOINTER_TYPE_TOUCH&&B(i);ii(t,i)},touchmove:ii,touchend:ii,touchcancel:ii},Yt={},Xt=!1;function Jt(t,i,e){return"touchstart"!==i||Xt||(document.addEventListener(Ft,$t,!0),document.addEventListener(Ut,Qt,!0),document.addEventListener(Vt,ti,!0),document.addEventListener(qt,ti,!0),Xt=!0),Kt[i]?(e=Kt[i].bind(this,e),t.addEventListener(Gt[i],e,!1),e):(console.warn("wrong event specified:",i),L.Util.falseFn)}function $t(t){Yt[t.pointerId]=t}function Qt(t){Yt[t.pointerId]&&(Yt[t.pointerId]=t)}function ti(t){delete Yt[t.pointerId]}function ii(t,i){if(i.pointerType!==(i.MSPOINTER_TYPE_MOUSE||"mouse")){for(var e in i.touches=[],Yt)i.touches.push(Yt[e]);i.changedTouches=[i],t(i)}}var ei=200;function ni(t,e){t.addEventListener("dblclick",e);var n,o=0;function i(t){var i;1!==t.detail?n=t.detail:"mouse"===t.pointerType||t.sourceCapabilities&&!t.sourceCapabilities.firesTouchEvents||((i=Date.now())-o<=ei?2===++n&&e(function(t){var i,e,n={};for(e in t)i=t[e],n[e]=i&&i.bind?i.bind(t):i;return(t=n).type="dblclick",n.detail=2,n.isTrusted=!1,n._simulated=!0,n}(t)):n=1,o=i)}return t.addEventListener("click",i),{dblclick:e,simDblclick:i}}var oi,si,ri,ai,hi,li,ui=wi(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),ci=wi(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),di="webkitTransition"===ci||"OTransition"===ci?ci+"End":"transitionend";function _i(t){return"string"==typeof t?document.getElementById(t):t}function pi(t,i){var e=t.style[i]||t.currentStyle&&t.currentStyle[i];return"auto"===(e=e&&"auto"!==e||!document.defaultView?e:(t=document.defaultView.getComputedStyle(t,null))?t[i]:null)?null:e}function b(t,i,e){t=document.createElement(t);return t.className=i||"",e&&e.appendChild(t),t}function T(t){var i=t.parentNode;i&&i.removeChild(t)}function mi(t){for(;t.firstChild;)t.removeChild(t.firstChild)}function fi(t){var i=t.parentNode;i&&i.lastChild!==t&&i.appendChild(t)}function gi(t){var i=t.parentNode;i&&i.firstChild!==t&&i.insertBefore(t,i.firstChild)}function vi(t,i){if(void 0!==t.classList)return t.classList.contains(i);t=xi(t);return 0<t.length&&new RegExp("(^|\\s)"+i+"(\\s|$)").test(t)}function z(t,i){var e;if(void 0!==t.classList)for(var n=F(i),o=0,s=n.length;o<s;o++)t.classList.add(n[o]);else vi(t,i)||yi(t,((e=xi(t))?e+" ":"")+i)}function M(t,i){void 0!==t.classList?t.classList.remove(i):yi(t,W((" "+xi(t)+" ").replace(" "+i+" "," ")))}function yi(t,i){void 0===t.className.baseVal?t.className=i:t.className.baseVal=i}function xi(t){return void 0===(t=t.correspondingElement?t.correspondingElement:t).className.baseVal?t.className:t.className.baseVal}function C(t,i){if("opacity"in t.style)t.style.opacity=i;else if("filter"in t.style){var e=!1,n="DXImageTransform.Microsoft.Alpha";try{e=t.filters.item(n)}catch(t){if(1===i)return}i=Math.round(100*i),e?(e.Enabled=100!==i,e.Opacity=i):t.style.filter+=" progid:"+n+"(opacity="+i+")"}}function wi(t){for(var i=document.documentElement.style,e=0;e<t.length;e++)if(t[e]in i)return t[e];return!1}function Pi(t,i,e){i=i||new p(0,0);t.style[ui]=(P.ie3d?"translate("+i.x+"px,"+i.y+"px)":"translate3d("+i.x+"px,"+i.y+"px,0)")+(e?" scale("+e+")":"")}function Z(t,i){t._leaflet_pos=i,P.any3d?Pi(t,i):(t.style.left=i.x+"px",t.style.top=i.y+"px")}function bi(t){return t._leaflet_pos||new p(0,0)}function Li(){S(window,"dragstart",B)}function Ti(){E(window,"dragstart",B)}function zi(t){for(;-1===t.tabIndex;)t=t.parentNode;t.style&&(Mi(),li=(hi=t).style.outline,t.style.outline="none",S(window,"keydown",Mi))}function Mi(){hi&&(hi.style.outline=li,li=hi=void 0,E(window,"keydown",Mi))}function Ci(t){for(;!((t=t.parentNode).offsetWidth&&t.offsetHeight||t===document.body););return t}function Zi(t){var i=t.getBoundingClientRect();return{x:i.width/t.offsetWidth||1,y:i.height/t.offsetHeight||1,boundingClientRect:i}}ai="onselectstart"in document?(ri=function(){S(window,"selectstart",B)},function(){E(window,"selectstart",B)}):(si=wi(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]),ri=function(){var t;si&&(t=document.documentElement.style,oi=t[si],t[si]="none")},function(){si&&(document.documentElement.style[si]=oi,oi=void 0)});pt={__proto__:null,TRANSFORM:ui,TRANSITION:ci,TRANSITION_END:di,get:_i,getStyle:pi,create:b,remove:T,empty:mi,toFront:fi,toBack:gi,hasClass:vi,addClass:z,removeClass:M,setClass:yi,getClass:xi,setOpacity:C,testProp:wi,setTransform:Pi,setPosition:Z,getPosition:bi,get disableTextSelection(){return ri},get enableTextSelection(){return ai},disableImageDrag:Li,enableImageDrag:Ti,preventOutline:zi,restoreOutline:Mi,getSizedParentNode:Ci,getScale:Zi};function S(t,i,e,n){if(i&&"object"==typeof i)for(var o in i)Ei(t,o,i[o],e);else for(var s=0,r=(i=F(i)).length;s<r;s++)Ei(t,i[s],e,n);return this}var k="_leaflet_events";function E(t,i,e,n){if(1===arguments.length)Si(t),delete t[k];else if(i&&"object"==typeof i)for(var o in i)Bi(t,o,i[o],e);else if(i=F(i),2===arguments.length)Si(t,function(t){return-1!==G(i,t)});else for(var s=0,r=i.length;s<r;s++)Bi(t,i[s],e,n);return this}function Si(t,i){for(var e in t[k]){var n=e.split(/\d/)[0];i&&!i(n)||Bi(t,n,null,null,e)}}var ki={mouseenter:"mouseover",mouseleave:"mouseout",wheel:!("onwheel"in window)&&"mousewheel"};function Ei(i,t,e,n){var o,s,r=t+h(e)+(n?"_"+h(n):"");i[k]&&i[k][r]||(s=o=function(t){return e.call(n||i,t||window.event)},!P.touchNative&&P.pointer&&0===t.indexOf("touch")?o=Jt(i,t,o):P.touch&&"dblclick"===t?o=ni(i,o):"addEventListener"in i?"touchstart"===t||"touchmove"===t||"wheel"===t||"mousewheel"===t?i.addEventListener(ki[t]||t,o,!!P.passiveEvents&&{passive:!1}):"mouseenter"===t||"mouseleave"===t?i.addEventListener(ki[t],o=function(t){t=t||window.event,Hi(i,t)&&s(t)},!1):i.addEventListener(t,s,!1):i.attachEvent("on"+t,o),i[k]=i[k]||{},i[k][r]=o)}function Bi(t,i,e,n,o){o=o||i+h(e)+(n?"_"+h(n):"");var s,r,e=t[k]&&t[k][o];e&&(!P.touchNative&&P.pointer&&0===i.indexOf("touch")?(n=t,r=e,Gt[s=i]?n.removeEventListener(Gt[s],r,!1):console.warn("wrong event specified:",s)):P.touch&&"dblclick"===i?(n=e,(r=t).removeEventListener("dblclick",n.dblclick),r.removeEventListener("click",n.simDblclick)):"removeEventListener"in t?t.removeEventListener(ki[i]||i,e,!1):t.detachEvent("on"+i,e),t[k][o]=null)}function Ai(t){return t.stopPropagation?t.stopPropagation():t.originalEvent?t.originalEvent._stopped=!0:t.cancelBubble=!0,this}function Ii(t){return Ei(t,"wheel",Ai),this}function Oi(t){return S(t,"mousedown touchstart dblclick contextmenu",Ai),t._leaflet_disable_click=!0,this}function B(t){return t.preventDefault?t.preventDefault():t.returnValue=!1,this}function Ri(t){return B(t),Ai(t),this}function Ni(t,i){if(!i)return new p(t.clientX,t.clientY);var e=Zi(i),n=e.boundingClientRect;return new p((t.clientX-n.left)/e.x-i.clientLeft,(t.clientY-n.top)/e.y-i.clientTop)}var Di=P.win&&P.chrome?2*window.devicePixelRatio:P.gecko?window.devicePixelRatio:1;function ji(t){return P.edge?t.wheelDeltaY/2:t.deltaY&&0===t.deltaMode?-t.deltaY/Di:t.deltaY&&1===t.deltaMode?20*-t.deltaY:t.deltaY&&2===t.deltaMode?60*-t.deltaY:t.deltaX||t.deltaZ?0:t.wheelDelta?(t.wheelDeltaY||t.wheelDelta)/2:t.detail&&Math.abs(t.detail)<32765?20*-t.detail:t.detail?t.detail/-32765*60:0}function Hi(t,i){var e=i.relatedTarget;if(!e)return!0;try{for(;e&&e!==t;)e=e.parentNode}catch(t){return!1}return e!==t}var mt={__proto__:null,on:S,off:E,stopPropagation:Ai,disableScrollPropagation:Ii,disableClickPropagation:Oi,preventDefault:B,stop:Ri,getMousePosition:Ni,getWheelDelta:ji,isExternalTarget:Hi,addListener:S,removeListener:E},Wi=et.extend({run:function(t,i,e,n){this.stop(),this._el=t,this._inProgress=!0,this._duration=e||.25,this._easeOutPower=1/Math.max(n||.5,.2),this._startPos=bi(t),this._offset=i.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=x(this._animate,this),this._step()},_step:function(t){var i=+new Date-this._startTime,e=1e3*this._duration;i<e?this._runFrame(this._easeOut(i/e),t):(this._runFrame(1),this._complete())},_runFrame:function(t,i){t=this._startPos.add(this._offset.multiplyBy(t));i&&t._round(),Z(this._el,t),this.fire("step")},_complete:function(){r(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(t){return 1-Math.pow(1-t,this._easeOutPower)}}),A=et.extend({options:{crs:lt,center:void 0,zoom:void 0,minZoom:void 0,maxZoom:void 0,layers:[],maxBounds:void 0,renderer:void 0,zoomAnimation:!0,zoomAnimationThreshold:4,fadeAnimation:!0,markerZoomAnimation:!0,transform3DLimit:8388608,zoomSnap:1,zoomDelta:1,trackResize:!0},initialize:function(t,i){i=c(this,i),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._sizeChanged=!0,this._initContainer(t),this._initLayout(),this._onResize=a(this._onResize,this),this._initEvents(),i.maxBounds&&this.setMaxBounds(i.maxBounds),void 0!==i.zoom&&(this._zoom=this._limitZoom(i.zoom)),i.center&&void 0!==i.zoom&&this.setView(w(i.center),i.zoom,{reset:!0}),this.callInitHooks(),this._zoomAnimated=ci&&P.any3d&&!P.mobileOpera&&this.options.zoomAnimation,this._zoomAnimated&&(this._createAnimProxy(),S(this._proxy,di,this._catchTransitionEnd,this)),this._addLayers(this.options.layers)},setView:function(t,i,e){if((i=void 0===i?this._zoom:this._limitZoom(i),t=this._limitCenter(w(t),i,this.options.maxBounds),e=e||{},this._stop(),this._loaded&&!e.reset&&!0!==e)&&(void 0!==e.animate&&(e.zoom=l({animate:e.animate},e.zoom),e.pan=l({animate:e.animate,duration:e.duration},e.pan)),this._zoom!==i?this._tryAnimatedZoom&&this._tryAnimatedZoom(t,i,e.zoom):this._tryAnimatedPan(t,e.pan)))return clearTimeout(this._sizeTimer),this;return this._resetView(t,i),this},setZoom:function(t,i){return this._loaded?this.setView(this.getCenter(),t,{zoom:i}):(this._zoom=t,this)},zoomIn:function(t,i){return t=t||(P.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom+t,i)},zoomOut:function(t,i){return t=t||(P.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom-t,i)},setZoomAround:function(t,i,e){var n=this.getZoomScale(i),o=this.getSize().divideBy(2),t=(t instanceof p?t:this.latLngToContainerPoint(t)).subtract(o).multiplyBy(1-1/n),n=this.containerPointToLatLng(o.add(t));return this.setView(n,i,{zoom:e})},_getBoundsCenterZoom:function(t,i){i=i||{},t=t.getBounds?t.getBounds():g(t);var e=_(i.paddingTopLeft||i.padding||[0,0]),n=_(i.paddingBottomRight||i.padding||[0,0]),o=this.getBoundsZoom(t,!1,e.add(n));if((o="number"==typeof i.maxZoom?Math.min(i.maxZoom,o):o)===1/0)return{center:t.getCenter(),zoom:o};i=n.subtract(e).divideBy(2),n=this.project(t.getSouthWest(),o),e=this.project(t.getNorthEast(),o);return{center:this.unproject(n.add(e).divideBy(2).add(i),o),zoom:o}},fitBounds:function(t,i){if(!(t=g(t)).isValid())throw new Error("Bounds are not valid.");t=this._getBoundsCenterZoom(t,i);return this.setView(t.center,t.zoom,i)},fitWorld:function(t){return this.fitBounds([[-90,-180],[90,180]],t)},panTo:function(t,i){return this.setView(t,this._zoom,{pan:i})},panBy:function(t,i){return i=i||{},(t=_(t).round()).x||t.y?(!0===i.animate||this.getSize().contains(t)?(this._panAnim||(this._panAnim=new Wi,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),i.noMoveStart||this.fire("movestart"),!1!==i.animate?(z(this._mapPane,"leaflet-pan-anim"),e=this._getMapPanePos().subtract(t).round(),this._panAnim.run(this._mapPane,e,i.duration||.25,i.easeLinearity)):(this._rawPanBy(t),this.fire("move").fire("moveend"))):this._resetView(this.unproject(this.project(this.getCenter()).add(t)),this.getZoom()),this):this.fire("moveend");var e},flyTo:function(n,o,t){if(!1===(t=t||{}).animate||!P.any3d)return this.setView(n,o,t);this._stop();var s=this.project(this.getCenter()),r=this.project(n),i=this.getSize(),a=this._zoom,h=(n=w(n),o=void 0===o?a:o,Math.max(i.x,i.y)),e=h*this.getZoomScale(a,o),l=r.distanceTo(s)||1,u=1.42,c=u*u;function d(t){t=(e*e-h*h+(t?-1:1)*c*c*l*l)/(2*(t?e:h)*c*l),t=Math.sqrt(t*t+1)-t;return t<1e-9?-18:Math.log(t)}function _(t){return(Math.exp(t)-Math.exp(-t))/2}function p(t){return(Math.exp(t)+Math.exp(-t))/2}var m=d(0);function f(t){return h*(p(m)*(_(t=m+u*t)/p(t))-_(m))/c}var g=Date.now(),v=(d(1)-m)/u,y=t.duration?1e3*t.duration:1e3*v*.8;return this._moveStart(!0,t.noMoveStart),function t(){var i=(Date.now()-g)/y,e=(1-Math.pow(1-i,1.5))*v;i<=1?(this._flyToFrame=x(t,this),this._move(this.unproject(s.add(r.subtract(s).multiplyBy(f(e)/l)),a),this.getScaleZoom(h/(i=e,h*(p(m)/p(m+u*i))),a),{flyTo:!0})):this._move(n,o)._moveEnd(!0)}.call(this),this},flyToBounds:function(t,i){t=this._getBoundsCenterZoom(t,i);return this.flyTo(t.center,t.zoom,i)},setMaxBounds:function(t){return(t=g(t)).isValid()?(this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this.options.maxBounds=t,this._loaded&&this._panInsideMaxBounds(),this.on("moveend",this._panInsideMaxBounds)):(this.options.maxBounds=null,this.off("moveend",this._panInsideMaxBounds))},setMinZoom:function(t){var i=this.options.minZoom;return this.options.minZoom=t,this._loaded&&i!==t&&(this.fire("zoomlevelschange"),this.getZoom()<this.options.minZoom)?this.setZoom(t):this},setMaxZoom:function(t){var i=this.options.maxZoom;return this.options.maxZoom=t,this._loaded&&i!==t&&(this.fire("zoomlevelschange"),this.getZoom()>this.options.maxZoom)?this.setZoom(t):this},panInsideBounds:function(t,i){this._enforcingBounds=!0;var e=this.getCenter(),t=this._limitCenter(e,this._zoom,g(t));return e.equals(t)||this.panTo(t,i),this._enforcingBounds=!1,this},panInside:function(t,i){var e=_((i=i||{}).paddingTopLeft||i.padding||[0,0]),n=_(i.paddingBottomRight||i.padding||[0,0]),o=this.project(this.getCenter()),t=this.project(t),s=this.getPixelBounds(),e=f([s.min.add(e),s.max.subtract(n)]),s=e.getSize();return e.contains(t)||(this._enforcingBounds=!0,n=t.subtract(e.getCenter()),e=e.extend(t).getSize().subtract(s),o.x+=n.x<0?-e.x:e.x,o.y+=n.y<0?-e.y:e.y,this.panTo(this.unproject(o),i),this._enforcingBounds=!1),this},invalidateSize:function(t){if(!this._loaded)return this;t=l({animate:!1,pan:!0},!0===t?{animate:!0}:t);var i=this.getSize(),e=(this._sizeChanged=!0,this._lastCenter=null,this.getSize()),n=i.divideBy(2).round(),o=e.divideBy(2).round(),n=n.subtract(o);return n.x||n.y?(t.animate&&t.pan?this.panBy(n):(t.pan&&this._rawPanBy(n),this.fire("move"),t.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(a(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:i,newSize:e})):this},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(t){if(t=this._locateOptions=l({timeout:1e4,watch:!1},t),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var i=a(this._handleGeolocationResponse,this),e=a(this._handleGeolocationError,this);return t.watch?this._locationWatchId=navigator.geolocation.watchPosition(i,e,t):navigator.geolocation.getCurrentPosition(i,e,t),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(t){var i;this._container._leaflet_id&&(i=t.code,t=t.message||(1===i?"permission denied":2===i?"position unavailable":"timeout"),this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:i,message:"Geolocation error: "+t+"."}))},_handleGeolocationResponse:function(t){if(this._container._leaflet_id){var i,e,n=new v(t.coords.latitude,t.coords.longitude),o=n.toBounds(2*t.coords.accuracy),s=this._locateOptions,r=(s.setView&&(i=this.getBoundsZoom(o),this.setView(n,s.maxZoom?Math.min(i,s.maxZoom):i)),{latlng:n,bounds:o,timestamp:t.timestamp});for(e in t.coords)"number"==typeof t.coords[e]&&(r[e]=t.coords[e]);this.fire("locationfound",r)}},addHandler:function(t,i){if(!i)return this;i=this[t]=new i(this);return this._handlers.push(i),this.options[t]&&i.enable(),this},remove:function(){if(this._initEvents(!0),this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch(t){this._container._leaflet_id=void 0,this._containerId=void 0}for(var t in void 0!==this._locationWatchId&&this.stopLocate(),this._stop(),T(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(r(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload"),this._layers)this._layers[t].remove();for(t in this._panes)T(this._panes[t]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(t,i){i=b("div","leaflet-pane"+(t?" leaflet-"+t.replace("Pane","")+"-pane":""),i||this._mapPane);return t&&(this._panes[t]=i),i},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter:this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var t=this.getPixelBounds();return new s(this.unproject(t.getBottomLeft()),this.unproject(t.getTopRight()))},getMinZoom:function(){return void 0===this.options.minZoom?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return void 0===this.options.maxZoom?void 0===this._layersMaxZoom?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(t,i,e){t=g(t),e=_(e||[0,0]);var n=this.getZoom()||0,o=this.getMinZoom(),s=this.getMaxZoom(),r=t.getNorthWest(),t=t.getSouthEast(),e=this.getSize().subtract(e),t=f(this.project(t,n),this.project(r,n)).getSize(),r=P.any3d?this.options.zoomSnap:1,a=e.x/t.x,e=e.y/t.y,t=i?Math.max(a,e):Math.min(a,e),n=this.getScaleZoom(t,n);return r&&(n=Math.round(n/(r/100))*(r/100),n=i?Math.ceil(n/r)*r:Math.floor(n/r)*r),Math.max(o,Math.min(s,n))},getSize:function(){return this._size&&!this._sizeChanged||(this._size=new p(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(t,i){t=this._getTopLeftPoint(t,i);return new m(t,t.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(t){return this.options.crs.getProjectedBounds(void 0===t?this.getZoom():t)},getPane:function(t){return"string"==typeof t?this._panes[t]:t},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(t,i){var e=this.options.crs;return i=void 0===i?this._zoom:i,e.scale(t)/e.scale(i)},getScaleZoom:function(t,i){var e=this.options.crs,t=(i=void 0===i?this._zoom:i,e.zoom(t*e.scale(i)));return isNaN(t)?1/0:t},project:function(t,i){return i=void 0===i?this._zoom:i,this.options.crs.latLngToPoint(w(t),i)},unproject:function(t,i){return i=void 0===i?this._zoom:i,this.options.crs.pointToLatLng(_(t),i)},layerPointToLatLng:function(t){t=_(t).add(this.getPixelOrigin());return this.unproject(t)},latLngToLayerPoint:function(t){return this.project(w(t))._round()._subtract(this.getPixelOrigin())},wrapLatLng:function(t){return this.options.crs.wrapLatLng(w(t))},wrapLatLngBounds:function(t){return this.options.crs.wrapLatLngBounds(g(t))},distance:function(t,i){return this.options.crs.distance(w(t),w(i))},containerPointToLayerPoint:function(t){return _(t).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(t){return _(t).add(this._getMapPanePos())},containerPointToLatLng:function(t){t=this.containerPointToLayerPoint(_(t));return this.layerPointToLatLng(t)},latLngToContainerPoint:function(t){return this.layerPointToContainerPoint(this.latLngToLayerPoint(w(t)))},mouseEventToContainerPoint:function(t){return Ni(t,this._container)},mouseEventToLayerPoint:function(t){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(t))},mouseEventToLatLng:function(t){return this.layerPointToLatLng(this.mouseEventToLayerPoint(t))},_initContainer:function(t){t=this._container=_i(t);if(!t)throw new Error("Map container not found.");if(t._leaflet_id)throw new Error("Map container is already initialized.");S(t,"scroll",this._onScroll,this),this._containerId=h(t)},_initLayout:function(){var t=this._container,i=(this._fadeAnimated=this.options.fadeAnimation&&P.any3d,z(t,"leaflet-container"+(P.touch?" leaflet-touch":"")+(P.retina?" leaflet-retina":"")+(P.ielt9?" leaflet-oldie":"")+(P.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":"")),pi(t,"position"));"absolute"!==i&&"relative"!==i&&"fixed"!==i&&(t.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var t=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),Z(this._mapPane,new p(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(z(t.markerPane,"leaflet-zoom-hide"),z(t.shadowPane,"leaflet-zoom-hide"))},_resetView:function(t,i){Z(this._mapPane,new p(0,0));var e=!this._loaded,n=(this._loaded=!0,i=this._limitZoom(i),this.fire("viewprereset"),this._zoom!==i);this._moveStart(n,!1)._move(t,i)._moveEnd(n),this.fire("viewreset"),e&&this.fire("load")},_moveStart:function(t,i){return t&&this.fire("zoomstart"),i||this.fire("movestart"),this},_move:function(t,i,e,n){void 0===i&&(i=this._zoom);var o=this._zoom!==i;return this._zoom=i,this._lastCenter=t,this._pixelOrigin=this._getNewPixelOrigin(t),n?e&&e.pinch&&this.fire("zoom",e):((o||e&&e.pinch)&&this.fire("zoom",e),this.fire("move",e)),this},_moveEnd:function(t){return t&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return r(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(t){Z(this._mapPane,this._getMapPanePos().subtract(t))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(t){this._targets={};var i=t?E:S;i((this._targets[h(this._container)]=this)._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&i(window,"resize",this._onResize,this),P.any3d&&this.options.transform3DLimit&&(t?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){r(this._resizeRequest),this._resizeRequest=x(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var t=this._getMapPanePos();Math.max(Math.abs(t.x),Math.abs(t.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(t,i){for(var e,n=[],o="mouseout"===i||"mouseover"===i,s=t.target||t.srcElement,r=!1;s;){if((e=this._targets[h(s)])&&("click"===i||"preclick"===i)&&this._draggableMoved(e)){r=!0;break}if(e&&e.listens(i,!0)){if(o&&!Hi(s,t))break;if(n.push(e),o)break}if(s===this._container)break;s=s.parentNode}return n=n.length||r||o||!this.listens(i,!0)?n:[this]},_isClickDisabled:function(t){for(;t!==this._container;){if(t._leaflet_disable_click)return!0;t=t.parentNode}},_handleDOMEvent:function(t){var i,e=t.target||t.srcElement;!this._loaded||e._leaflet_disable_events||"click"===t.type&&this._isClickDisabled(e)||("mousedown"===(i=t.type)&&zi(e),this._fireDOMEvent(t,i))},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(t,i,e){"click"===t.type&&((a=l({},t)).type="preclick",this._fireDOMEvent(a,a.type,e));var n=this._findEventTargets(t,i);if(e){for(var o=[],s=0;s<e.length;s++)e[s].listens(i,!0)&&o.push(e[s]);n=o.concat(n)}if(n.length){"contextmenu"===i&&B(t);var r,a=n[0],h={originalEvent:t};for("keypress"!==t.type&&"keydown"!==t.type&&"keyup"!==t.type&&(r=a.getLatLng&&(!a._radius||a._radius<=10),h.containerPoint=r?this.latLngToContainerPoint(a.getLatLng()):this.mouseEventToContainerPoint(t),h.layerPoint=this.containerPointToLayerPoint(h.containerPoint),h.latlng=r?a.getLatLng():this.layerPointToLatLng(h.layerPoint)),s=0;s<n.length;s++)if(n[s].fire(i,h,!0),h.originalEvent._stopped||!1===n[s].options.bubblingMouseEvents&&-1!==G(this._mouseEvents,i))return}},_draggableMoved:function(t){return(t=t.dragging&&t.dragging.enabled()?t:this).dragging&&t.dragging.moved()||this.boxZoom&&this.boxZoom.moved()},_clearHandlers:function(){for(var t=0,i=this._handlers.length;t<i;t++)this._handlers[t].disable()},whenReady:function(t,i){return this._loaded?t.call(i||this,{target:this}):this.on("load",t,i),this},_getMapPanePos:function(){return bi(this._mapPane)||new p(0,0)},_moved:function(){var t=this._getMapPanePos();return t&&!t.equals([0,0])},_getTopLeftPoint:function(t,i){return(t&&void 0!==i?this._getNewPixelOrigin(t,i):this.getPixelOrigin()).subtract(this._getMapPanePos())},_getNewPixelOrigin:function(t,i){var e=this.getSize()._divideBy(2);return this.project(t,i)._subtract(e)._add(this._getMapPanePos())._round()},_latLngToNewLayerPoint:function(t,i,e){e=this._getNewPixelOrigin(e,i);return this.project(t,i)._subtract(e)},_latLngBoundsToNewLayerBounds:function(t,i,e){e=this._getNewPixelOrigin(e,i);return f([this.project(t.getSouthWest(),i)._subtract(e),this.project(t.getNorthWest(),i)._subtract(e),this.project(t.getSouthEast(),i)._subtract(e),this.project(t.getNorthEast(),i)._subtract(e)])},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(t){return this.latLngToLayerPoint(t).subtract(this._getCenterLayerPoint())},_limitCenter:function(t,i,e){if(!e)return t;var n=this.project(t,i),o=this.getSize().divideBy(2),o=new m(n.subtract(o),n.add(o)),o=this._getBoundsOffset(o,e,i);return o.round().equals([0,0])?t:this.unproject(n.add(o),i)},_limitOffset:function(t,i){if(!i)return t;var e=this.getPixelBounds(),e=new m(e.min.add(t),e.max.add(t));return t.add(this._getBoundsOffset(e,i))},_getBoundsOffset:function(t,i,e){i=f(this.project(i.getNorthEast(),e),this.project(i.getSouthWest(),e)),e=i.min.subtract(t.min),i=i.max.subtract(t.max);return new p(this._rebound(e.x,-i.x),this._rebound(e.y,-i.y))},_rebound:function(t,i){return 0<t+i?Math.round(t-i)/2:Math.max(0,Math.ceil(t))-Math.max(0,Math.floor(i))},_limitZoom:function(t){var i=this.getMinZoom(),e=this.getMaxZoom(),n=P.any3d?this.options.zoomSnap:1;return n&&(t=Math.round(t/n)*n),Math.max(i,Math.min(e,t))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){M(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(t,i){t=this._getCenterOffset(t)._trunc();return!(!0!==(i&&i.animate)&&!this.getSize().contains(t))&&(this.panBy(t,i),!0)},_createAnimProxy:function(){var t=this._proxy=b("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(t),this.on("zoomanim",function(t){var i=ui,e=this._proxy.style[i];Pi(this._proxy,this.project(t.center,t.zoom),this.getZoomScale(t.zoom,1)),e===this._proxy.style[i]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){T(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var t=this.getCenter(),i=this.getZoom();Pi(this._proxy,this.project(t,i),this.getZoomScale(i,1))},_catchTransitionEnd:function(t){this._animatingZoom&&0<=t.propertyName.indexOf("transform")&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(t,i,e){if(this._animatingZoom)return!0;if(e=e||{},!this._zoomAnimated||!1===e.animate||this._nothingToAnimate()||Math.abs(i-this._zoom)>this.options.zoomAnimationThreshold)return!1;var n=this.getZoomScale(i),n=this._getCenterOffset(t)._divideBy(1-1/n);return!(!0!==e.animate&&!this.getSize().contains(n))&&(x(function(){this._moveStart(!0,!1)._animateZoom(t,i,!0)},this),!0)},_animateZoom:function(t,i,e,n){this._mapPane&&(e&&(this._animatingZoom=!0,this._animateToCenter=t,this._animateToZoom=i,z(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:t,zoom:i,noUpdate:n}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(a(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&M(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom,void 0,!0),this._tempFireZoomEvent&&this.fire("zoom"),delete this._tempFireZoomEvent,this.fire("move"),this._moveEnd(!0))}});function Fi(t){return new I(t)}var Ui,I=it.extend({options:{position:"topright"},initialize:function(t){c(this,t)},getPosition:function(){return this.options.position},setPosition:function(t){var i=this._map;return i&&i.removeControl(this),this.options.position=t,i&&i.addControl(this),this},getContainer:function(){return this._container},addTo:function(t){this.remove(),this._map=t;var i=this._container=this.onAdd(t),e=this.getPosition(),t=t._controlCorners[e];return z(i,"leaflet-control"),-1!==e.indexOf("bottom")?t.insertBefore(i,t.firstChild):t.appendChild(i),this._map.on("unload",this.remove,this),this},remove:function(){return this._map&&(T(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null),this},_refocusOnMap:function(t){this._map&&t&&0<t.screenX&&0<t.screenY&&this._map.getContainer().focus()}}),Vi=(A.include({addControl:function(t){return t.addTo(this),this},removeControl:function(t){return t.remove(),this},_initControlPos:function(){var e=this._controlCorners={},n="leaflet-",o=this._controlContainer=b("div",n+"control-container",this._container);function t(t,i){e[t+i]=b("div",n+t+" "+n+i,o)}t("top","left"),t("top","right"),t("bottom","left"),t("bottom","right")},_clearControlPos:function(){for(var t in this._controlCorners)T(this._controlCorners[t]);T(this._controlContainer),delete this._controlCorners,delete this._controlContainer}}),I.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(t,i,e,n){return e<n?-1:n<e?1:0}},initialize:function(t,i,e){for(var n in c(this,e),this._layerControlInputs=[],this._layers=[],this._lastZIndex=0,this._handlingClick=!1,t)this._addLayer(t[n],n);for(n in i)this._addLayer(i[n],n,!0)},onAdd:function(t){this._initLayout(),this._update(),(this._map=t).on("zoomend",this._checkDisabledLayers,this);for(var i=0;i<this._layers.length;i++)this._layers[i].layer.on("add remove",this._onLayerChange,this);return this._container},addTo:function(t){return I.prototype.addTo.call(this,t),this._expandIfNotCollapsed()},onRemove:function(){this._map.off("zoomend",this._checkDisabledLayers,this);for(var t=0;t<this._layers.length;t++)this._layers[t].layer.off("add remove",this._onLayerChange,this)},addBaseLayer:function(t,i){return this._addLayer(t,i),this._map?this._update():this},addOverlay:function(t,i){return this._addLayer(t,i,!0),this._map?this._update():this},removeLayer:function(t){t.off("add remove",this._onLayerChange,this);t=this._getLayer(h(t));return t&&this._layers.splice(this._layers.indexOf(t),1),this._map?this._update():this},expand:function(){z(this._container,"leaflet-control-layers-expanded"),this._section.style.height=null;var t=this._map.getSize().y-(this._container.offsetTop+50);return t<this._section.clientHeight?(z(this._section,"leaflet-control-layers-scrollbar"),this._section.style.height=t+"px"):M(this._section,"leaflet-control-layers-scrollbar"),this._checkDisabledLayers(),this},collapse:function(){return M(this._container,"leaflet-control-layers-expanded"),this},_initLayout:function(){var t="leaflet-control-layers",i=this._container=b("div",t),e=this.options.collapsed,n=(i.setAttribute("aria-haspopup",!0),Oi(i),Ii(i),this._section=b("section",t+"-list")),o=(e&&(this._map.on("click",this.collapse,this),S(i,{mouseenter:function(){S(n,"click",B),this.expand(),setTimeout(function(){E(n,"click",B)})},mouseleave:this.collapse},this)),this._layersLink=b("a",t+"-toggle",i));o.href="#",o.title="Layers",o.setAttribute("role","button"),S(o,"click",B),S(o,"focus",this.expand,this),e||this.expand(),this._baseLayersList=b("div",t+"-base",n),this._separator=b("div",t+"-separator",n),this._overlaysList=b("div",t+"-overlays",n),i.appendChild(n)},_getLayer:function(t){for(var i=0;i<this._layers.length;i++)if(this._layers[i]&&h(this._layers[i].layer)===t)return this._layers[i]},_addLayer:function(t,i,e){this._map&&t.on("add remove",this._onLayerChange,this),this._layers.push({layer:t,name:i,overlay:e}),this.options.sortLayers&&this._layers.sort(a(function(t,i){return this.options.sortFunction(t.layer,i.layer,t.name,i.name)},this)),this.options.autoZIndex&&t.setZIndex&&(this._lastZIndex++,t.setZIndex(this._lastZIndex)),this._expandIfNotCollapsed()},_update:function(){if(!this._container)return this;mi(this._baseLayersList),mi(this._overlaysList),this._layerControlInputs=[];for(var t,i,e,n=0,o=0;o<this._layers.length;o++)e=this._layers[o],this._addItem(e),i=i||e.overlay,t=t||!e.overlay,n+=e.overlay?0:1;return this.options.hideSingleBase&&(this._baseLayersList.style.display=(t=t&&1<n)?"":"none"),this._separator.style.display=i&&t?"":"none",this},_onLayerChange:function(t){this._handlingClick||this._update();var i=this._getLayer(h(t.target)),t=i.overlay?"add"===t.type?"overlayadd":"overlayremove":"add"===t.type?"baselayerchange":null;t&&this._map.fire(t,i)},_createRadioElement:function(t,i){t='<input type="radio" class="leaflet-control-layers-selector" name="'+t+'"'+(i?' checked="checked"':"")+"/>",i=document.createElement("div");return i.innerHTML=t,i.firstChild},_addItem:function(t){var i,e=document.createElement("label"),n=this._map.hasLayer(t.layer),n=(t.overlay?((i=document.createElement("input")).type="checkbox",i.className="leaflet-control-layers-selector",i.defaultChecked=n):i=this._createRadioElement("leaflet-base-layers_"+h(this),n),this._layerControlInputs.push(i),i.layerId=h(t.layer),S(i,"click",this._onInputClick,this),document.createElement("span")),o=(n.innerHTML=" "+t.name,document.createElement("span"));return e.appendChild(o),o.appendChild(i),o.appendChild(n),(t.overlay?this._overlaysList:this._baseLayersList).appendChild(e),this._checkDisabledLayers(),e},_onInputClick:function(){var t,i,e=this._layerControlInputs,n=[],o=[];this._handlingClick=!0;for(var s=e.length-1;0<=s;s--)t=e[s],i=this._getLayer(t.layerId).layer,t.checked?n.push(i):t.checked||o.push(i);for(s=0;s<o.length;s++)this._map.hasLayer(o[s])&&this._map.removeLayer(o[s]);for(s=0;s<n.length;s++)this._map.hasLayer(n[s])||this._map.addLayer(n[s]);this._handlingClick=!1,this._refocusOnMap()},_checkDisabledLayers:function(){for(var t,i,e=this._layerControlInputs,n=this._map.getZoom(),o=e.length-1;0<=o;o--)t=e[o],i=this._getLayer(t.layerId).layer,t.disabled=void 0!==i.options.minZoom&&n<i.options.minZoom||void 0!==i.options.maxZoom&&n>i.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this}})),qi=I.extend({options:{position:"topleft",zoomInText:'<span aria-hidden="true">+</span>',zoomInTitle:"Zoom in",zoomOutText:'<span aria-hidden="true">&#x2212;</span>',zoomOutTitle:"Zoom out"},onAdd:function(t){var i="leaflet-control-zoom",e=b("div",i+" leaflet-bar"),n=this.options;return this._zoomInButton=this._createButton(n.zoomInText,n.zoomInTitle,i+"-in",e,this._zoomIn),this._zoomOutButton=this._createButton(n.zoomOutText,n.zoomOutTitle,i+"-out",e,this._zoomOut),this._updateDisabled(),t.on("zoomend zoomlevelschange",this._updateDisabled,this),e},onRemove:function(t){t.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(t){!this._disabled&&this._map._zoom<this._map.getMaxZoom()&&this._map.zoomIn(this._map.options.zoomDelta*(t.shiftKey?3:1))},_zoomOut:function(t){!this._disabled&&this._map._zoom>this._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(t.shiftKey?3:1))},_createButton:function(t,i,e,n,o){e=b("a",e,n);return e.innerHTML=t,e.href="#",e.title=i,e.setAttribute("role","button"),e.setAttribute("aria-label",i),Oi(e),S(e,"click",Ri),S(e,"click",o,this),S(e,"click",this._refocusOnMap,this),e},_updateDisabled:function(){var t=this._map,i="leaflet-disabled";M(this._zoomInButton,i),M(this._zoomOutButton,i),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),!this._disabled&&t._zoom!==t.getMinZoom()||(z(this._zoomOutButton,i),this._zoomOutButton.setAttribute("aria-disabled","true")),!this._disabled&&t._zoom!==t.getMaxZoom()||(z(this._zoomInButton,i),this._zoomInButton.setAttribute("aria-disabled","true"))}}),Gi=(A.mergeOptions({zoomControl:!0}),A.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new qi,this.addControl(this.zoomControl))}),I.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(t){var i="leaflet-control-scale",e=b("div",i),n=this.options;return this._addScales(n,i+"-line",e),t.on(n.updateWhenIdle?"moveend":"move",this._update,this),t.whenReady(this._update,this),e},onRemove:function(t){t.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(t,i,e){t.metric&&(this._mScale=b("div",i,e)),t.imperial&&(this._iScale=b("div",i,e))},_update:function(){var t=this._map,i=t.getSize().y/2,t=t.distance(t.containerPointToLatLng([0,i]),t.containerPointToLatLng([this.options.maxWidth,i]));this._updateScales(t)},_updateScales:function(t){this.options.metric&&t&&this._updateMetric(t),this.options.imperial&&t&&this._updateImperial(t)},_updateMetric:function(t){var i=this._getRoundNum(t);this._updateScale(this._mScale,i<1e3?i+" m":i/1e3+" km",i/t)},_updateImperial:function(t){var i,e,t=3.2808399*t;5280<t?(e=this._getRoundNum(i=t/5280),this._updateScale(this._iScale,e+" mi",e/i)):(e=this._getRoundNum(t),this._updateScale(this._iScale,e+" ft",e/t))},_updateScale:function(t,i,e){t.style.width=Math.round(this.options.maxWidth*e)+"px",t.innerHTML=i},_getRoundNum:function(t){var i=Math.pow(10,(Math.floor(t)+"").length-1),t=t/i;return i*(t=10<=t?10:5<=t?5:3<=t?3:2<=t?2:1)}})),Ki=I.extend({options:{position:"bottomright",prefix:'<a href="https://leafletjs.com" title="A JavaScript library for interactive maps">'+(P.inlineSvg?'<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="12" height="8"><path fill="#4C7BE1" d="M0 0h12v4H0z"/><path fill="#FFD500" d="M0 4h12v3H0z"/><path fill="#E0BC00" d="M0 7h12v1H0z"/></svg> ':"")+"Leaflet</a>"},initialize:function(t){c(this,t),this._attributions={}},onAdd:function(t){for(var i in(t.attributionControl=this)._container=b("div","leaflet-control-attribution"),Oi(this._container),t._layers)t._layers[i].getAttribution&&this.addAttribution(t._layers[i].getAttribution());return this._update(),t.on("layeradd",this._addAttribution,this),this._container},onRemove:function(t){t.off("layeradd",this._addAttribution,this)},_addAttribution:function(t){t.layer.getAttribution&&(this.addAttribution(t.layer.getAttribution()),t.layer.once("remove",function(){this.removeAttribution(t.layer.getAttribution())},this))},setPrefix:function(t){return this.options.prefix=t,this._update(),this},addAttribution:function(t){return t&&(this._attributions[t]||(this._attributions[t]=0),this._attributions[t]++,this._update()),this},removeAttribution:function(t){return t&&this._attributions[t]&&(this._attributions[t]--,this._update()),this},_update:function(){if(this._map){var t,i=[];for(t in this._attributions)this._attributions[t]&&i.push(t);var e=[];this.options.prefix&&e.push(this.options.prefix),i.length&&e.push(i.join(", ")),this._container.innerHTML=e.join(' <span aria-hidden="true">|</span> ')}}}),n=(A.mergeOptions({attributionControl:!0}),A.addInitHook(function(){this.options.attributionControl&&(new Ki).addTo(this)}),I.Layers=Vi,I.Zoom=qi,I.Scale=Gi,I.Attribution=Ki,Fi.layers=function(t,i,e){return new Vi(t,i,e)},Fi.zoom=function(t){return new qi(t)},Fi.scale=function(t){return new Gi(t)},Fi.attribution=function(t){return new Ki(t)},it.extend({initialize:function(t){this._map=t},enable:function(){return this._enabled||(this._enabled=!0,this.addHooks()),this},disable:function(){return this._enabled&&(this._enabled=!1,this.removeHooks()),this},enabled:function(){return!!this._enabled}})),ft=(n.addTo=function(t,i){return t.addHandler(i,this),this},{Events:i}),Yi=P.touch?"touchstart mousedown":"mousedown",Xi=et.extend({options:{clickTolerance:3},initialize:function(t,i,e,n){c(this,n),this._element=t,this._dragStartTarget=i||t,this._preventOutline=e},enable:function(){this._enabled||(S(this._dragStartTarget,Yi,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(Xi._dragging===this&&this.finishDrag(!0),E(this._dragStartTarget,Yi,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(t){var i,e;this._enabled&&(this._moved=!1,vi(this._element,"leaflet-zoom-anim")||(t.touches&&1!==t.touches.length?Xi._dragging===this&&this.finishDrag():Xi._dragging||t.shiftKey||1!==t.which&&1!==t.button&&!t.touches||((Xi._dragging=this)._preventOutline&&zi(this._element),Li(),ri(),this._moving||(this.fire("down"),e=t.touches?t.touches[0]:t,i=Ci(this._element),this._startPoint=new p(e.clientX,e.clientY),this._startPos=bi(this._element),this._parentScale=Zi(i),e="mousedown"===t.type,S(document,e?"mousemove":"touchmove",this._onMove,this),S(document,e?"mouseup":"touchend touchcancel",this._onUp,this)))))},_onMove:function(t){var i;this._enabled&&(t.touches&&1<t.touches.length?this._moved=!0:!(i=new p((i=t.touches&&1===t.touches.length?t.touches[0]:t).clientX,i.clientY)._subtract(this._startPoint)).x&&!i.y||Math.abs(i.x)+Math.abs(i.y)<this.options.clickTolerance||(i.x/=this._parentScale.x,i.y/=this._parentScale.y,B(t),this._moved||(this.fire("dragstart"),this._moved=!0,z(document.body,"leaflet-dragging"),this._lastTarget=t.target||t.srcElement,window.SVGElementInstance&&this._lastTarget instanceof window.SVGElementInstance&&(this._lastTarget=this._lastTarget.correspondingUseElement),z(this._lastTarget,"leaflet-drag-target")),this._newPos=this._startPos.add(i),this._moving=!0,this._lastEvent=t,this._updatePosition()))},_updatePosition:function(){var t={originalEvent:this._lastEvent};this.fire("predrag",t),Z(this._element,this._newPos),this.fire("drag",t)},_onUp:function(){this._enabled&&this.finishDrag()},finishDrag:function(t){M(document.body,"leaflet-dragging"),this._lastTarget&&(M(this._lastTarget,"leaflet-drag-target"),this._lastTarget=null),E(document,"mousemove touchmove",this._onMove,this),E(document,"mouseup touchend touchcancel",this._onUp,this),Ti(),ai(),this._moved&&this._moving&&this.fire("dragend",{noInertia:t,distance:this._newPos.distanceTo(this._startPos)}),this._moving=!1,Xi._dragging=!1}});function Ji(t,i){if(!i||!t.length)return t.slice();i*=i;return t=function(t,i){var e=t.length,n=new(typeof Uint8Array!=void 0+""?Uint8Array:Array)(e);n[0]=n[e-1]=1,function t(i,e,n,o,s){var r,a,h,l=0;for(a=o+1;a<=s-1;a++)h=ee(i[a],i[o],i[s],!0),l<h&&(r=a,l=h);n<l&&(e[r]=1,t(i,e,n,o,r),t(i,e,n,r,s))}(t,n,i,0,e-1);var o,s=[];for(o=0;o<e;o++)n[o]&&s.push(t[o]);return s}(t=function(t,i){for(var e=[t[0]],n=1,o=0,s=t.length;n<s;n++)(function(t,i){var e=i.x-t.x,i=i.y-t.y;return e*e+i*i})(t[n],t[o])>i&&(e.push(t[n]),o=n);o<s-1&&e.push(t[s-1]);return e}(t,i),i)}function $i(t,i,e){return Math.sqrt(ee(t,i,e,!0))}function Qi(t,i,e,n,o){var s,r,a,h=n?Ui:ie(t,e),l=ie(i,e);for(Ui=l;;){if(!(h|l))return[t,i];if(h&l)return!1;a=ie(r=te(t,i,s=h||l,e,o),e),s===h?(t=r,h=a):(i=r,l=a)}}function te(t,i,e,n,o){var s,r,a=i.x-t.x,i=i.y-t.y,h=n.min,n=n.max;return 8&e?(s=t.x+a*(n.y-t.y)/i,r=n.y):4&e?(s=t.x+a*(h.y-t.y)/i,r=h.y):2&e?(s=n.x,r=t.y+i*(n.x-t.x)/a):1&e&&(s=h.x,r=t.y+i*(h.x-t.x)/a),new p(s,r,o)}function ie(t,i){var e=0;return t.x<i.min.x?e|=1:t.x>i.max.x&&(e|=2),t.y<i.min.y?e|=4:t.y>i.max.y&&(e|=8),e}function ee(t,i,e,n){var o=i.x,i=i.y,s=e.x-o,r=e.y-i,a=s*s+r*r;return 0<a&&(1<(a=((t.x-o)*s+(t.y-i)*r)/a)?(o=e.x,i=e.y):0<a&&(o+=s*a,i+=r*a)),s=t.x-o,r=t.y-i,n?s*s+r*r:new p(o,i)}function ne(t){return!d(t[0])||"object"!=typeof t[0][0]&&void 0!==t[0][0]}function oe(t){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),ne(t)}gt={__proto__:null,simplify:Ji,pointToSegmentDistance:$i,closestPointOnSegment:function(t,i,e){return ee(t,i,e)},clipSegment:Qi,_getEdgeIntersection:te,_getBitCode:ie,_sqClosestPointOnSegment:ee,isFlat:ne,_flat:oe};function se(t,i,e){for(var n,o,s,r,a,h,l,u=[1,4,2,8],c=0,d=t.length;c<d;c++)t[c]._code=ie(t[c],i);for(s=0;s<4;s++){for(h=u[s],n=[],c=0,o=(d=t.length)-1;c<d;o=c++)r=t[c],a=t[o],r._code&h?a._code&h||((l=te(a,r,h,i,e))._code=ie(l,i),n.push(l)):(a._code&h&&((l=te(a,r,h,i,e))._code=ie(l,i),n.push(l)),n.push(r));t=n}return t}var vt={__proto__:null,clipPolygon:se},yt={project:function(t){return new p(t.lng,t.lat)},unproject:function(t){return new v(t.y,t.x)},bounds:new m([-180,-90],[180,90])},xt={R:6378137,R_MINOR:6356752.314245179,bounds:new m([-20037508.34279,-15496570.73972],[20037508.34279,18764656.23138]),project:function(t){var i=Math.PI/180,e=this.R,n=t.lat*i,o=this.R_MINOR/e,o=Math.sqrt(1-o*o),s=o*Math.sin(n),s=Math.tan(Math.PI/4-n/2)/Math.pow((1-s)/(1+s),o/2),n=-e*Math.log(Math.max(s,1e-10));return new p(t.lng*i*e,n)},unproject:function(t){for(var i,e=180/Math.PI,n=this.R,o=this.R_MINOR/n,s=Math.sqrt(1-o*o),r=Math.exp(-t.y/n),a=Math.PI/2-2*Math.atan(r),h=0,l=.1;h<15&&1e-7<Math.abs(l);h++)i=s*Math.sin(a),i=Math.pow((1-i)/(1+i),s/2),a+=l=Math.PI/2-2*Math.atan(r*i)-a;return new v(a*e,t.x*e/n)}},wt={__proto__:null,LonLat:yt,Mercator:xt,SphericalMercator:rt},bt=l({},st,{code:"EPSG:3395",projection:xt,transformation:ht(Pt=.5/(Math.PI*xt.R),.5,-Pt,.5)}),re=l({},st,{code:"EPSG:4326",projection:yt,transformation:ht(1/180,1,-1/180,.5)}),Lt=l({},ot,{projection:yt,transformation:ht(1,0,-1,0),scale:function(t){return Math.pow(2,t)},zoom:function(t){return Math.log(t)/Math.LN2},distance:function(t,i){var e=i.lng-t.lng,i=i.lat-t.lat;return Math.sqrt(e*e+i*i)},infinite:!0}),o=(ot.Earth=st,ot.EPSG3395=bt,ot.EPSG3857=lt,ot.EPSG900913=ut,ot.EPSG4326=re,ot.Simple=Lt,et.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(t){return t.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(t){return t&&t.removeLayer(this),this},getPane:function(t){return this._map.getPane(t?this.options[t]||t:this.options.pane)},addInteractiveTarget:function(t){return this._map._targets[h(t)]=this},removeInteractiveTarget:function(t){return delete this._map._targets[h(t)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(t){var i,e=t.target;e.hasLayer(this)&&(this._map=e,this._zoomAnimated=e._zoomAnimated,this.getEvents&&(i=this.getEvents(),e.on(i,this),this.once("remove",function(){e.off(i,this)},this)),this.onAdd(e),this.fire("add"),e.fire("layeradd",{layer:this}))}})),ae=(A.include({addLayer:function(t){if(!t._layerAdd)throw new Error("The provided object is not a Layer.");var i=h(t);return this._layers[i]||((this._layers[i]=t)._mapToAdd=this,t.beforeAdd&&t.beforeAdd(this),this.whenReady(t._layerAdd,t)),this},removeLayer:function(t){var i=h(t);return this._layers[i]&&(this._loaded&&t.onRemove(this),delete this._layers[i],this._loaded&&(this.fire("layerremove",{layer:t}),t.fire("remove")),t._map=t._mapToAdd=null),this},hasLayer:function(t){return h(t)in this._layers},eachLayer:function(t,i){for(var e in this._layers)t.call(i,this._layers[e]);return this},_addLayers:function(t){for(var i=0,e=(t=t?d(t)?t:[t]:[]).length;i<e;i++)this.addLayer(t[i])},_addZoomLimit:function(t){isNaN(t.options.maxZoom)&&isNaN(t.options.minZoom)||(this._zoomBoundLayers[h(t)]=t,this._updateZoomLevels())},_removeZoomLimit:function(t){t=h(t);this._zoomBoundLayers[t]&&(delete this._zoomBoundLayers[t],this._updateZoomLevels())},_updateZoomLevels:function(){var t,i=1/0,e=-1/0,n=this._getZoomSpan();for(t in this._zoomBoundLayers)var o=this._zoomBoundLayers[t].options,i=void 0===o.minZoom?i:Math.min(i,o.minZoom),e=void 0===o.maxZoom?e:Math.max(e,o.maxZoom);this._layersMaxZoom=e===-1/0?void 0:e,this._layersMinZoom=i===1/0?void 0:i,n!==this._getZoomSpan()&&this.fire("zoomlevelschange"),void 0===this.options.maxZoom&&this._layersMaxZoom&&this.getZoom()>this._layersMaxZoom&&this.setZoom(this._layersMaxZoom),void 0===this.options.minZoom&&this._layersMinZoom&&this.getZoom()<this._layersMinZoom&&this.setZoom(this._layersMinZoom)}}),o.extend({initialize:function(t,i){var e,n;if(c(this,i),this._layers={},t)for(e=0,n=t.length;e<n;e++)this.addLayer(t[e])},addLayer:function(t){var i=this.getLayerId(t);return this._layers[i]=t,this._map&&this._map.addLayer(t),this},removeLayer:function(t){t=t in this._layers?t:this.getLayerId(t);return this._map&&this._layers[t]&&this._map.removeLayer(this._layers[t]),delete this._layers[t],this},hasLayer:function(t){return("number"==typeof t?t:this.getLayerId(t))in this._layers},clearLayers:function(){return this.eachLayer(this.removeLayer,this)},invoke:function(t){var i,e,n=Array.prototype.slice.call(arguments,1);for(i in this._layers)(e=this._layers[i])[t]&&e[t].apply(e,n);return this},onAdd:function(t){this.eachLayer(t.addLayer,t)},onRemove:function(t){this.eachLayer(t.removeLayer,t)},eachLayer:function(t,i){for(var e in this._layers)t.call(i,this._layers[e]);return this},getLayer:function(t){return this._layers[t]},getLayers:function(){var t=[];return this.eachLayer(t.push,t),t},setZIndex:function(t){return this.invoke("setZIndex",t)},getLayerId:h})),he=ae.extend({addLayer:function(t){return this.hasLayer(t)?this:(t.addEventParent(this),ae.prototype.addLayer.call(this,t),this.fire("layeradd",{layer:t}))},removeLayer:function(t){return this.hasLayer(t)?((t=t in this._layers?this._layers[t]:t).removeEventParent(this),ae.prototype.removeLayer.call(this,t),this.fire("layerremove",{layer:t})):this},setStyle:function(t){return this.invoke("setStyle",t)},bringToFront:function(){return this.invoke("bringToFront")},bringToBack:function(){return this.invoke("bringToBack")},getBounds:function(){var t,i=new s;for(t in this._layers){var e=this._layers[t];i.extend(e.getBounds?e.getBounds():e.getLatLng())}return i}}),le=it.extend({options:{popupAnchor:[0,0],tooltipAnchor:[0,0],crossOrigin:!1},initialize:function(t){c(this,t)},createIcon:function(t){return this._createIcon("icon",t)},createShadow:function(t){return this._createIcon("shadow",t)},_createIcon:function(t,i){var e=this._getIconUrl(t);if(!e){if("icon"===t)throw new Error("iconUrl not set in Icon options (see the docs).");return null}e=this._createImg(e,i&&"IMG"===i.tagName?i:null);return this._setIconStyles(e,t),!this.options.crossOrigin&&""!==this.options.crossOrigin||(e.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),e},_setIconStyles:function(t,i){var e=this.options,n=e[i+"Size"],n=_(n="number"==typeof n?[n,n]:n),o=_("shadow"===i&&e.shadowAnchor||e.iconAnchor||n&&n.divideBy(2,!0));t.className="leaflet-marker-"+i+" "+(e.className||""),o&&(t.style.marginLeft=-o.x+"px",t.style.marginTop=-o.y+"px"),n&&(t.style.width=n.x+"px",t.style.height=n.y+"px")},_createImg:function(t,i){return(i=i||document.createElement("img")).src=t,i},_getIconUrl:function(t){return P.retina&&this.options[t+"RetinaUrl"]||this.options[t+"Url"]}});var ue=le.extend({options:{iconUrl:"marker-icon.png",iconRetinaUrl:"marker-icon-2x.png",shadowUrl:"marker-shadow.png",iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],tooltipAnchor:[16,-28],shadowSize:[41,41]},_getIconUrl:function(t){return"string"!=typeof ue.imagePath&&(ue.imagePath=this._detectIconPath()),(this.options.imagePath||ue.imagePath)+le.prototype._getIconUrl.call(this,t)},_stripUrl:function(t){function i(t,i,e){return(i=i.exec(t))&&i[e]}return(t=i(t,/^url\((['"])?(.+)\1\)$/,2))&&i(t,/^(.*)marker-icon\.png$/,1)},_detectIconPath:function(){var t=b("div","leaflet-default-icon-path",document.body),i=pi(t,"background-image")||pi(t,"backgroundImage");if(document.body.removeChild(t),i=this._stripUrl(i))return i;t=document.querySelector('link[href$="leaflet.css"]');return t?t.href.substring(0,t.href.length-"leaflet.css".length-1):""}}),ce=n.extend({initialize:function(t){this._marker=t},addHooks:function(){var t=this._marker._icon;this._draggable||(this._draggable=new Xi(t,t,!0)),this._draggable.on({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).enable(),z(t,"leaflet-marker-draggable")},removeHooks:function(){this._draggable.off({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).disable(),this._marker._icon&&M(this._marker._icon,"leaflet-marker-draggable")},moved:function(){return this._draggable&&this._draggable._moved},_adjustPan:function(t){var i=this._marker,e=i._map,n=this._marker.options.autoPanSpeed,o=this._marker.options.autoPanPadding,s=bi(i._icon),r=e.getPixelBounds(),a=e.getPixelOrigin(),a=f(r.min._subtract(a).add(o),r.max._subtract(a).subtract(o));a.contains(s)||(o=_((Math.max(a.max.x,s.x)-a.max.x)/(r.max.x-a.max.x)-(Math.min(a.min.x,s.x)-a.min.x)/(r.min.x-a.min.x),(Math.max(a.max.y,s.y)-a.max.y)/(r.max.y-a.max.y)-(Math.min(a.min.y,s.y)-a.min.y)/(r.min.y-a.min.y)).multiplyBy(n),e.panBy(o,{animate:!1}),this._draggable._newPos._add(o),this._draggable._startPos._add(o),Z(i._icon,this._draggable._newPos),this._onDrag(t),this._panRequest=x(this._adjustPan.bind(this,t)))},_onDragStart:function(){this._oldLatLng=this._marker.getLatLng(),this._marker.closePopup&&this._marker.closePopup(),this._marker.fire("movestart").fire("dragstart")},_onPreDrag:function(t){this._marker.options.autoPan&&(r(this._panRequest),this._panRequest=x(this._adjustPan.bind(this,t)))},_onDrag:function(t){var i=this._marker,e=i._shadow,n=bi(i._icon),o=i._map.layerPointToLatLng(n);e&&Z(e,n),i._latlng=o,t.latlng=o,t.oldLatLng=this._oldLatLng,i.fire("move",t).fire("drag",t)},_onDragEnd:function(t){r(this._panRequest),delete this._oldLatLng,this._marker.fire("moveend").fire("dragend",t)}}),de=o.extend({options:{icon:new ue,interactive:!0,keyboard:!0,title:"",alt:"Marker",zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250,pane:"markerPane",shadowPane:"shadowPane",bubblingMouseEvents:!1,autoPanOnFocus:!0,draggable:!1,autoPan:!1,autoPanPadding:[50,50],autoPanSpeed:10},initialize:function(t,i){c(this,i),this._latlng=w(t)},onAdd:function(t){this._zoomAnimated=this._zoomAnimated&&t.options.markerZoomAnimation,this._zoomAnimated&&t.on("zoomanim",this._animateZoom,this),this._initIcon(),this.update()},onRemove:function(t){this.dragging&&this.dragging.enabled()&&(this.options.draggable=!0,this.dragging.removeHooks()),delete this.dragging,this._zoomAnimated&&t.off("zoomanim",this._animateZoom,this),this._removeIcon(),this._removeShadow()},getEvents:function(){return{zoom:this.update,viewreset:this.update}},getLatLng:function(){return this._latlng},setLatLng:function(t){var i=this._latlng;return this._latlng=w(t),this.update(),this.fire("move",{oldLatLng:i,latlng:this._latlng})},setZIndexOffset:function(t){return this.options.zIndexOffset=t,this.update()},getIcon:function(){return this.options.icon},setIcon:function(t){return this.options.icon=t,this._map&&(this._initIcon(),this.update()),this._popup&&this.bindPopup(this._popup,this._popup.options),this},getElement:function(){return this._icon},update:function(){var t;return this._icon&&this._map&&(t=this._map.latLngToLayerPoint(this._latlng).round(),this._setPos(t)),this},_initIcon:function(){var t=this.options,i="leaflet-zoom-"+(this._zoomAnimated?"animated":"hide"),e=t.icon.createIcon(this._icon),n=!1,e=(e!==this._icon&&(this._icon&&this._removeIcon(),n=!0,t.title&&(e.title=t.title),"IMG"===e.tagName&&(e.alt=t.alt||"")),z(e,i),t.keyboard&&(e.tabIndex="0",e.setAttribute("role","button")),this._icon=e,t.riseOnHover&&this.on({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&S(e,"focus",this._panOnFocus,this),t.icon.createShadow(this._shadow)),o=!1;e!==this._shadow&&(this._removeShadow(),o=!0),e&&(z(e,i),e.alt=""),this._shadow=e,t.opacity<1&&this._updateOpacity(),n&&this.getPane().appendChild(this._icon),this._initInteraction(),e&&o&&this.getPane(t.shadowPane).appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&this.off({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&E(this._icon,"focus",this._panOnFocus,this),T(this._icon),this.removeInteractiveTarget(this._icon),this._icon=null},_removeShadow:function(){this._shadow&&T(this._shadow),this._shadow=null},_setPos:function(t){this._icon&&Z(this._icon,t),this._shadow&&Z(this._shadow,t),this._zIndex=t.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(t){this._icon&&(this._icon.style.zIndex=this._zIndex+t)},_animateZoom:function(t){t=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center).round();this._setPos(t)},_initInteraction:function(){var t;this.options.interactive&&(z(this._icon,"leaflet-interactive"),this.addInteractiveTarget(this._icon),ce&&(t=this.options.draggable,this.dragging&&(t=this.dragging.enabled(),this.dragging.disable()),this.dragging=new ce(this),t&&this.dragging.enable()))},setOpacity:function(t){return this.options.opacity=t,this._map&&this._updateOpacity(),this},_updateOpacity:function(){var t=this.options.opacity;this._icon&&C(this._icon,t),this._shadow&&C(this._shadow,t)},_bringToFront:function(){this._updateZIndex(this.options.riseOffset)},_resetZIndex:function(){this._updateZIndex(0)},_panOnFocus:function(){var t,i,e=this._map;e&&(t=(i=this.options.icon.options).iconSize?_(i.iconSize):_(0,0),i=i.iconAnchor?_(i.iconAnchor):_(0,0),e.panInside(this._latlng,{paddingTopLeft:i,paddingBottomRight:t.subtract(i)}))},_getPopupAnchor:function(){return this.options.icon.options.popupAnchor},_getTooltipAnchor:function(){return this.options.icon.options.tooltipAnchor}});var _e=o.extend({options:{stroke:!0,color:"#3388ff",weight:3,opacity:1,lineCap:"round",lineJoin:"round",dashArray:null,dashOffset:null,fill:!1,fillColor:null,fillOpacity:.2,fillRule:"evenodd",interactive:!0,bubblingMouseEvents:!0},beforeAdd:function(t){this._renderer=t.getRenderer(this)},onAdd:function(){this._renderer._initPath(this),this._reset(),this._renderer._addPath(this)},onRemove:function(){this._renderer._removePath(this)},redraw:function(){return this._map&&this._renderer._updatePath(this),this},setStyle:function(t){return c(this,t),this._renderer&&(this._renderer._updateStyle(this),this.options.stroke&&t&&Object.prototype.hasOwnProperty.call(t,"weight")&&this._updateBounds()),this},bringToFront:function(){return this._renderer&&this._renderer._bringToFront(this),this},bringToBack:function(){return this._renderer&&this._renderer._bringToBack(this),this},getElement:function(){return this._path},_reset:function(){this._project(),this._update()},_clickTolerance:function(){return(this.options.stroke?this.options.weight/2:0)+(this._renderer.options.tolerance||0)}}),pe=_e.extend({options:{fill:!0,radius:10},initialize:function(t,i){c(this,i),this._latlng=w(t),this._radius=this.options.radius},setLatLng:function(t){var i=this._latlng;return this._latlng=w(t),this.redraw(),this.fire("move",{oldLatLng:i,latlng:this._latlng})},getLatLng:function(){return this._latlng},setRadius:function(t){return this.options.radius=this._radius=t,this.redraw()},getRadius:function(){return this._radius},setStyle:function(t){var i=t&&t.radius||this._radius;return _e.prototype.setStyle.call(this,t),this.setRadius(i),this},_project:function(){this._point=this._map.latLngToLayerPoint(this._latlng),this._updateBounds()},_updateBounds:function(){var t=this._radius,i=this._radiusY||t,e=this._clickTolerance(),t=[t+e,i+e];this._pxBounds=new m(this._point.subtract(t),this._point.add(t))},_update:function(){this._map&&this._updatePath()},_updatePath:function(){this._renderer._updateCircle(this)},_empty:function(){return this._radius&&!this._renderer._bounds.intersects(this._pxBounds)},_containsPoint:function(t){return t.distanceTo(this._point)<=this._radius+this._clickTolerance()}});var me=pe.extend({initialize:function(t,i,e){if(c(this,i="number"==typeof i?l({},e,{radius:i}):i),this._latlng=w(t),isNaN(this.options.radius))throw new Error("Circle radius cannot be NaN");this._mRadius=this.options.radius},setRadius:function(t){return this._mRadius=t,this.redraw()},getRadius:function(){return this._mRadius},getBounds:function(){var t=[this._radius,this._radiusY||this._radius];return new s(this._map.layerPointToLatLng(this._point.subtract(t)),this._map.layerPointToLatLng(this._point.add(t)))},setStyle:_e.prototype.setStyle,_project:function(){var t,i,e,n,o,s=this._latlng.lng,r=this._latlng.lat,a=this._map,h=a.options.crs;h.distance===st.distance?(n=Math.PI/180,o=this._mRadius/st.R/n,t=a.project([r+o,s]),i=a.project([r-o,s]),i=t.add(i).divideBy(2),e=a.unproject(i).lat,n=Math.acos((Math.cos(o*n)-Math.sin(r*n)*Math.sin(e*n))/(Math.cos(r*n)*Math.cos(e*n)))/n,!isNaN(n)&&0!==n||(n=o/Math.cos(Math.PI/180*r)),this._point=i.subtract(a.getPixelOrigin()),this._radius=isNaN(n)?0:i.x-a.project([e,s-n]).x,this._radiusY=i.y-t.y):(o=h.unproject(h.project(this._latlng).subtract([this._mRadius,0])),this._point=a.latLngToLayerPoint(this._latlng),this._radius=this._point.x-a.latLngToLayerPoint(o).x),this._updateBounds()}});var fe=_e.extend({options:{smoothFactor:1,noClip:!1},initialize:function(t,i){c(this,i),this._setLatLngs(t)},getLatLngs:function(){return this._latlngs},setLatLngs:function(t){return this._setLatLngs(t),this.redraw()},isEmpty:function(){return!this._latlngs.length},closestLayerPoint:function(t){for(var i=1/0,e=null,n=ee,o=0,s=this._parts.length;o<s;o++)for(var r=this._parts[o],a=1,h=r.length;a<h;a++){var l,u,c=n(t,l=r[a-1],u=r[a],!0);c<i&&(i=c,e=n(t,l,u))}return e&&(e.distance=Math.sqrt(i)),e},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");var t,i,e,n,o,s,r=this._rings[0],a=r.length;if(!a)return null;for(i=t=0;t<a-1;t++)i+=r[t].distanceTo(r[t+1])/2;if(0===i)return this._map.layerPointToLatLng(r[0]);for(e=t=0;t<a-1;t++)if(n=r[t],o=r[t+1],i<(e+=s=n.distanceTo(o)))return this._map.layerPointToLatLng([o.x-(s=(e-i)/s)*(o.x-n.x),o.y-s*(o.y-n.y)])},getBounds:function(){return this._bounds},addLatLng:function(t,i){return i=i||this._defaultShape(),t=w(t),i.push(t),this._bounds.extend(t),this.redraw()},_setLatLngs:function(t){this._bounds=new s,this._latlngs=this._convertLatLngs(t)},_defaultShape:function(){return ne(this._latlngs)?this._latlngs:this._latlngs[0]},_convertLatLngs:function(t){for(var i=[],e=ne(t),n=0,o=t.length;n<o;n++)e?(i[n]=w(t[n]),this._bounds.extend(i[n])):i[n]=this._convertLatLngs(t[n]);return i},_project:function(){var t=new m;this._rings=[],this._projectLatlngs(this._latlngs,this._rings,t),this._bounds.isValid()&&t.isValid()&&(this._rawPxBounds=t,this._updateBounds())},_updateBounds:function(){var t=this._clickTolerance(),t=new p(t,t);this._rawPxBounds&&(this._pxBounds=new m([this._rawPxBounds.min.subtract(t),this._rawPxBounds.max.add(t)]))},_projectLatlngs:function(t,i,e){var n,o,s=t[0]instanceof v,r=t.length;if(s){for(o=[],n=0;n<r;n++)o[n]=this._map.latLngToLayerPoint(t[n]),e.extend(o[n]);i.push(o)}else for(n=0;n<r;n++)this._projectLatlngs(t[n],i,e)},_clipPoints:function(){var t=this._renderer._bounds;if(this._parts=[],this._pxBounds&&this._pxBounds.intersects(t))if(this.options.noClip)this._parts=this._rings;else for(var i,e,n,o,s=this._parts,r=0,a=0,h=this._rings.length;r<h;r++)for(i=0,e=(o=this._rings[r]).length;i<e-1;i++)(n=Qi(o[i],o[i+1],t,i,!0))&&(s[a]=s[a]||[],s[a].push(n[0]),n[1]===o[i+1]&&i!==e-2||(s[a].push(n[1]),a++))},_simplifyPoints:function(){for(var t=this._parts,i=this.options.smoothFactor,e=0,n=t.length;e<n;e++)t[e]=Ji(t[e],i)},_update:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),this._updatePath())},_updatePath:function(){this._renderer._updatePoly(this)},_containsPoint:function(t,i){var e,n,o,s,r,a,h=this._clickTolerance();if(!this._pxBounds||!this._pxBounds.contains(t))return!1;for(e=0,s=this._parts.length;e<s;e++)for(n=0,o=(r=(a=this._parts[e]).length)-1;n<r;o=n++)if((i||0!==n)&&$i(t,a[o],a[n])<=h)return!0;return!1}});fe._flat=oe;var ge=fe.extend({options:{fill:!0},isEmpty:function(){return!this._latlngs.length||!this._latlngs[0].length},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");var t,i,e,n,o,s,r,a,h,l=this._rings[0],u=l.length;if(!u)return null;for(t=s=r=a=0,i=u-1;t<u;i=t++)e=l[t],n=l[i],o=e.y*n.x-n.y*e.x,r+=(e.x+n.x)*o,a+=(e.y+n.y)*o,s+=3*o;return h=0===s?l[0]:[r/s,a/s],this._map.layerPointToLatLng(h)},_convertLatLngs:function(t){var t=fe.prototype._convertLatLngs.call(this,t),i=t.length;return 2<=i&&t[0]instanceof v&&t[0].equals(t[i-1])&&t.pop(),t},_setLatLngs:function(t){fe.prototype._setLatLngs.call(this,t),ne(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return(ne(this._latlngs[0])?this._latlngs:this._latlngs[0])[0]},_clipPoints:function(){var t=this._renderer._bounds,i=this.options.weight,i=new p(i,i),t=new m(t.min.subtract(i),t.max.add(i));if(this._parts=[],this._pxBounds&&this._pxBounds.intersects(t))if(this.options.noClip)this._parts=this._rings;else for(var e,n=0,o=this._rings.length;n<o;n++)(e=se(this._rings[n],t,!0)).length&&this._parts.push(e)},_updatePath:function(){this._renderer._updatePoly(this,!0)},_containsPoint:function(t){var i,e,n,o,s,r,a,h,l=!1;if(!this._pxBounds||!this._pxBounds.contains(t))return!1;for(o=0,a=this._parts.length;o<a;o++)for(s=0,r=(h=(i=this._parts[o]).length)-1;s<h;r=s++)e=i[s],n=i[r],e.y>t.y!=n.y>t.y&&t.x<(n.x-e.x)*(t.y-e.y)/(n.y-e.y)+e.x&&(l=!l);return l||fe.prototype._containsPoint.call(this,t,!0)}});var ve=he.extend({initialize:function(t,i){c(this,i),this._layers={},t&&this.addData(t)},addData:function(t){var i,e,n,o=d(t)?t:t.features;if(o){for(i=0,e=o.length;i<e;i++)((n=o[i]).geometries||n.geometry||n.features||n.coordinates)&&this.addData(n);return this}var s=this.options;if(s.filter&&!s.filter(t))return this;var r=ye(t,s);return r?(r.feature=ze(t),r.defaultOptions=r.options,this.resetStyle(r),s.onEachFeature&&s.onEachFeature(t,r),this.addLayer(r)):this},resetStyle:function(t){return void 0===t?this.eachLayer(this.resetStyle,this):(t.options=l({},t.defaultOptions),this._setLayerStyle(t,this.options.style),this)},setStyle:function(i){return this.eachLayer(function(t){this._setLayerStyle(t,i)},this)},_setLayerStyle:function(t,i){t.setStyle&&("function"==typeof i&&(i=i(t.feature)),t.setStyle(i))}});function ye(t,i){var e,n,o,s,r="Feature"===t.type?t.geometry:t,a=r?r.coordinates:null,h=[],l=i&&i.pointToLayer,u=i&&i.coordsToLatLng||we;if(!a&&!r)return null;switch(r.type){case"Point":return xe(l,t,e=u(a),i);case"MultiPoint":for(o=0,s=a.length;o<s;o++)e=u(a[o]),h.push(xe(l,t,e,i));return new he(h);case"LineString":case"MultiLineString":return n=Pe(a,"LineString"===r.type?0:1,u),new fe(n,i);case"Polygon":case"MultiPolygon":return n=Pe(a,"Polygon"===r.type?1:2,u),new ge(n,i);case"GeometryCollection":for(o=0,s=r.geometries.length;o<s;o++){var c=ye({geometry:r.geometries[o],type:"Feature",properties:t.properties},i);c&&h.push(c)}return new he(h);default:throw new Error("Invalid GeoJSON object.")}}function xe(t,i,e,n){return t?t(i,e):new de(e,n&&n.markersInheritOptions&&n)}function we(t){return new v(t[1],t[0],t[2])}function Pe(t,i,e){for(var n,o=[],s=0,r=t.length;s<r;s++)n=i?Pe(t[s],i-1,e):(e||we)(t[s]),o.push(n);return o}function be(t,i){return void 0!==(t=w(t)).alt?[e(t.lng,i),e(t.lat,i),e(t.alt,i)]:[e(t.lng,i),e(t.lat,i)]}function Le(t,i,e,n){for(var o=[],s=0,r=t.length;s<r;s++)o.push(i?Le(t[s],i-1,e,n):be(t[s],n));return!i&&e&&o.push(o[0]),o}function Te(t,i){return t.feature?l({},t.feature,{geometry:i}):ze(i)}function ze(t){return"Feature"===t.type||"FeatureCollection"===t.type?t:{type:"Feature",properties:{},geometry:t}}Tt={toGeoJSON:function(t){return Te(this,{type:"Point",coordinates:be(this.getLatLng(),t)})}};function Me(t,i){return new ve(t,i)}de.include(Tt),me.include(Tt),pe.include(Tt),fe.include({toGeoJSON:function(t){var i=!ne(this._latlngs);return Te(this,{type:(i?"Multi":"")+"LineString",coordinates:Le(this._latlngs,i?1:0,!1,t)})}}),ge.include({toGeoJSON:function(t){var i=!ne(this._latlngs),e=i&&!ne(this._latlngs[0]),t=Le(this._latlngs,e?2:i?1:0,!0,t);return Te(this,{type:(e?"Multi":"")+"Polygon",coordinates:t=i?t:[t]})}}),ae.include({toMultiPoint:function(i){var e=[];return this.eachLayer(function(t){e.push(t.toGeoJSON(i).geometry.coordinates)}),Te(this,{type:"MultiPoint",coordinates:e})},toGeoJSON:function(i){var t=this.feature&&this.feature.geometry&&this.feature.geometry.type;if("MultiPoint"===t)return this.toMultiPoint(i);var e="GeometryCollection"===t,n=[];return this.eachLayer(function(t){t.toGeoJSON&&(t=t.toGeoJSON(i),e?n.push(t.geometry):"FeatureCollection"===(t=ze(t)).type?n.push.apply(n,t.features):n.push(t))}),e?Te(this,{geometries:n,type:"GeometryCollection"}):{type:"FeatureCollection",features:n}}});var zt=Me,Ce=o.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(t,i,e){this._url=t,this._bounds=g(i),c(this,e)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(z(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){T(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(t){return this.options.opacity=t,this._image&&this._updateOpacity(),this},setStyle:function(t){return t.opacity&&this.setOpacity(t.opacity),this},bringToFront:function(){return this._map&&fi(this._image),this},bringToBack:function(){return this._map&&gi(this._image),this},setUrl:function(t){return this._url=t,this._image&&(this._image.src=t),this},setBounds:function(t){return this._bounds=g(t),this._map&&this._reset(),this},getEvents:function(){var t={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var t="IMG"===this._url.tagName,i=this._image=t?this._url:b("img");z(i,"leaflet-image-layer"),this._zoomAnimated&&z(i,"leaflet-zoom-animated"),this.options.className&&z(i,this.options.className),i.onselectstart=u,i.onmousemove=u,i.onload=a(this.fire,this,"load"),i.onerror=a(this._overlayOnError,this,"error"),!this.options.crossOrigin&&""!==this.options.crossOrigin||(i.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),t?this._url=i.src:(i.src=this._url,i.alt=this.options.alt)},_animateZoom:function(t){var i=this._map.getZoomScale(t.zoom),t=this._map._latLngBoundsToNewLayerBounds(this._bounds,t.zoom,t.center).min;Pi(this._image,t,i)},_reset:function(){var t=this._image,i=new m(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),e=i.getSize();Z(t,i.min),t.style.width=e.x+"px",t.style.height=e.y+"px"},_updateOpacity:function(){C(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&void 0!==this.options.zIndex&&null!==this.options.zIndex&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var t=this.options.errorOverlayUrl;t&&this._url!==t&&(this._url=t,this._image.src=t)},getCenter:function(){return this._bounds.getCenter()}}),Ze=Ce.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInline:!0},_initImage:function(){var t="VIDEO"===this._url.tagName,i=this._image=t?this._url:b("video");if(z(i,"leaflet-image-layer"),this._zoomAnimated&&z(i,"leaflet-zoom-animated"),this.options.className&&z(i,this.options.className),i.onselectstart=u,i.onmousemove=u,i.onloadeddata=a(this.fire,this,"load"),t){for(var e=i.getElementsByTagName("source"),n=[],o=0;o<e.length;o++)n.push(e[o].src);this._url=0<e.length?n:[i.src]}else{d(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(i.style,"objectFit")&&(i.style.objectFit="fill"),i.autoplay=!!this.options.autoplay,i.loop=!!this.options.loop,i.muted=!!this.options.muted,i.playsInline=!!this.options.playsInline;for(var s=0;s<this._url.length;s++){var r=b("source");r.src=this._url[s],i.appendChild(r)}}}});var Se=Ce.extend({_initImage:function(){var t=this._image=this._url;z(t,"leaflet-image-layer"),this._zoomAnimated&&z(t,"leaflet-zoom-animated"),this.options.className&&z(t,this.options.className),t.onselectstart=u,t.onmousemove=u}});var O=o.extend({options:{interactive:!1,offset:[0,0],className:"",pane:void 0},initialize:function(t,i){c(this,t),this._source=i},openOn:function(t){return(t=arguments.length?t:this._source._map).hasLayer(this)||t.addLayer(this),this},close:function(){return this._map&&this._map.removeLayer(this),this},toggle:function(t){return this._map?this.close():(arguments.length?this._source=t:t=this._source,this._prepareOpen(),this.openOn(t._map)),this},onAdd:function(t){this._zoomAnimated=t._zoomAnimated,this._container||this._initLayout(),t._fadeAnimated&&C(this._container,0),clearTimeout(this._removeTimeout),this.getPane().appendChild(this._container),this.update(),t._fadeAnimated&&C(this._container,1),this.bringToFront(),this.options.interactive&&(z(this._container,"leaflet-interactive"),this.addInteractiveTarget(this._container))},onRemove:function(t){t._fadeAnimated?(C(this._container,0),this._removeTimeout=setTimeout(a(T,void 0,this._container),200)):T(this._container),this.options.interactive&&(M(this._container,"leaflet-interactive"),this.removeInteractiveTarget(this._container))},getLatLng:function(){return this._latlng},setLatLng:function(t){return this._latlng=w(t),this._map&&(this._updatePosition(),this._adjustPan()),this},getContent:function(){return this._content},setContent:function(t){return this._content=t,this.update(),this},getElement:function(){return this._container},update:function(){this._map&&(this._container.style.visibility="hidden",this._updateContent(),this._updateLayout(),this._updatePosition(),this._container.style.visibility="",this._adjustPan())},getEvents:function(){var t={zoom:this._updatePosition,viewreset:this._updatePosition};return this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},isOpen:function(){return!!this._map&&this._map.hasLayer(this)},bringToFront:function(){return this._map&&fi(this._container),this},bringToBack:function(){return this._map&&gi(this._container),this},_prepareOpen:function(t){if(!(e=this._source)._map)return!1;if(e instanceof he){var i,e=null,n=this._source._layers;for(i in n)if(n[i]._map){e=n[i];break}if(!e)return!1;this._source=e}if(!t)if(e.getCenter)t=e.getCenter();else if(e.getLatLng)t=e.getLatLng();else{if(!e.getBounds)throw new Error("Unable to get source layer LatLng.");t=e.getBounds().getCenter()}return this.setLatLng(t),this._map&&this.update(),!0},_updateContent:function(){if(this._content){var t=this._contentNode,i="function"==typeof this._content?this._content(this._source||this):this._content;if("string"==typeof i)t.innerHTML=i;else{for(;t.hasChildNodes();)t.removeChild(t.firstChild);t.appendChild(i)}this.fire("contentupdate")}},_updatePosition:function(){var t,i,e;this._map&&(i=this._map.latLngToLayerPoint(this._latlng),t=_(this.options.offset),e=this._getAnchor(),this._zoomAnimated?Z(this._container,i.add(e)):t=t.add(i).add(e),i=this._containerBottom=-t.y,e=this._containerLeft=-Math.round(this._containerWidth/2)+t.x,this._container.style.bottom=i+"px",this._container.style.left=e+"px")},_getAnchor:function(){return[0,0]}}),ke=(A.include({_initOverlay:function(t,i,e,n){var o=i;return o instanceof t||(o=new t(n).setContent(i)),e&&o.setLatLng(e),o}}),o.include({_initOverlay:function(t,i,e,n){var o=e;return o instanceof t?(c(o,n),o._source=this):(o=i&&!n?i:new t(n,this)).setContent(e),o}}),O.extend({options:{pane:"popupPane",offset:[0,7],maxWidth:300,minWidth:50,maxHeight:null,autoPan:!0,autoPanPaddingTopLeft:null,autoPanPaddingBottomRight:null,autoPanPadding:[5,5],keepInView:!1,closeButton:!0,autoClose:!0,closeOnEscapeKey:!0,className:""},openOn:function(t){return!(t=arguments.length?t:this._source._map).hasLayer(this)&&t._popup&&t._popup.options.autoClose&&t.removeLayer(t._popup),t._popup=this,O.prototype.openOn.call(this,t)},onAdd:function(t){O.prototype.onAdd.call(this,t),t.fire("popupopen",{popup:this}),this._source&&(this._source.fire("popupopen",{popup:this},!0),this._source instanceof _e||this._source.on("preclick",Ai))},onRemove:function(t){O.prototype.onRemove.call(this,t),t.fire("popupclose",{popup:this}),this._source&&(this._source.fire("popupclose",{popup:this},!0),this._source instanceof _e||this._source.off("preclick",Ai))},getEvents:function(){var t=O.prototype.getEvents.call(this);return(void 0!==this.options.closeOnClick?this.options.closeOnClick:this._map.options.closePopupOnClick)&&(t.preclick=this.close),this.options.keepInView&&(t.moveend=this._adjustPan),t},_initLayout:function(){var t="leaflet-popup",i=this._container=b("div",t+" "+(this.options.className||"")+" leaflet-zoom-animated"),e=this._wrapper=b("div",t+"-content-wrapper",i);this._contentNode=b("div",t+"-content",e),Oi(i),Ii(this._contentNode),S(i,"contextmenu",Ai),this._tipContainer=b("div",t+"-tip-container",i),this._tip=b("div",t+"-tip",this._tipContainer),this.options.closeButton&&((e=this._closeButton=b("a",t+"-close-button",i)).setAttribute("role","button"),e.setAttribute("aria-label","Close popup"),e.href="#close",e.innerHTML='<span aria-hidden="true">&#215;</span>',S(e,"click",this.close,this))},_updateLayout:function(){var t=this._contentNode,i=t.style,e=(i.width="",i.whiteSpace="nowrap",t.offsetWidth),e=Math.min(e,this.options.maxWidth),e=(e=Math.max(e,this.options.minWidth),i.width=e+1+"px",i.whiteSpace="",i.height="",t.offsetHeight),n=this.options.maxHeight,o="leaflet-popup-scrolled";n&&n<e?(i.height=n+"px",z(t,o)):M(t,o),this._containerWidth=this._container.offsetWidth},_animateZoom:function(t){var t=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center),i=this._getAnchor();Z(this._container,t.add(i))},_adjustPan:function(t){var i,e,n,o,s,r,a,h;this.options.autoPan&&(this._map._panAnim&&this._map._panAnim.stop(),i=this._map,e=parseInt(pi(this._container,"marginBottom"),10)||0,e=this._container.offsetHeight+e,h=this._containerWidth,(n=new p(this._containerLeft,-e-this._containerBottom))._add(bi(this._container)),n=i.layerPointToContainerPoint(n),s=_(this.options.autoPanPadding),o=_(this.options.autoPanPaddingTopLeft||s),s=_(this.options.autoPanPaddingBottomRight||s),r=i.getSize(),a=0,n.x+h+s.x>r.x&&(a=n.x+h-r.x+s.x),n.x-a-o.x<(h=0)&&(a=n.x-o.x),n.y+e+s.y>r.y&&(h=n.y+e-r.y+s.y),n.y-h-o.y<0&&(h=n.y-o.y),(a||h)&&i.fire("autopanstart").panBy([a,h],{animate:t&&"moveend"===t.type}))},_getAnchor:function(){return _(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}})),Ee=(A.mergeOptions({closePopupOnClick:!0}),A.include({openPopup:function(t,i,e){return this._initOverlay(ke,t,i,e).openOn(this),this},closePopup:function(t){return(t=arguments.length?t:this._popup)&&t.close(),this}}),o.include({bindPopup:function(t,i){return this._popup=this._initOverlay(ke,this._popup,t,i),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(t){return this._popup&&this._popup._prepareOpen(t)&&this._popup.openOn(this._map),this},closePopup:function(){return this._popup&&this._popup.close(),this},togglePopup:function(){return this._popup&&this._popup.toggle(this),this},isPopupOpen:function(){return!!this._popup&&this._popup.isOpen()},setPopupContent:function(t){return this._popup&&this._popup.setContent(t),this},getPopup:function(){return this._popup},_openPopup:function(t){var i;this._popup&&this._map&&(Ri(t),i=t.layer||t.target,this._popup._source!==i||i instanceof _e?(this._popup._source=i,this.openPopup(t.latlng)):this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(t.latlng))},_movePopup:function(t){this._popup.setLatLng(t.latlng)},_onKeyPress:function(t){13===t.originalEvent.keyCode&&this._openPopup(t)}}),O.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(t){O.prototype.onAdd.call(this,t),this.setOpacity(this.options.opacity),t.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(t){O.prototype.onRemove.call(this,t),t.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var t=O.prototype.getEvents.call(this);return this.options.permanent||(t.preclick=this.close),t},_initLayout:function(){var t="leaflet-tooltip "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=b("div",t)},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(t){var i,e=this._map,n=this._container,o=e.latLngToContainerPoint(e.getCenter()),e=e.layerPointToContainerPoint(t),s=this.options.direction,r=n.offsetWidth,a=n.offsetHeight,h=_(this.options.offset),l=this._getAnchor(),e="top"===s?(i=r/2,a):"bottom"===s?(i=r/2,0):(i="center"===s?r/2:"right"===s?0:"left"===s?r:e.x<o.x?(s="right",0):(s="left",r+2*(h.x+l.x)),a/2);t=t.subtract(_(i,e,!0)).add(h).add(l),M(n,"leaflet-tooltip-right"),M(n,"leaflet-tooltip-left"),M(n,"leaflet-tooltip-top"),M(n,"leaflet-tooltip-bottom"),z(n,"leaflet-tooltip-"+s),Z(n,t)},_updatePosition:function(){var t=this._map.latLngToLayerPoint(this._latlng);this._setPosition(t)},setOpacity:function(t){this.options.opacity=t,this._container&&C(this._container,t)},_animateZoom:function(t){t=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center);this._setPosition(t)},_getAnchor:function(){return _(this._source&&this._source._getTooltipAnchor&&!this.options.sticky?this._source._getTooltipAnchor():[0,0])}})),Be=(A.include({openTooltip:function(t,i,e){return this._initOverlay(Ee,t,i,e).openOn(this),this},closeTooltip:function(t){return t.close(),this}}),o.include({bindTooltip:function(t,i){return this._tooltip&&this.isTooltipOpen()&&this.unbindTooltip(),this._tooltip=this._initOverlay(Ee,this._tooltip,t,i),this._initTooltipInteractions(),this._tooltip.options.permanent&&this._map&&this._map.hasLayer(this)&&this.openTooltip(),this},unbindTooltip:function(){return this._tooltip&&(this._initTooltipInteractions(!0),this.closeTooltip(),this._tooltip=null),this},_initTooltipInteractions:function(t){var i,e;!t&&this._tooltipHandlersAdded||(i=t?"off":"on",e={remove:this.closeTooltip,move:this._moveTooltip},this._tooltip.options.permanent?e.add=this._openTooltip:(e.mouseover=this._openTooltip,e.mouseout=this.closeTooltip,e.click=this._openTooltip),this._tooltip.options.sticky&&(e.mousemove=this._moveTooltip),this[i](e),this._tooltipHandlersAdded=!t)},openTooltip:function(t){return this._tooltip&&this._tooltip._prepareOpen(t)&&this._tooltip.openOn(this._map),this},closeTooltip:function(){if(this._tooltip)return this._tooltip.close()},toggleTooltip:function(){return this._tooltip&&this._tooltip.toggle(this),this},isTooltipOpen:function(){return this._tooltip.isOpen()},setTooltipContent:function(t){return this._tooltip&&this._tooltip.setContent(t),this},getTooltip:function(){return this._tooltip},_openTooltip:function(t){!this._tooltip||!this._map||this._map.dragging&&this._map.dragging.moving()||(this._tooltip._source=t.layer||t.target,this.openTooltip(this._tooltip.options.sticky?t.latlng:void 0))},_moveTooltip:function(t){var i=t.latlng;this._tooltip.options.sticky&&t.originalEvent&&(t=this._map.mouseEventToContainerPoint(t.originalEvent),t=this._map.containerPointToLayerPoint(t),i=this._map.layerPointToLatLng(t)),this._tooltip.setLatLng(i)}}),le.extend({options:{iconSize:[12,12],html:!1,bgPos:null,className:"leaflet-div-icon"},createIcon:function(t){var t=t&&"DIV"===t.tagName?t:document.createElement("div"),i=this.options;return i.html instanceof Element?(mi(t),t.appendChild(i.html)):t.innerHTML=!1!==i.html?i.html:"",i.bgPos&&(i=_(i.bgPos),t.style.backgroundPosition=-i.x+"px "+-i.y+"px"),this._setIconStyles(t,"icon"),t},createShadow:function(){return null}}));le.Default=ue;var Ae=o.extend({options:{tileSize:256,opacity:1,updateWhenIdle:P.mobile,updateWhenZooming:!0,updateInterval:200,zIndex:1,bounds:null,minZoom:0,maxZoom:void 0,maxNativeZoom:void 0,minNativeZoom:void 0,noWrap:!1,pane:"tilePane",className:"",keepBuffer:2},initialize:function(t){c(this,t)},onAdd:function(){this._initContainer(),this._levels={},this._tiles={},this._resetView()},beforeAdd:function(t){t._addZoomLimit(this)},onRemove:function(t){this._removeAllTiles(),T(this._container),t._removeZoomLimit(this),this._container=null,this._tileZoom=void 0},bringToFront:function(){return this._map&&(fi(this._container),this._setAutoZIndex(Math.max)),this},bringToBack:function(){return this._map&&(gi(this._container),this._setAutoZIndex(Math.min)),this},getContainer:function(){return this._container},setOpacity:function(t){return this.options.opacity=t,this._updateOpacity(),this},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},isLoading:function(){return this._loading},redraw:function(){var t;return this._map&&(this._removeAllTiles(),(t=this._clampZoom(this._map.getZoom()))!==this._tileZoom&&(this._tileZoom=t,this._updateLevels()),this._update()),this},getEvents:function(){var t={viewprereset:this._invalidateAll,viewreset:this._resetView,zoom:this._resetView,moveend:this._onMoveEnd};return this.options.updateWhenIdle||(this._onMove||(this._onMove=j(this._onMoveEnd,this.options.updateInterval,this)),t.move=this._onMove),this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},createTile:function(){return document.createElement("div")},getTileSize:function(){var t=this.options.tileSize;return t instanceof p?t:new p(t,t)},_updateZIndex:function(){this._container&&void 0!==this.options.zIndex&&null!==this.options.zIndex&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(t){for(var i,e=this.getPane().children,n=-t(-1/0,1/0),o=0,s=e.length;o<s;o++)i=e[o].style.zIndex,e[o]!==this._container&&i&&(n=t(n,+i));isFinite(n)&&(this.options.zIndex=n+t(-1,1),this._updateZIndex())},_updateOpacity:function(){if(this._map&&!P.ielt9){C(this._container,this.options.opacity);var t,i=+new Date,e=!1,n=!1;for(t in this._tiles){var o,s=this._tiles[t];s.current&&s.loaded&&(o=Math.min(1,(i-s.loaded)/200),C(s.el,o),o<1?e=!0:(s.active?n=!0:this._onOpaqueTile(s),s.active=!0))}n&&!this._noPrune&&this._pruneTiles(),e&&(r(this._fadeFrame),this._fadeFrame=x(this._updateOpacity,this))}},_onOpaqueTile:u,_initContainer:function(){this._container||(this._container=b("div","leaflet-layer "+(this.options.className||"")),this._updateZIndex(),this.options.opacity<1&&this._updateOpacity(),this.getPane().appendChild(this._container))},_updateLevels:function(){var t=this._tileZoom,i=this.options.maxZoom;if(void 0!==t){for(var e in this._levels)e=Number(e),this._levels[e].el.children.length||e===t?(this._levels[e].el.style.zIndex=i-Math.abs(t-e),this._onUpdateLevel(e)):(T(this._levels[e].el),this._removeTilesAtZoom(e),this._onRemoveLevel(e),delete this._levels[e]);var n=this._levels[t],o=this._map;return n||((n=this._levels[t]={}).el=b("div","leaflet-tile-container leaflet-zoom-animated",this._container),n.el.style.zIndex=i,n.origin=o.project(o.unproject(o.getPixelOrigin()),t).round(),n.zoom=t,this._setZoomTransform(n,o.getCenter(),o.getZoom()),u(n.el.offsetWidth),this._onCreateLevel(n)),this._level=n}},_onUpdateLevel:u,_onRemoveLevel:u,_onCreateLevel:u,_pruneTiles:function(){if(this._map){var t,i,e,n=this._map.getZoom();if(n>this.options.maxZoom||n<this.options.minZoom)this._removeAllTiles();else{for(t in this._tiles)(e=this._tiles[t]).retain=e.current;for(t in this._tiles)(e=this._tiles[t]).current&&!e.active&&(i=e.coords,this._retainParent(i.x,i.y,i.z,i.z-5)||this._retainChildren(i.x,i.y,i.z,i.z+2));for(t in this._tiles)this._tiles[t].retain||this._removeTile(t)}}},_removeTilesAtZoom:function(t){for(var i in this._tiles)this._tiles[i].coords.z===t&&this._removeTile(i)},_removeAllTiles:function(){for(var t in this._tiles)this._removeTile(t)},_invalidateAll:function(){for(var t in this._levels)T(this._levels[t].el),this._onRemoveLevel(Number(t)),delete this._levels[t];this._removeAllTiles(),this._tileZoom=void 0},_retainParent:function(t,i,e,n){var t=Math.floor(t/2),i=Math.floor(i/2),e=e-1,o=new p(+t,+i),o=(o.z=e,this._tileCoordsToKey(o)),o=this._tiles[o];return o&&o.active?o.retain=!0:(o&&o.loaded&&(o.retain=!0),n<e&&this._retainParent(t,i,e,n))},_retainChildren:function(t,i,e,n){for(var o=2*t;o<2*t+2;o++)for(var s=2*i;s<2*i+2;s++){var r=new p(o,s),r=(r.z=e+1,this._tileCoordsToKey(r)),r=this._tiles[r];r&&r.active?r.retain=!0:(r&&r.loaded&&(r.retain=!0),e+1<n&&this._retainChildren(o,s,e+1,n))}},_resetView:function(t){t=t&&(t.pinch||t.flyTo);this._setView(this._map.getCenter(),this._map.getZoom(),t,t)},_animateZoom:function(t){this._setView(t.center,t.zoom,!0,t.noUpdate)},_clampZoom:function(t){var i=this.options;return void 0!==i.minNativeZoom&&t<i.minNativeZoom?i.minNativeZoom:void 0!==i.maxNativeZoom&&i.maxNativeZoom<t?i.maxNativeZoom:t},_setView:function(t,i,e,n){var o=Math.round(i),o=void 0!==this.options.maxZoom&&o>this.options.maxZoom||void 0!==this.options.minZoom&&o<this.options.minZoom?void 0:this._clampZoom(o),s=this.options.updateWhenZooming&&o!==this._tileZoom;n&&!s||(this._tileZoom=o,this._abortLoading&&this._abortLoading(),this._updateLevels(),this._resetGrid(),void 0!==o&&this._update(t),e||this._pruneTiles(),this._noPrune=!!e),this._setZoomTransforms(t,i)},_setZoomTransforms:function(t,i){for(var e in this._levels)this._setZoomTransform(this._levels[e],t,i)},_setZoomTransform:function(t,i,e){var n=this._map.getZoomScale(e,t.zoom),i=t.origin.multiplyBy(n).subtract(this._map._getNewPixelOrigin(i,e)).round();P.any3d?Pi(t.el,i,n):Z(t.el,i)},_resetGrid:function(){var t=this._map,i=t.options.crs,e=this._tileSize=this.getTileSize(),n=this._tileZoom,o=this._map.getPixelWorldBounds(this._tileZoom);o&&(this._globalTileRange=this._pxBoundsToTileRange(o)),this._wrapX=i.wrapLng&&!this.options.noWrap&&[Math.floor(t.project([0,i.wrapLng[0]],n).x/e.x),Math.ceil(t.project([0,i.wrapLng[1]],n).x/e.y)],this._wrapY=i.wrapLat&&!this.options.noWrap&&[Math.floor(t.project([i.wrapLat[0],0],n).y/e.x),Math.ceil(t.project([i.wrapLat[1],0],n).y/e.y)]},_onMoveEnd:function(){this._map&&!this._map._animatingZoom&&this._update()},_getTiledPixelBounds:function(t){var i=this._map,e=i._animatingZoom?Math.max(i._animateToZoom,i.getZoom()):i.getZoom(),e=i.getZoomScale(e,this._tileZoom),t=i.project(t,this._tileZoom).floor(),i=i.getSize().divideBy(2*e);return new m(t.subtract(i),t.add(i))},_update:function(t){var i=this._map;if(i){var e=this._clampZoom(i.getZoom());if(void 0===t&&(t=i.getCenter()),void 0!==this._tileZoom){var n,i=this._getTiledPixelBounds(t),o=this._pxBoundsToTileRange(i),s=o.getCenter(),r=[],i=this.options.keepBuffer,a=new m(o.getBottomLeft().subtract([i,-i]),o.getTopRight().add([i,-i]));if(!(isFinite(o.min.x)&&isFinite(o.min.y)&&isFinite(o.max.x)&&isFinite(o.max.y)))throw new Error("Attempted to load an infinite number of tiles");for(n in this._tiles){var h=this._tiles[n].coords;h.z===this._tileZoom&&a.contains(new p(h.x,h.y))||(this._tiles[n].current=!1)}if(1<Math.abs(e-this._tileZoom))this._setView(t,e);else{for(var l=o.min.y;l<=o.max.y;l++)for(var u=o.min.x;u<=o.max.x;u++){var c,d=new p(u,l);d.z=this._tileZoom,this._isValidTile(d)&&((c=this._tiles[this._tileCoordsToKey(d)])?c.current=!0:r.push(d))}if(r.sort(function(t,i){return t.distanceTo(s)-i.distanceTo(s)}),0!==r.length){this._loading||(this._loading=!0,this.fire("loading"));for(var _=document.createDocumentFragment(),u=0;u<r.length;u++)this._addTile(r[u],_);this._level.el.appendChild(_)}}}}},_isValidTile:function(t){var i=this._map.options.crs;if(!i.infinite){var e=this._globalTileRange;if(!i.wrapLng&&(t.x<e.min.x||t.x>e.max.x)||!i.wrapLat&&(t.y<e.min.y||t.y>e.max.y))return!1}if(!this.options.bounds)return!0;i=this._tileCoordsToBounds(t);return g(this.options.bounds).overlaps(i)},_keyToBounds:function(t){return this._tileCoordsToBounds(this._keyToTileCoords(t))},_tileCoordsToNwSe:function(t){var i=this._map,e=this.getTileSize(),n=t.scaleBy(e),e=n.add(e);return[i.unproject(n,t.z),i.unproject(e,t.z)]},_tileCoordsToBounds:function(t){t=this._tileCoordsToNwSe(t),t=new s(t[0],t[1]);return t=this.options.noWrap?t:this._map.wrapLatLngBounds(t)},_tileCoordsToKey:function(t){return t.x+":"+t.y+":"+t.z},_keyToTileCoords:function(t){var t=t.split(":"),i=new p(+t[0],+t[1]);return i.z=+t[2],i},_removeTile:function(t){var i=this._tiles[t];i&&(T(i.el),delete this._tiles[t],this.fire("tileunload",{tile:i.el,coords:this._keyToTileCoords(t)}))},_initTile:function(t){z(t,"leaflet-tile");var i=this.getTileSize();t.style.width=i.x+"px",t.style.height=i.y+"px",t.onselectstart=u,t.onmousemove=u,P.ielt9&&this.options.opacity<1&&C(t,this.options.opacity)},_addTile:function(t,i){var e=this._getTilePos(t),n=this._tileCoordsToKey(t),o=this.createTile(this._wrapCoords(t),a(this._tileReady,this,t));this._initTile(o),this.createTile.length<2&&x(a(this._tileReady,this,t,null,o)),Z(o,e),this._tiles[n]={el:o,coords:t,current:!0},i.appendChild(o),this.fire("tileloadstart",{tile:o,coords:t})},_tileReady:function(t,i,e){i&&this.fire("tileerror",{error:i,tile:e,coords:t});var n=this._tileCoordsToKey(t);(e=this._tiles[n])&&(e.loaded=+new Date,this._map._fadeAnimated?(C(e.el,0),r(this._fadeFrame),this._fadeFrame=x(this._updateOpacity,this)):(e.active=!0,this._pruneTiles()),i||(z(e.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:e.el,coords:t})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),P.ielt9||!this._map._fadeAnimated?x(this._pruneTiles,this):setTimeout(a(this._pruneTiles,this),250)))},_getTilePos:function(t){return t.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(t){var i=new p(this._wrapX?H(t.x,this._wrapX):t.x,this._wrapY?H(t.y,this._wrapY):t.y);return i.z=t.z,i},_pxBoundsToTileRange:function(t){var i=this.getTileSize();return new m(t.min.unscaleBy(i).floor(),t.max.unscaleBy(i).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var t in this._tiles)if(!this._tiles[t].loaded)return!1;return!0}});var Ie=Ae.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(t,i){this._url=t,(i=c(this,i)).detectRetina&&P.retina&&0<i.maxZoom&&(i.tileSize=Math.floor(i.tileSize/2),i.zoomReverse?(i.zoomOffset--,i.minZoom++):(i.zoomOffset++,i.maxZoom--),i.minZoom=Math.max(0,i.minZoom)),"string"==typeof i.subdomains&&(i.subdomains=i.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(t,i){return this._url===t&&void 0===i&&(i=!0),this._url=t,i||this.redraw(),this},createTile:function(t,i){var e=document.createElement("img");return S(e,"load",a(this._tileOnLoad,this,i,e)),S(e,"error",a(this._tileOnError,this,i,e)),!this.options.crossOrigin&&""!==this.options.crossOrigin||(e.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),"string"==typeof this.options.referrerPolicy&&(e.referrerPolicy=this.options.referrerPolicy),e.alt="",e.setAttribute("role","presentation"),e.src=this.getTileUrl(t),e},getTileUrl:function(t){var i={r:P.retina?"@2x":"",s:this._getSubdomain(t),x:t.x,y:t.y,z:this._getZoomForUrl()};return this._map&&!this._map.options.crs.infinite&&(t=this._globalTileRange.max.y-t.y,this.options.tms&&(i.y=t),i["-y"]=t),q(this._url,l(i,this.options))},_tileOnLoad:function(t,i){P.ielt9?setTimeout(a(t,this,null,i),0):t(null,i)},_tileOnError:function(t,i,e){var n=this.options.errorTileUrl;n&&i.getAttribute("src")!==n&&(i.src=n),t(e,i)},_onTileRemove:function(t){t.tile.onload=null},_getZoomForUrl:function(){var t=this._tileZoom,i=this.options.maxZoom;return(t=this.options.zoomReverse?i-t:t)+this.options.zoomOffset},_getSubdomain:function(t){t=Math.abs(t.x+t.y)%this.options.subdomains.length;return this.options.subdomains[t]},_abortLoading:function(){var t,i,e;for(t in this._tiles)this._tiles[t].coords.z!==this._tileZoom&&((e=this._tiles[t].el).onload=u,e.onerror=u,e.complete||(e.src=K,i=this._tiles[t].coords,T(e),delete this._tiles[t],this.fire("tileabort",{tile:e,coords:i})))},_removeTile:function(t){var i=this._tiles[t];if(i)return i.el.setAttribute("src",K),Ae.prototype._removeTile.call(this,t)},_tileReady:function(t,i,e){if(this._map&&(!e||e.getAttribute("src")!==K))return Ae.prototype._tileReady.call(this,t,i,e)}});function Oe(t,i){return new Ie(t,i)}var Re=Ie.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(t,i){this._url=t;var e,n=l({},this.defaultWmsParams);for(e in i)e in this.options||(n[e]=i[e]);var t=(i=c(this,i)).detectRetina&&P.retina?2:1,o=this.getTileSize();n.width=o.x*t,n.height=o.y*t,this.wmsParams=n},onAdd:function(t){this._crs=this.options.crs||t.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var i=1.3<=this._wmsVersion?"crs":"srs";this.wmsParams[i]=this._crs.code,Ie.prototype.onAdd.call(this,t)},getTileUrl:function(t){var i=this._tileCoordsToNwSe(t),e=this._crs,e=f(e.project(i[0]),e.project(i[1])),i=e.min,e=e.max,i=(1.3<=this._wmsVersion&&this._crs===re?[i.y,i.x,e.y,e.x]:[i.x,i.y,e.x,e.y]).join(","),e=Ie.prototype.getTileUrl.call(this,t);return e+U(this.wmsParams,e,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+i},setParams:function(t,i){return l(this.wmsParams,t),i||this.redraw(),this}});Ie.WMS=Re,Oe.wms=function(t,i){return new Re(t,i)};var Ne=o.extend({options:{padding:.1},initialize:function(t){c(this,t),h(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),this._zoomAnimated&&z(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var t={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(t.zoomanim=this._onAnimZoom),t},_onAnimZoom:function(t){this._updateTransform(t.center,t.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(t,i){var e=this._map.getZoomScale(i,this._zoom),n=this._map.getSize().multiplyBy(.5+this.options.padding),o=this._map.project(this._center,i),n=n.multiplyBy(-e).add(o).subtract(this._map._getNewPixelOrigin(t,i));P.any3d?Pi(this._container,n,e):Z(this._container,n)},_reset:function(){for(var t in this._update(),this._updateTransform(this._center,this._zoom),this._layers)this._layers[t]._reset()},_onZoomEnd:function(){for(var t in this._layers)this._layers[t]._project()},_updatePaths:function(){for(var t in this._layers)this._layers[t]._update()},_update:function(){var t=this.options.padding,i=this._map.getSize(),e=this._map.containerPointToLayerPoint(i.multiplyBy(-t)).round();this._bounds=new m(e,e.add(i.multiplyBy(1+2*t)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),De=Ne.extend({options:{tolerance:0},getEvents:function(){var t=Ne.prototype.getEvents.call(this);return t.viewprereset=this._onViewPreReset,t},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){Ne.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var t=this._container=document.createElement("canvas");S(t,"mousemove",this._onMouseMove,this),S(t,"click dblclick mousedown mouseup contextmenu",this._onClick,this),S(t,"mouseout",this._handleMouseOut,this),t._leaflet_disable_events=!0,this._ctx=t.getContext("2d")},_destroyContainer:function(){r(this._redrawRequest),delete this._ctx,T(this._container),E(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){for(var t in this._redrawBounds=null,this._layers)this._layers[t]._update();this._redraw()}},_update:function(){var t,i,e,n;this._map._animatingZoom&&this._bounds||(Ne.prototype._update.call(this),t=this._bounds,i=this._container,e=t.getSize(),n=P.retina?2:1,Z(i,t.min),i.width=n*e.x,i.height=n*e.y,i.style.width=e.x+"px",i.style.height=e.y+"px",P.retina&&this._ctx.scale(2,2),this._ctx.translate(-t.min.x,-t.min.y),this.fire("update"))},_reset:function(){Ne.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(t){this._updateDashArray(t);t=(this._layers[h(t)]=t)._order={layer:t,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=t),this._drawLast=t,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(t){this._requestRedraw(t)},_removePath:function(t){var i=t._order,e=i.next,i=i.prev;e?e.prev=i:this._drawLast=i,i?i.next=e:this._drawFirst=e,delete t._order,delete this._layers[h(t)],this._requestRedraw(t)},_updatePath:function(t){this._extendRedrawBounds(t),t._project(),t._update(),this._requestRedraw(t)},_updateStyle:function(t){this._updateDashArray(t),this._requestRedraw(t)},_updateDashArray:function(t){if("string"==typeof t.options.dashArray){for(var i,e=t.options.dashArray.split(/[, ]+/),n=[],o=0;o<e.length;o++){if(i=Number(e[o]),isNaN(i))return;n.push(i)}t.options._dashArray=n}else t.options._dashArray=t.options.dashArray},_requestRedraw:function(t){this._map&&(this._extendRedrawBounds(t),this._redrawRequest=this._redrawRequest||x(this._redraw,this))},_extendRedrawBounds:function(t){var i;t._pxBounds&&(i=(t.options.weight||0)+1,this._redrawBounds=this._redrawBounds||new m,this._redrawBounds.extend(t._pxBounds.min.subtract([i,i])),this._redrawBounds.extend(t._pxBounds.max.add([i,i])))},_redraw:function(){this._redrawRequest=null,this._redrawBounds&&(this._redrawBounds.min._floor(),this._redrawBounds.max._ceil()),this._clear(),this._draw(),this._redrawBounds=null},_clear:function(){var t,i=this._redrawBounds;i?(t=i.getSize(),this._ctx.clearRect(i.min.x,i.min.y,t.x,t.y)):(this._ctx.save(),this._ctx.setTransform(1,0,0,1,0,0),this._ctx.clearRect(0,0,this._container.width,this._container.height),this._ctx.restore())},_draw:function(){var t,i,e=this._redrawBounds;this._ctx.save(),e&&(i=e.getSize(),this._ctx.beginPath(),this._ctx.rect(e.min.x,e.min.y,i.x,i.y),this._ctx.clip()),this._drawing=!0;for(var n=this._drawFirst;n;n=n.next)t=n.layer,(!e||t._pxBounds&&t._pxBounds.intersects(e))&&t._updatePath();this._drawing=!1,this._ctx.restore()},_updatePoly:function(t,i){if(this._drawing){var e,n,o,s,r=t._parts,a=r.length,h=this._ctx;if(a){for(h.beginPath(),e=0;e<a;e++){for(n=0,o=r[e].length;n<o;n++)s=r[e][n],h[n?"lineTo":"moveTo"](s.x,s.y);i&&h.closePath()}this._fillStroke(h,t)}}},_updateCircle:function(t){var i,e,n,o;this._drawing&&!t._empty()&&(i=t._point,e=this._ctx,n=Math.max(Math.round(t._radius),1),1!=(o=(Math.max(Math.round(t._radiusY),1)||n)/n)&&(e.save(),e.scale(1,o)),e.beginPath(),e.arc(i.x,i.y/o,n,0,2*Math.PI,!1),1!=o&&e.restore(),this._fillStroke(e,t))},_fillStroke:function(t,i){var e=i.options;e.fill&&(t.globalAlpha=e.fillOpacity,t.fillStyle=e.fillColor||e.color,t.fill(e.fillRule||"evenodd")),e.stroke&&0!==e.weight&&(t.setLineDash&&t.setLineDash(i.options&&i.options._dashArray||[]),t.globalAlpha=e.opacity,t.lineWidth=e.weight,t.strokeStyle=e.color,t.lineCap=e.lineCap,t.lineJoin=e.lineJoin,t.stroke())},_onClick:function(t){for(var i,e,n=this._map.mouseEventToLayerPoint(t),o=this._drawFirst;o;o=o.next)(i=o.layer).options.interactive&&i._containsPoint(n)&&(("click"===t.type||"preclick"===t.type)&&this._map._draggableMoved(i)||(e=i));this._fireEvent(!!e&&[e],t)},_onMouseMove:function(t){var i;!this._map||this._map.dragging.moving()||this._map._animatingZoom||(i=this._map.mouseEventToLayerPoint(t),this._handleMouseHover(t,i))},_handleMouseOut:function(t){var i=this._hoveredLayer;i&&(M(this._container,"leaflet-interactive"),this._fireEvent([i],t,"mouseout"),this._hoveredLayer=null,this._mouseHoverThrottled=!1)},_handleMouseHover:function(t,i){if(!this._mouseHoverThrottled){for(var e,n,o=this._drawFirst;o;o=o.next)(e=o.layer).options.interactive&&e._containsPoint(i)&&(n=e);n!==this._hoveredLayer&&(this._handleMouseOut(t),n&&(z(this._container,"leaflet-interactive"),this._fireEvent([n],t,"mouseover"),this._hoveredLayer=n)),this._fireEvent(!!this._hoveredLayer&&[this._hoveredLayer],t),this._mouseHoverThrottled=!0,setTimeout(a(function(){this._mouseHoverThrottled=!1},this),32)}},_fireEvent:function(t,i,e){this._map._fireDOMEvent(i,e||i.type,t)},_bringToFront:function(t){var i,e,n=t._order;n&&(i=n.next,e=n.prev,i&&((i.prev=e)?e.next=i:i&&(this._drawFirst=i),n.prev=this._drawLast,(this._drawLast.next=n).next=null,this._drawLast=n,this._requestRedraw(t)))},_bringToBack:function(t){var i,e,n=t._order;n&&(i=n.next,(e=n.prev)&&((e.next=i)?i.prev=e:e&&(this._drawLast=e),n.prev=null,n.next=this._drawFirst,this._drawFirst.prev=n,this._drawFirst=n,this._requestRedraw(t)))}});function je(t){return P.canvas?new De(t):null}var He=function(){try{return document.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(t){return document.createElement("<lvml:"+t+' class="lvml">')}}catch(t){}return function(t){return document.createElement("<"+t+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}(),Mt={_initContainer:function(){this._container=b("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(Ne.prototype._update.call(this),this.fire("update"))},_initPath:function(t){var i=t._container=He("shape");z(i,"leaflet-vml-shape "+(this.options.className||"")),i.coordsize="1 1",t._path=He("path"),i.appendChild(t._path),this._updateStyle(t),this._layers[h(t)]=t},_addPath:function(t){var i=t._container;this._container.appendChild(i),t.options.interactive&&t.addInteractiveTarget(i)},_removePath:function(t){var i=t._container;T(i),t.removeInteractiveTarget(i),delete this._layers[h(t)]},_updateStyle:function(t){var i=t._stroke,e=t._fill,n=t.options,o=t._container;o.stroked=!!n.stroke,o.filled=!!n.fill,n.stroke?(i=i||(t._stroke=He("stroke")),o.appendChild(i),i.weight=n.weight+"px",i.color=n.color,i.opacity=n.opacity,n.dashArray?i.dashStyle=d(n.dashArray)?n.dashArray.join(" "):n.dashArray.replace(/( *, *)/g," "):i.dashStyle="",i.endcap=n.lineCap.replace("butt","flat"),i.joinstyle=n.lineJoin):i&&(o.removeChild(i),t._stroke=null),n.fill?(e=e||(t._fill=He("fill")),o.appendChild(e),e.color=n.fillColor||n.color,e.opacity=n.fillOpacity):e&&(o.removeChild(e),t._fill=null)},_updateCircle:function(t){var i=t._point.round(),e=Math.round(t._radius),n=Math.round(t._radiusY||e);this._setPath(t,t._empty()?"M0 0":"AL "+i.x+","+i.y+" "+e+","+n+" 0,23592600")},_setPath:function(t,i){t._path.v=i},_bringToFront:function(t){fi(t._container)},_bringToBack:function(t){gi(t._container)}},We=P.vml?He:ct,Fe=Ne.extend({_initContainer:function(){this._container=We("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=We("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){T(this._container),E(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){var t,i,e;this._map._animatingZoom&&this._bounds||(Ne.prototype._update.call(this),i=(t=this._bounds).getSize(),e=this._container,this._svgSize&&this._svgSize.equals(i)||(this._svgSize=i,e.setAttribute("width",i.x),e.setAttribute("height",i.y)),Z(e,t.min),e.setAttribute("viewBox",[t.min.x,t.min.y,i.x,i.y].join(" ")),this.fire("update"))},_initPath:function(t){var i=t._path=We("path");t.options.className&&z(i,t.options.className),t.options.interactive&&z(i,"leaflet-interactive"),this._updateStyle(t),this._layers[h(t)]=t},_addPath:function(t){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(t._path),t.addInteractiveTarget(t._path)},_removePath:function(t){T(t._path),t.removeInteractiveTarget(t._path),delete this._layers[h(t)]},_updatePath:function(t){t._project(),t._update()},_updateStyle:function(t){var i=t._path,t=t.options;i&&(t.stroke?(i.setAttribute("stroke",t.color),i.setAttribute("stroke-opacity",t.opacity),i.setAttribute("stroke-width",t.weight),i.setAttribute("stroke-linecap",t.lineCap),i.setAttribute("stroke-linejoin",t.lineJoin),t.dashArray?i.setAttribute("stroke-dasharray",t.dashArray):i.removeAttribute("stroke-dasharray"),t.dashOffset?i.setAttribute("stroke-dashoffset",t.dashOffset):i.removeAttribute("stroke-dashoffset")):i.setAttribute("stroke","none"),t.fill?(i.setAttribute("fill",t.fillColor||t.color),i.setAttribute("fill-opacity",t.fillOpacity),i.setAttribute("fill-rule",t.fillRule||"evenodd")):i.setAttribute("fill","none"))},_updatePoly:function(t,i){this._setPath(t,dt(t._parts,i))},_updateCircle:function(t){var i=t._point,e=Math.max(Math.round(t._radius),1),n="a"+e+","+(Math.max(Math.round(t._radiusY),1)||e)+" 0 1,0 ",i=t._empty()?"M0 0":"M"+(i.x-e)+","+i.y+n+2*e+",0 "+n+2*-e+",0 ";this._setPath(t,i)},_setPath:function(t,i){t._path.setAttribute("d",i)},_bringToFront:function(t){fi(t._path)},_bringToBack:function(t){gi(t._path)}});function Ue(t){return P.svg||P.vml?new Fe(t):null}P.vml&&Fe.include(Mt),A.include({getRenderer:function(t){t=(t=t.options.renderer||this._getPaneRenderer(t.options.pane)||this.options.renderer||this._renderer)||(this._renderer=this._createRenderer());return this.hasLayer(t)||this.addLayer(t),t},_getPaneRenderer:function(t){if("overlayPane"===t||void 0===t)return!1;var i=this._paneRenderers[t];return void 0===i&&(i=this._createRenderer({pane:t}),this._paneRenderers[t]=i),i},_createRenderer:function(t){return this.options.preferCanvas&&je(t)||Ue(t)}});var Ve=ge.extend({initialize:function(t,i){ge.prototype.initialize.call(this,this._boundsToLatLngs(t),i)},setBounds:function(t){return this.setLatLngs(this._boundsToLatLngs(t))},_boundsToLatLngs:function(t){return[(t=g(t)).getSouthWest(),t.getNorthWest(),t.getNorthEast(),t.getSouthEast()]}});Fe.create=We,Fe.pointsToPath=dt,ve.geometryToLayer=ye,ve.coordsToLatLng=we,ve.coordsToLatLngs=Pe,ve.latLngToCoords=be,ve.latLngsToCoords=Le,ve.getFeature=Te,ve.asFeature=ze,A.mergeOptions({boxZoom:!0});var _t=n.extend({initialize:function(t){this._map=t,this._container=t._container,this._pane=t._panes.overlayPane,this._resetStateTimeout=0,t.on("unload",this._destroy,this)},addHooks:function(){S(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){E(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){T(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){0!==this._resetStateTimeout&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(t){if(!t.shiftKey||1!==t.which&&1!==t.button)return!1;this._clearDeferredResetState(),this._resetState(),ri(),Li(),this._startPoint=this._map.mouseEventToContainerPoint(t),S(document,{contextmenu:Ri,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(t){this._moved||(this._moved=!0,this._box=b("div","leaflet-zoom-box",this._container),z(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(t);var t=new m(this._point,this._startPoint),i=t.getSize();Z(this._box,t.min),this._box.style.width=i.x+"px",this._box.style.height=i.y+"px"},_finish:function(){this._moved&&(T(this._box),M(this._container,"leaflet-crosshair")),ai(),Ti(),E(document,{contextmenu:Ri,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(t){1!==t.which&&1!==t.button||(this._finish(),this._moved&&(this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(a(this._resetState,this),0),t=new s(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point)),this._map.fitBounds(t).fire("boxzoomend",{boxZoomBounds:t})))},_onKeyDown:function(t){27===t.keyCode&&(this._finish(),this._clearDeferredResetState(),this._resetState())}}),Ct=(A.addInitHook("addHandler","boxZoom",_t),A.mergeOptions({doubleClickZoom:!0}),n.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(t){var i=this._map,e=i.getZoom(),n=i.options.zoomDelta,e=t.originalEvent.shiftKey?e-n:e+n;"center"===i.options.doubleClickZoom?i.setZoom(e):i.setZoomAround(t.containerPoint,e)}})),Zt=(A.addInitHook("addHandler","doubleClickZoom",Ct),A.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0}),n.extend({addHooks:function(){var t;this._draggable||(t=this._map,this._draggable=new Xi(t._mapPane,t._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),t.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),t.on("zoomend",this._onZoomEnd,this),t.whenReady(this._onZoomEnd,this))),z(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){M(this._map._container,"leaflet-grab"),M(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var t,i=this._map;i._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity?(t=g(this._map.options.maxBounds),this._offsetLimit=f(this._map.latLngToContainerPoint(t.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(t.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))):this._offsetLimit=null,i.fire("movestart").fire("dragstart"),i.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(t){var i,e;this._map.options.inertia&&(i=this._lastTime=+new Date,e=this._lastPos=this._draggable._absPos||this._draggable._newPos,this._positions.push(e),this._times.push(i),this._prunePositions(i)),this._map.fire("move",t).fire("drag",t)},_prunePositions:function(t){for(;1<this._positions.length&&50<t-this._times[0];)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var t=this._map.getSize().divideBy(2),i=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=i.subtract(t).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(t,i){return t-(t-i)*this._viscosity},_onPreDragLimit:function(){var t,i;this._viscosity&&this._offsetLimit&&(t=this._draggable._newPos.subtract(this._draggable._startPos),i=this._offsetLimit,t.x<i.min.x&&(t.x=this._viscousLimit(t.x,i.min.x)),t.y<i.min.y&&(t.y=this._viscousLimit(t.y,i.min.y)),t.x>i.max.x&&(t.x=this._viscousLimit(t.x,i.max.x)),t.y>i.max.y&&(t.y=this._viscousLimit(t.y,i.max.y)),this._draggable._newPos=this._draggable._startPos.add(t))},_onPreDragWrap:function(){var t=this._worldWidth,i=Math.round(t/2),e=this._initialWorldOffset,n=this._draggable._newPos.x,o=(n-i+e)%t+i-e,n=(n+i+e)%t-i-e,t=Math.abs(o+e)<Math.abs(n+e)?o:n;this._draggable._absPos=this._draggable._newPos.clone(),this._draggable._newPos.x=t},_onDragEnd:function(t){var i,e,n,o,s=this._map,r=s.options,a=!r.inertia||t.noInertia||this._times.length<2;s.fire("dragend",t),a?s.fire("moveend"):(this._prunePositions(+new Date),t=this._lastPos.subtract(this._positions[0]),a=(this._lastTime-this._times[0])/1e3,i=r.easeLinearity,a=(t=t.multiplyBy(i/a)).distanceTo([0,0]),e=Math.min(r.inertiaMaxSpeed,a),t=t.multiplyBy(e/a),n=e/(r.inertiaDeceleration*i),(o=t.multiplyBy(-n/2).round()).x||o.y?(o=s._limitOffset(o,s.options.maxBounds),x(function(){s.panBy(o,{duration:n,easeLinearity:i,noMoveStart:!0,animate:!0})})):s.fire("moveend"))}})),St=(A.addInitHook("addHandler","dragging",Zt),A.mergeOptions({keyboard:!0,keyboardPanDelta:80}),n.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61,171],zoomOut:[189,109,54,173]},initialize:function(t){this._map=t,this._setPanDelta(t.options.keyboardPanDelta),this._setZoomDelta(t.options.zoomDelta)},addHooks:function(){var t=this._map._container;t.tabIndex<=0&&(t.tabIndex="0"),S(t,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.on({focus:this._addHooks,blur:this._removeHooks},this)},removeHooks:function(){this._removeHooks(),E(this._map._container,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.off({focus:this._addHooks,blur:this._removeHooks},this)},_onMouseDown:function(){var t,i,e;this._focused||(e=document.body,t=document.documentElement,i=e.scrollTop||t.scrollTop,e=e.scrollLeft||t.scrollLeft,this._map._container.focus(),window.scrollTo(e,i))},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanDelta:function(t){for(var i=this._panKeys={},e=this.keyCodes,n=0,o=e.left.length;n<o;n++)i[e.left[n]]=[-1*t,0];for(n=0,o=e.right.length;n<o;n++)i[e.right[n]]=[t,0];for(n=0,o=e.down.length;n<o;n++)i[e.down[n]]=[0,t];for(n=0,o=e.up.length;n<o;n++)i[e.up[n]]=[0,-1*t]},_setZoomDelta:function(t){for(var i=this._zoomKeys={},e=this.keyCodes,n=0,o=e.zoomIn.length;n<o;n++)i[e.zoomIn[n]]=t;for(n=0,o=e.zoomOut.length;n<o;n++)i[e.zoomOut[n]]=-t},_addHooks:function(){S(document,"keydown",this._onKeyDown,this)},_removeHooks:function(){E(document,"keydown",this._onKeyDown,this)},_onKeyDown:function(t){if(!(t.altKey||t.ctrlKey||t.metaKey)){var i,e=t.keyCode,n=this._map;if(e in this._panKeys)n._panAnim&&n._panAnim._inProgress||(i=this._panKeys[e],t.shiftKey&&(i=_(i).multiplyBy(3)),n.panBy(i),n.options.maxBounds&&n.panInsideBounds(n.options.maxBounds));else if(e in this._zoomKeys)n.setZoom(n.getZoom()+(t.shiftKey?3:1)*this._zoomKeys[e]);else{if(27!==e||!n._popup||!n._popup.options.closeOnEscapeKey)return;n.closePopup()}Ri(t)}}})),kt=(A.addInitHook("addHandler","keyboard",St),A.mergeOptions({scrollWheelZoom:!0,wheelDebounceTime:40,wheelPxPerZoomLevel:60}),n.extend({addHooks:function(){S(this._map._container,"wheel",this._onWheelScroll,this),this._delta=0},removeHooks:function(){E(this._map._container,"wheel",this._onWheelScroll,this)},_onWheelScroll:function(t){var i=ji(t),e=this._map.options.wheelDebounceTime,i=(this._delta+=i,this._lastMousePos=this._map.mouseEventToContainerPoint(t),this._startTime||(this._startTime=+new Date),Math.max(e-(+new Date-this._startTime),0));clearTimeout(this._timer),this._timer=setTimeout(a(this._performZoom,this),i),Ri(t)},_performZoom:function(){var t=this._map,i=t.getZoom(),e=this._map.options.zoomSnap||0,n=(t._stop(),this._delta/(4*this._map.options.wheelPxPerZoomLevel)),n=4*Math.log(2/(1+Math.exp(-Math.abs(n))))/Math.LN2,e=e?Math.ceil(n/e)*e:n,n=t._limitZoom(i+(0<this._delta?e:-e))-i;this._delta=0,this._startTime=null,n&&("center"===t.options.scrollWheelZoom?t.setZoom(i+n):t.setZoomAround(this._lastMousePos,i+n))}})),Et=(A.addInitHook("addHandler","scrollWheelZoom",kt),A.mergeOptions({tapHold:P.touchNative&&P.safari&&P.mobile,tapTolerance:15}),n.extend({addHooks:function(){S(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){E(this._map._container,"touchstart",this._onDown,this)},_onDown:function(t){var i;clearTimeout(this._holdTimeout),1===t.touches.length&&(i=t.touches[0],this._startPos=this._newPos=new p(i.clientX,i.clientY),this._holdTimeout=setTimeout(a(function(){this._cancel(),this._isTapValid()&&(S(document,"touchend",B),S(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",i))},this),600),S(document,"touchend touchcancel contextmenu",this._cancel,this),S(document,"touchmove",this._onMove,this))},_cancelClickPrevent:function t(){E(document,"touchend",B),E(document,"touchend touchcancel",t)},_cancel:function(){clearTimeout(this._holdTimeout),E(document,"touchend touchcancel contextmenu",this._cancel,this),E(document,"touchmove",this._onMove,this)},_onMove:function(t){t=t.touches[0];this._newPos=new p(t.clientX,t.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(t,i){t=new MouseEvent(t,{bubbles:!0,cancelable:!0,view:window,screenX:i.screenX,screenY:i.screenY,clientX:i.clientX,clientY:i.clientY});t._simulated=!0,i.target.dispatchEvent(t)}})),Bt=(A.addInitHook("addHandler","tapHold",Et),A.mergeOptions({touchZoom:P.touch,bounceAtZoomLimits:!0}),n.extend({addHooks:function(){z(this._map._container,"leaflet-touch-zoom"),S(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){M(this._map._container,"leaflet-touch-zoom"),E(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(t){var i,e,n=this._map;!t.touches||2!==t.touches.length||n._animatingZoom||this._zooming||(i=n.mouseEventToContainerPoint(t.touches[0]),e=n.mouseEventToContainerPoint(t.touches[1]),this._centerPoint=n.getSize()._divideBy(2),this._startLatLng=n.containerPointToLatLng(this._centerPoint),"center"!==n.options.touchZoom&&(this._pinchStartLatLng=n.containerPointToLatLng(i.add(e)._divideBy(2))),this._startDist=i.distanceTo(e),this._startZoom=n.getZoom(),this._moved=!1,this._zooming=!0,n._stop(),S(document,"touchmove",this._onTouchMove,this),S(document,"touchend touchcancel",this._onTouchEnd,this),B(t))},_onTouchMove:function(t){if(t.touches&&2===t.touches.length&&this._zooming){var i=this._map,e=i.mouseEventToContainerPoint(t.touches[0]),n=i.mouseEventToContainerPoint(t.touches[1]),o=e.distanceTo(n)/this._startDist;if(this._zoom=i.getScaleZoom(o,this._startZoom),!i.options.bounceAtZoomLimits&&(this._zoom<i.getMinZoom()&&o<1||this._zoom>i.getMaxZoom()&&1<o)&&(this._zoom=i._limitZoom(this._zoom)),"center"===i.options.touchZoom){if(this._center=this._startLatLng,1==o)return}else{e=e._add(n)._divideBy(2)._subtract(this._centerPoint);if(1==o&&0===e.x&&0===e.y)return;this._center=i.unproject(i.project(this._pinchStartLatLng,this._zoom).subtract(e),this._zoom)}this._moved||(i._moveStart(!0,!1),this._moved=!0),r(this._animRequest);n=a(i._move,i,this._center,this._zoom,{pinch:!0,round:!1});this._animRequest=x(n,this,!0),B(t)}},_onTouchEnd:function(){this._moved&&this._zooming?(this._zooming=!1,r(this._animRequest),E(document,"touchmove",this._onTouchMove,this),E(document,"touchend touchcancel",this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))):this._zooming=!1}})),qe=(A.addInitHook("addHandler","touchZoom",Bt),A.BoxZoom=_t,A.DoubleClickZoom=Ct,A.Drag=Zt,A.Keyboard=St,A.ScrollWheelZoom=kt,A.TapHold=Et,A.TouchZoom=Bt,t.Bounds=m,t.Browser=P,t.CRS=ot,t.Canvas=De,t.Circle=me,t.CircleMarker=pe,t.Class=it,t.Control=I,t.DivIcon=Be,t.DivOverlay=O,t.DomEvent=mt,t.DomUtil=pt,t.Draggable=Xi,t.Evented=et,t.FeatureGroup=he,t.GeoJSON=ve,t.GridLayer=Ae,t.Handler=n,t.Icon=le,t.ImageOverlay=Ce,t.LatLng=v,t.LatLngBounds=s,t.Layer=o,t.LayerGroup=ae,t.LineUtil=gt,t.Map=A,t.Marker=de,t.Mixin=ft,t.Path=_e,t.Point=p,t.PolyUtil=vt,t.Polygon=ge,t.Polyline=fe,t.Popup=ke,t.PosAnimation=Wi,t.Projection=wt,t.Rectangle=Ve,t.Renderer=Ne,t.SVG=Fe,t.SVGOverlay=Se,t.TileLayer=Ie,t.Tooltip=Ee,t.Transformation=at,t.Util=tt,t.VideoOverlay=Ze,t.bind=a,t.bounds=f,t.canvas=je,t.circle=function(t,i,e){return new me(t,i,e)},t.circleMarker=function(t,i){return new pe(t,i)},t.control=Fi,t.divIcon=function(t){return new Be(t)},t.extend=l,t.featureGroup=function(t,i){return new he(t,i)},t.geoJSON=Me,t.geoJson=zt,t.gridLayer=function(t){return new Ae(t)},t.icon=function(t){return new le(t)},t.imageOverlay=function(t,i,e){return new Ce(t,i,e)},t.latLng=w,t.latLngBounds=g,t.layerGroup=function(t,i){return new ae(t,i)},t.map=function(t,i){return new A(t,i)},t.marker=function(t,i){return new de(t,i)},t.point=_,t.polygon=function(t,i){return new ge(t,i)},t.polyline=function(t,i){return new fe(t,i)},t.popup=function(t,i){return new ke(t,i)},t.rectangle=function(t,i){return new Ve(t,i)},t.setOptions=c,t.stamp=h,t.svg=Ue,t.svgOverlay=function(t,i,e){return new Se(t,i,e)},t.tileLayer=Oe,t.tooltip=function(t,i){return new Ee(t,i)},t.transformation=ht,t.version="1.8.0",t.videoOverlay=function(t,i,e){return new Ze(t,i,e)},window.L);t.noConflict=function(){return window.L=qe,this},window.L=t});
//# sourceMappingURL=leaflet.js.map
!function (e, t) { "object" == typeof exports && "undefined" != typeof module ? t(exports) : "function" == typeof define && define.amd ? define(["exports"], t) : t((e = e || self)["leaflet-kmz"] = {}) }(this, (function (e) { "use strict"; function t(e) { return e["doc.kml"] ? "doc.kml" : function (e) { return e.filter((e => /.*\.kml/.test(e))) }(Object.keys(e))[0] } function o(e) { return e.split("/").pop() } function n(e) { return /\.(jpe?g|png|gif|bmp)$/i.test(e) } function i(e, t) { return t instanceof Promise ? t : Promise.all(e.map((e => function (e) { return new Promise(((t, o) => { let n = document.createElement("script"); n.addEventListener("load", t.bind(e), { once: !0 }), n.src = e, document.head.appendChild(n) })) }(e)))) } function r(e, t) { let [o, n] = function (e) { let t = L.latLngBounds([e.getElementsByTagName("south")[0].childNodes[0].nodeValue, e.getElementsByTagName("west")[0].childNodes[0].nodeValue], [e.getElementsByTagName("north")[0].childNodes[0].nodeValue, e.getElementsByTagName("east")[0].childNodes[0].nodeValue]), o = e.getElementsByTagName("rotation")[0]; return void 0 !== o && (o = parseFloat(o.childNodes[0].nodeValue)), [t, o] }(e.getElementsByTagName("LatLonBox")[0]), i = e.getElementsByTagName("href")[0], r = e.getElementsByTagName("color")[0], a = e.getElementsByTagName("Icon")[0], s = {}; return !i && a && (i = a.getElementsByTagName("href")[0]), i = i.childNodes[0].nodeValue, i = t.icons[i] || i, r && (r = r.childNodes[0].nodeValue, s.opacity = parseInt(r.substring(0, 2), 16) / 255, s.color = "#" + r.substring(6, 8) + r.substring(4, 6) + r.substring(2, 4)), n && (s.rotation = n), new L.KMZImageOverlay(i, o, { opacity: s.opacity, angle: s.rotation }) } function a(e) { var t = e; if (e instanceof ArrayBuffer) { var o = (t = new Uint8Array(e).reduce((function (e, t) { return e + String.fromCharCode(t) }), "")).substring(0, t.indexOf("?>")).match(/encoding\s*=\s*["'](.*)["']/i); o && (t = new TextDecoder(o[1]).decode(e)) } return t ? (new DOMParser).parseFromString(t, "text/xml") : document.implementation.createDocument(null, "kml") } const s = L.KMZLayer = L.FeatureGroup.extend({ options: { interactive: !0, ballon: !0, bindPopup: !0, bindTooltip: !0, preferCanvas: !1 }, initialize: function (e, t) { L.extend(this.options, t), L.Browser.mobile && (this.options.bindTooltip = !1), this._layers = {}, e && this.load(e) }, add: function (e) { this.load(e) }, load: function (e) { L.KMZLayer._jsPromise = i(this._requiredJSModules(), L.KMZLayer._jsPromise).then((() => this._load(e))) }, _load: function (e) { return function (e) { return new Promise(((t, o) => { let n = new XMLHttpRequest; n.open("GET", e), n.setRequestHeader("X-Requested-With", "XMLHttpRequest"), n.responseType = "arraybuffer", n.onload = () => { 4 !== n.readyState || 200 !== n.status && 0 !== n.status ? t("") : t(n.response || n.responseText) }, n.onerror = () => o("Error " + n.status + " while fetching remote file: " + e), n.send() })) }(e).then((t => this._parse(t, { name: o(e), icons: {} }))) }, _parse: function (e, t) { return o = e, "PK" === String.fromCharCode(new Uint8Array(o, 0, 1), new Uint8Array(o, 1, 1)) ? this._parseKMZ(e, t) : this._parseKML(e, t); var o }, _parseKMZ: function (e, o) { var i; (i = e, new Promise(((e, t) => { window.JSZip.loadAsync(i).then((t => { var o = Object.keys(t.files).map((e => { var o = t.files[e]; if (n(e)) { var i = e.split(".").pop().toLowerCase().replace("jpg", "jpeg"), r = function (e, t) { var o = "text/plain"; return /\.(jpe?g|png|gif|bmp)$/i.test(e) ? o = "image/" + t : /\.kml$/i.test(e) && (o = "text/plain"), o }(e, i); return o.async("base64").then((t => [e, "data:" + r + ";base64," + t])) } return o.async("text").then((t => [e, t])) })); Promise.all(o).then((t => e(t.reduce(((e, t) => (e[t[0]] = t[1], e)), {})))) })) }))).then((e => { var i = t(e), r = Object.keys(e).filter((e => n(e))), a = e[i]; o.icons = r.reduce(((t, o) => (t[o] = e[o], t)), {}), this._parseKML(a, o) })) }, _parseKML: function (e, t) { var o = a(e), n = function (e, t) { var o = e instanceof XMLDocument ? e : a(e), n = window.toGeoJSON.kml(o); return n.properties = L.extend({}, n.properties, t || {}), n }(o, t), i = (this.options.geometryToLayer || this._geometryToLayer).call(this, n, o); this.addLayer(i), this.fire("load", { layer: i, name: n.properties.name }) }, _geometryToLayer: function (e, t) { var o = this._map ? this._map.options.preferCanvas : this.options.preferCanvas, n = L.geoJson(e, { pointToLayer: (t, n) => o ? L.kmzMarker(n, { iconUrl: e.properties.icons[t.properties.icon] || t.properties.icon, iconSize: [28, 28], iconAnchor: [14, 14], interactive: this.options.interactive }) : L.marker(n, { icon: L.icon({ iconUrl: e.properties.icons[t.properties.icon] || t.properties.icon, iconSize: [28, 28], iconAnchor: [14, 14] }), interactive: this.options.interactive }), style: e => { var t = {}, o = e.properties; return o.stroke && (t.stroke = !0, t.color = o.stroke), o.fill && (t.fill = !0, t.fillColor = o.fill), o["stroke-opacity"] && (t.opacity = o["stroke-opacity"]), o["fill-opacity"] && (t.fillOpacity = o["fill-opacity"]), o["stroke-width"] && (t.weight = 1.05 * o["stroke-width"]), t }, onEachFeature: (e, t) => { if (this.options.ballon) { var o = e.properties, n = o.name || "", i = o.description || ""; (n || i) && (this.options.bindPopup && t.bindPopup("<div><b>" + n + "</b><br>" + i + "</div>"), this.options.bindTooltip && t.bindTooltip("<b>" + n + "</b>", { direction: "auto", sticky: !0 })) } }, interactive: this.options.interactive }); let i = t.getElementsByTagName("GroundOverlay"); for (let t, o = 0; o < i.length; o++)t = r(i[o], e.properties), t && n.addLayer(t); return n }, _requiredJSModules: function () { var e = [], t = "https://unpkg.com/"; return "function" != typeof window.JSZip && e.push(t + "jszip@3.5.0/dist/jszip.min.js"), "object" != typeof window.toGeoJSON && e.push(t + "@tmcw/togeojson@4.1.0/dist/togeojson.umd.js"), e } }); L.kmzLayer = function (e, t) { return new L.KMZLayer(e, t) }, L.KMZMarker = L.CircleMarker.extend({ _updatePath: function () { var e = this._renderer, t = this._icon, o = this; e._drawing && !o._empty() && (t ? t.drawImage() : ((t = this._icon = new Image(this.options.iconSize[0], this.options.iconSize[1])).anchor = [t.width / 2, t.height / 2], t.onload = t.drawImage = () => { var n = o._point.subtract(t.anchor); e._ctx.drawImage(t, n.x, n.y, t.width, t.height) }, t.src = this.options.iconUrl)) } }), L.kmzMarker = function (e, t) { return new L.KMZMarker(e, t) }; var c = L.KMZMarker; L.KMZImageOverlay = L.ImageOverlay.extend({ options: { angle: 0 }, _reset: function () { L.ImageOverlay.prototype._reset.call(this), this._rotate() }, _animateZoom: function (e) { L.ImageOverlay.prototype._animateZoom.call(this, e), this._rotate() }, _rotate: function () { if (L.DomUtil.TRANSFORM) this._image.style[L.DomUtil.TRANSFORM] += " rotate(" + this.options.angle + "deg)"; else if (L.Browser.ie) { var e = this.options.angle * (Math.PI / 180), t = Math.cos(e), o = Math.sin(e); this._image.style.filter += " progid:DXImageTransform.Microsoft.Matrix(sizingMethod='auto expand', M11=" + t + ", M12=" + -o + ", M21=" + o + ", M22=" + t + ")" } }, getBounds: function () { return this._bounds } }), e.KMZLayer = s, e.KMZMarker = c, Object.defineProperty(e, "__esModule", { value: !0 }) }));
//# sourceMappingURL=leaflet-kmz.js.map

(function(factory){var L;if(typeof define==="function"&&define.amd){define(["leaflet"],factory)}else if(typeof module!=="undefined"){L=require("leaflet");module.exports=factory(L)}else{if(typeof window.L==="undefined"){throw new Error("Leaflet must be loaded first")}factory(window.L)}})(function(L){L.Control.Fullscreen=L.Control.extend({options:{position:"topleft",title:{"false":"View Fullscreen","true":"Exit Fullscreen"}},onAdd:function(map){var container=L.DomUtil.create("div","leaflet-control-fullscreen leaflet-bar leaflet-control");this.link=L.DomUtil.create("a","leaflet-control-fullscreen-button leaflet-bar-part",container);this.link.href="#";this._map=map;this._map.on("fullscreenchange",this._toggleTitle,this);this._toggleTitle();L.DomEvent.on(this.link,"click",this._click,this);return container},_click:function(e){L.DomEvent.stopPropagation(e);L.DomEvent.preventDefault(e);this._map.toggleFullscreen(this.options)},_toggleTitle:function(){this.link.title=this.options.title[this._map.isFullscreen()]}});L.Map.include({isFullscreen:function(){return this._isFullscreen||false},toggleFullscreen:function(options){var container=this.getContainer();if(this.isFullscreen()){if(options&&options.pseudoFullscreen){this._disablePseudoFullscreen(container)}else if(document.exitFullscreen){document.exitFullscreen()}else if(document.mozCancelFullScreen){document.mozCancelFullScreen()}else if(document.webkitCancelFullScreen){document.webkitCancelFullScreen()}else if(document.msExitFullscreen){document.msExitFullscreen()}else{this._disablePseudoFullscreen(container)}}else{if(options&&options.pseudoFullscreen){this._enablePseudoFullscreen(container)}else if(container.requestFullscreen){container.requestFullscreen()}else if(container.mozRequestFullScreen){container.mozRequestFullScreen()}else if(container.webkitRequestFullscreen){container.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT)}else if(container.msRequestFullscreen){container.msRequestFullscreen()}else{this._enablePseudoFullscreen(container)}}},_enablePseudoFullscreen:function(container){L.DomUtil.addClass(container,"leaflet-pseudo-fullscreen");this._setFullscreen(true);this.fire("fullscreenchange")},_disablePseudoFullscreen:function(container){L.DomUtil.removeClass(container,"leaflet-pseudo-fullscreen");this._setFullscreen(false);this.fire("fullscreenchange")},_setFullscreen:function(fullscreen){this._isFullscreen=fullscreen;var container=this.getContainer();if(fullscreen){L.DomUtil.addClass(container,"leaflet-fullscreen-on")}else{L.DomUtil.removeClass(container,"leaflet-fullscreen-on")}this.invalidateSize()},_onFullscreenChange:function(e){var fullscreenElement=document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement||document.msFullscreenElement;if(fullscreenElement===this.getContainer()&&!this._isFullscreen){this._setFullscreen(true);this.fire("fullscreenchange")}else if(fullscreenElement!==this.getContainer()&&this._isFullscreen){this._setFullscreen(false);this.fire("fullscreenchange")}}});L.Map.mergeOptions({fullscreenControl:false});L.Map.addInitHook(function(){if(this.options.fullscreenControl){this.fullscreenControl=new L.Control.Fullscreen(this.options.fullscreenControl);this.addControl(this.fullscreenControl)}var fullscreenchange;if("onfullscreenchange"in document){fullscreenchange="fullscreenchange"}else if("onmozfullscreenchange"in document){fullscreenchange="mozfullscreenchange"}else if("onwebkitfullscreenchange"in document){fullscreenchange="webkitfullscreenchange"}else if("onmsfullscreenchange"in document){fullscreenchange="MSFullscreenChange"}if(fullscreenchange){var onFullscreenChange=L.bind(this._onFullscreenChange,this);this.whenReady(function(){L.DomEvent.on(document,fullscreenchange,onFullscreenChange)});this.on("unload",function(){L.DomEvent.off(document,fullscreenchange,onFullscreenChange)})}});L.control.fullscreen=function(options){return new L.Control.Fullscreen(options)}});
/*! Projeto OLHO VIVO SPTrans http://olhovivo.sptrans.com.br */
(function(n,t,i,r,u,f,e){n.GoogleAnalyticsObject=u;n[u]=n[u]||function(){(n[u].q=n[u].q||[]).push(arguments)};n[u].l=1*new Date;f=t.createElement(i);e=t.getElementsByTagName(i)[0];f.async=1;f.src=r;e.parentNode.insertBefore(f,e)})(window,document,"script","//www.google-analytics.com/analytics.js","ga");!function(){"use strict";var n=function(){var t,l="/",h="Content/theme/",a,e=!1,k=0,st=4,tt=32768,v=!1,y="Filtrar...",o="data/",rt='<div class="labelCategoria catA{AREA}"><div class="labelCategoriaItem"><span>{PREFIXO} às <b>{PREVISAO}<\/b><\/span><\/div><\/div>',ht='<div class="infoWindowVeiculo"><p><span>Código da parada:<\/span> {CODIGO}<\/p>{PARADA}<div id="veicAprox" class="prefixo">Veículos em aproximação: <b>{VEICULOS}<\/b><\/div><div class="link">{LINK}<\/div>',d=1e4,ct=5e4,u,p="",wt=document.location.protocol+"//"+document.location.hostname+l,it=!1,g=0,f=[],ut,ft,s,w,nt=L.canvas(),et="https://maps.sptrans.com.br/geoserver/SIM/wms",r={},lt=L.icon({iconUrl:h+"imagens/icones/posicaoUsuarioGPS.png"}),at=L.icon({iconUrl:h+"imagens/icones/posicaoParada.png",iconSize:[41,41],iconAnchor:[20,40]}),vt=L.divIcon({className:"bus-icon bus-icon-BC",iconAnchor:[20,20],iconSize:null,html:'<div class="bus-features">{f}<\/div><div class="inner"><i class="material-icons">directions_bus<\/i><\/div>'}),yt=L.divIcon({className:"bus-icon bus-icon-CB",iconAnchor:[20,20],iconSize:null,html:'<div class="bus-features">{f}<\/div><div class="inner"><i class="material-icons">directions_bus<\/i><\/div>'}),c={Linhas:o+"Linha/Buscar",LinhaSentido:o+"Linha/BuscarLinhaSentido",DetalhesLinha:o+"Linha/CarregarDetalhes",Paradas:o+"Parada/Buscar",ParadasPorCorredor:o+"Parada/BuscarParadasPorCorredor",Corredor:o+"Corredor",PosicaoLinha:o+"Posicao/Linha",Previsao:o+"Previsao",PrevisaoParada:o+"Previsao/Parada",PrevisaoLinha:o+"Previsao/Linha"},i={CONEXAO:1,UNAUTHORIZED:401},ot={LINHA:0},pt={NenhumVeiculoAproximando:"Não foi encontrado nenhum veículo em aproximação"},b;return r.todosLayers=L.layerGroup(),r.todosLayers.linhas=[],r.todosLayers.linhasLG=L.layerGroup(),r.todosLayers.carros=L.layerGroup(),r.layerOrigem=L.layerGroup(),r.layerOrigem.linhas=[],r.layerOrigem.linhasLG=L.layerGroup(),r.todosLayers.vias=L.tileLayer.wms(et,{version:"1.3.0",tiled:!0,layers:"SIM:OlhoVivo",format:"image/png8",interactive:!1,attribution:'&copy; <a href="https://www.sptrans.com.br">SPTrans<\/a>'}),b=function(){t=new L.map("map_canvas2",{preferCanvas:!0,maxZoom:18,minZoom:10,attributionControl:!0,zoomControl:!0,scrollWheelZoom:!0,tap:!1,fullscreenControl:{title:{"false":"Ativar tela cheia","true":"Sair do modo tela cheia"}},layers:[r.todosLayers.vias]})},{Init:function(){n.Utils.verifyAppCacheUpdate();u=n.Utils.isMobile()?"tap":"click";$(window).bind("orientationchange",function(){n.Mobile.Utils.configurarOrientacaoDispositivo()});$(function(){n.Utils.inlinePopup($("#full-alert").text())});$(document).bind({mobileinit:function(){$.mobile.defaultPageTransition="none";$.mobile.defaultDialogTransition="none"},pagebeforechange:function(t,i){if(typeof i.toPage=="string"){var r=$.mobile.path.parseUrl(n.Utils.decodeURI(i.toPage+p));r.hash.search(/^#sp/)!==-1&&(n.TrocarPagina(r,i.options,"cat"),t.preventDefault())}},pageinit:function(){n.Utils.isMobile()&&n.Mobile.Utils.configurarOrientacaoDispositivo()},pagechange:function(t,i){var r=$(i.toPage);$.mobile.hidePageLoadingMsg();e=n.Utils.getCookie("atualizacaoAutomatica")==="true"||!1;n.Utils.isMobile()||n.Utils.configurarTopo(r.hasClass("interna-estrutura")?0:1);r.hasClass("home")&&($("html, body").scrollTop(0),$("#txSearchLinha").val().length>0&&$("#btDeOlhoLinha").trigger("click"),$("#txSearchParada").val().length>0&&$("#btDeOlhoPonto").trigger("click"))},pagecreate:function(){var i,r,f;n.Utils.isMobile()&&$("#lblTituloConsultaHome").height("5px");i=$("#select-corredor");i.length&&i.change(function(){var t="#"+n.Utils.encodeURI("sp?cat=Corredor&c=");window.location.hash=t+$(this).val()});$("#logoSigaTwt").click(function(n){window.open("https://twitter.com/intent/follow?original_referer=http%3A%2F%2Folhovivo.sptrans.com.br&screen_name=sptrans&source=followbutton&variant=2.0");n.stopImmediatePropagation()});$("#botoesPesquisaInicial").delegate("#btBuscaLinha, #btBuscaParada","validadePlaceholderEvent",function(){for(var i=$("[placeholder]"),r=i.length,t,n=0;n<r;n++)t=$(i[n]),t.val()===t.attr("placeholder")&&t.val("")});$("#homeButton").bind(u,function(n){return window.location=window.location.pathname+p.replace("&dif","?dif"),n.stopPropagation(),!1});$(".backButton").bind(u,function(n){var t=window.location.hash;if(t.indexOf("nc")>-1)return history.go(-2),n.stopPropagation(),!1});$("#refreshButton").bind(u,function(n){return location.reload(!0),n.stopPropagation(),!1});$("#atualizacaoAuto").change(function(){var u=$(this).prop("checked"),t=$(this).next("label"),i="Atualização automática {0}. {1} para {2}",r=n.Utils.isMobile()?"Toque":"Clique";u?(e=!0,t.find("SPAN.ui-btn-text:eq(0)").text(n.Utils.formatString(i,"ligada",r,"desligar"))):(e=!1,t.find("SPAN.ui-btn-text:eq(0)").text(n.Utils.formatString(i,"desligada",r,"ligar")));n.Utils.saveCookie("atualizacaoAutomatica",e)});$("#atualizacaoAuto").prop("checked",e);$("#btPopupOpcoes").bind(u,function(){$("#boxOpcoes").simpledialog2({animate:!1,headerText:"Opções",headerClose:!0,blankContent:!0,zindex:9999,themeHeader:"s"});$("#atualizacaoAuto").trigger("change")});$("#sp").on(u,".infosLinha",function(n){var t=$(this).data("l"),i=$(this).data("s");t&&window.open("https://sistemas.sptrans.com.br/PlanOperWeb/detalheLinha.asp?TpDiaID=0&project=OV&lincod="+t+(i?"&dfsenid="+i:""));n.stopImmediatePropagation()});if($("#select-btFootComente").change(function(t){switch(parseInt($(this).val())){case 1:window.open("http://twitter.com/share?via=sptrans&text=Conheça o projeto da SPTrans que traz a localização dos ônibus de São Paulo em tempo real!&hashtags=OlhoVivo&url=http://bit.ly/Hn8NVm");break;default:window.location.hash="#"+n.Utils.encodeURI("sp?cat=Comente")}return t.stopImmediatePropagation(),!1}),r=$("#btBuscaLinha"),r.attr("href",l+"#"+n.Utils.encodeURI("sp?cat=Linha")).bind(u,function(t){var r,u=$("#txSearchLinha"),i=u.val();if($(this).trigger("validadePlaceholderEvent"),r=i.length<2,r=!n.Utils.inputDataValidate(i),v){for(var o=0,e=[],s=e.length,e=i.split(" "),f=0;f<s;f++)n.Utils.isNumeric(e[f])&&o++;o>1&&u.val(e.join(""))}return n.Utils.isNumeric(i.substring(0,3))&&(u.val(i.replace(" ","-").replace("/","-").replace(",","-")),r=i.length<st),r===!0?(n.Utils.log("Informe um nome ou código de linha válidos",1),u.focus(),t.stopImmediatePropagation(),!1):void 0}),n.Utils.enableEnterKeyOnSearch($("#txSearchLinha"),$("#btBuscaLinha")),f=$("#btBuscaParada"),f.attr("href",l+"#"+n.Utils.encodeURI("sp?cat=Parada")).bind(u,function(t){var i=$("#txSearchParada");return $(this).trigger("validadePlaceholderEvent"),i.val().length<2?(n.Utils.log("Informe um nome ou código de parada válidos",1),i.focus(),t.stopImmediatePropagation(),!1):void 0}),n.Utils.enableEnterKeyOnSearch($("#txSearchParada"),$("#btBuscaParada")),n.Utils.isMobile()||(n.Utils.Navigator.isIE()&&$("[placeholder]").focus(function(){var n=$(this);n.val()===n.attr("placeholder")&&(n.val(""),n.removeClass("placeholder"))}).blur(function(){var n=$(this);(n.val()===""||n.val()===n.attr("placeholder"))&&(n.addClass("placeholder"),n.val(n.attr("placeholder")))}).blur(),n.Utils.Navigator.isChrome()&&v&&($("#txSearchLinha").attr("x-webkit-speech","x-webkit-speech").bind({webkitspeechchange:function(n){var t,i=[],f=$(this).val().toLowerCase(),e=n.originalEvent.results.length;for(f=f.replace(/meia/g,"6").replace(/zero/g,"0"),i.push(f),t=0;t<e;t++)i.push(n.originalEvent.results[t].utterance);$(this).empty().autocomplete({delay:100,minLength:0,source:i,select:function(n,t){$("#txSearchLinha").val(t.item.value);r.trigger(u)}}).focus()},focus:function(){$(this).autocomplete("search","")}}),$("#txSearchParada").attr("x-webkit-speech","x-webkit-speech").bind({webkitspeechchange:function(n){for(var i=[],r=n.originalEvent.results.length,t=0;t<r;t++)i.push(n.originalEvent.results[t].utterance);$(this).empty().autocomplete({delay:100,minLength:0,source:i,select:function(n,t){$("#txSearchParada").val(t.item.value);$("#btBuscaParada").trigger(u)}}).focus()},focus:function(){$(this).autocomplete("search","")}}))),n.Utils.isMobile())$("#txSearchLinha").attr("placeholder","Linha").attr("title","Linha"),$("#txSearchParada").attr("placeholder","Parada").attr("title","Parada");else{var t=150,o=$(".appContent #botoesPesquisaInicial DIV.ui-grid-a:eq(0)"),s=$(".appContent #botoesPesquisaInicial DIV.ui-grid-a:eq(1)");$(".appContent UL").hide();$(".appContent #botoesPesquisaInicial DIV.ui-grid-a").hide();$("#btDeOlhoLinha").click(function(){$(".appContent UL").show(t);$(".appContent #botoesPesquisaInicial DIV.ui-grid-a").hide();o.show(t);s.hide(t)});$("#btDeOlhoPonto").click(function(){$(".appContent UL").show(t);$(".appContent #botoesPesquisaInicial DIV.ui-grid-a .label-b").hide();o.hide(t);s.show(t)});$("#lblTituloConsultaHome").html("Escolha uma das opções de consulta abaixo")}}}).delegate("[data-role=page]","pageshow",n.Utils.analytics)},TrocarPagina:function(r,f,o){var wt,gt,kt,b,g;$.mobile.showPageLoadingMsg();var yt=n.Utils.getParameterByName(o,r.hash),bi=r.hash.replace(/\?.*$/,""),s=$(bi),ht=s.children(":jqmData(role=header)"),w=s.children(":jqmData(role=content)");if(jQuery.event.remove(window,"resize",n.Mapa2.Utils.redimensionar),clearTimeout(a),yt==="Linha"){var ni=n.Utils.getParameterByName("l",r.hash,!0),ti=n.Utils.getParameterByName("s",r.hash),li=n.Utils.getParameterByName("ponto",r.hash),ii=n.Utils.getParameterByName("parCod",r.hash),it=ni||$("#txSearchLinha").val(),g="Busca por Linha",ri,ui={};ni===""&&(n.Utils.log("Informe um nome ou código de linha válidos",1),document.location.href=l);ti!==null?(ri=c.LinhaSentido,ui={termosBusca:it,sentido:ti}):(ri=c.Linhas,ui={termosBusca:it}),function ut(t){if(t===!0)var u=$.getJSON(ri,ui,function(t,i){var u,e,o;if("success"===i&&t){var d=g+"<br/><span>Linha <b>"+it+"<\/b><\/span>",v="",l,a,p,b=t.length,k=!(!t||b===0),c='<ul id="listaLinha'+it+'" data-role="listview" '+(k?'data-filter="true" data-filter-placeholder="'+y+'"':"")+">";if(k){for(o=0;o<b;o++)u=t[o],u.CodigoLinha=u.cl,u.Circular=u.lc,u.Letreiro=u.lt,u.Sentido=u.sl,u.Tipo=u.tl,u.DenominacaoTPTS=u.tp,u.DenominacaoTSTP=u.ts,l=u.Letreiro+"-"+u.Tipo,p=u.Sentido===1,a=p?u.DenominacaoTPTS:u.DenominacaoTSTP,e="sp?cat=ParadaLinha&c="+(u.Sentido-1).toString()+u.CodigoLinha+"&l="+l+"&d="+a,li&&ti!="0"&&(e+="&ponto="+li),ii&&(e+="&parCod="+ii),v='<li class="mostraParadas"><a href="#'+n.Utils.encodeURI(e)+'" rel="external"><img src="'+h+'imagens/icones/busSeguinte.png" alt="" /><h4>'+l+'<span class="icSentido">&nbsp;<\/span>'+a+"<\/h4><p><i>"+(u.DenominacaoTSTP+" / "+u.DenominacaoTPTS)+"<\/i><\/p><\/a><\/li>",c+=v;ti!==null&&o==1&&(window.location.hash="#"+n.Utils.encodeURI(e))}else c+="<li>Não foram encontradas linhas com o termo "+it+"<\/li>";c+="<\/ul>";n.Utils.setPageTitle(s,n.Utils.getPageTitle()+" - "+g+" ("+it+")");ht.find("H1").html(d);w.html(c);s.page();w.find(":jqmData(role=listview)").listview();f.dataUrl=n.Utils.encodeURI(r.hash.split("#")[1]+"&l="+it);$.mobile.changePage(s,f);n.Utils.isMobile()&&w.find("LI.mostraParadas").bind("taphold",function(t){t.preventDefault();var i=n.Utils.getParameterByName("c",$("A",$(this)).attr("href")),r=n.Utils.getParameterByName("l",$("A",$(this)).attr("href")),u=n.Utils.getParameterByName("d",$("A",$(this)).attr("href"),!0);n.Mobile.Utils.abrirPopupAtalhos(ot.LINHA,{cdlinha:i,letreiro:r,denominacao:u})})}}).error(function(t){n.Utils.getErrorMessage(t,i.CONEXAO)===i.UNAUTHORIZED&&n.Sec.Auth(function(){ut(!0)})})}(!0)}else if(yt==="ParadaLinha"){var wt=n.Utils.getParameterByName("c",r.hash),ni=wt.substring(0,1),dt=wt.substring(1,wt.length),et=n.Utils.getParameterByName("l",r.hash),ct=n.Utils.getParameterByName("d",r.hash,!0),ii=n.Utils.getParameterByName("parCod",r.hash),bt=n.Utils.getParameterByName("ponto",r.hash),g="Busca por Linha",lt=!1;(function ut(t){if(t===!0)var u=$.ajax({url:c.PrevisaoLinha,data:{codigoLinha:dt},success:function(t){var k;if(t){var e="",d=g+'<br/><span class="horarioReferencia"><div class="horarioref">Horário de referência: <div>'+t.hr+"<\/div><\/div><\/span>",v=t.ps.length,b,o,u,c,l,a,i='<ul id="listaParadaLinha'+dt+'" data-role="listview" data-filter="true" data-filter-placeholder="'+y+'">';for(ni<9&&v>0&&(ct=n.Utils.decodeURI(ct,!0),o="#"+n.Utils.encodeURI("sp?cat=Mapa2&l="+dt+"&s="+et+"&sc="+ct+p),i+='<li data-role="list-divider">',i+='<div class="infosLinha" data-l="'+et+'" data-s="'+(parseInt(ni)+1)+'" title="Veja mais informações sobre a linha '+et+'">LINHA '+et+" - "+ct,i+="<span>Detalhes e horários da linha<\/span>",i+="<\/div>",i+="<\/li><li>",i+='<img src="'+h+'imagens/icones/icMapaCompleto.png" alt="" />',i+='<h4 style="padding-left: 12px;">Ver mapa do itinerário completo<\/h4>',i+='<p class="ui-li-aside ui-li-desc"><a href="'+o+'" class="mapIcon ui-link" rel="external">Mapa<\/a>',i+="<\/p>",i+="<\/li>"),l=0;l<v;l++){if(u=t.ps[l],o="sp?cat=Mapa2&p="+u.cp+"&s="+et+"&sc="+ct+"&l="+dt,e='<li id="parada'+u.cp+'"><img src="'+h+'imagens/icones/busSeguinte.png" alt="" /><h4>'+n.Utils.replaceSentido(u.np)+'<\/h4><p title=""><b>Código da parada:<\/b> '+u.cp+'<\/p><div class="previsoes">',b=u.vs.length,b>0)for(a=0;a<b;a++)c=u.vs[a],c!==null&&(e+=rt.replace("{AREA}",c.p.substring(0,1)).replace("{PREVISAO}",c.t).replace("{PREFIXO}",c.p));else o+="&lat="+u.py+"&lon="+u.px,e+=pt.NenhumVeiculoAproximando;o+=p;e+='<\/div><p class="ui-li-aside"><a href="#'+n.Utils.encodeURI(o)+'" ponto="'+u.cp+'" class="mapIcon ui-link" rel="external">Mapa<\/a><\/p><\/li>';ii?ii==u.cp&&(i+=e):i+=e}v===0||bt?(k="#"+n.Utils.encodeURI("sp?cat=Mapa2&l="+dt+"&s="+et+"&sc="+ct+p+"&nc"),bt&&bt!=""&&(k+="&ponto="+bt),i="",window.location.hash=k):(i+="<\/ul>",w.html(i),lt||(n.Utils.setPageTitle(s,n.Utils.getPageTitle()+" - "+g+" ("+et+")"),ht.find("H1").html(d),s.page(),f.dataUrl=r.href,$.mobile.changePage(s,f),lt=!0),w.find(":jqmData(role=listview)").listview(),$("DIV.horarioref>DIV").text(t.hr))}},dataType:"json",timeout:3e4}).error(function(t){n.Utils.getErrorMessage(t,i.CONEXAO)===i.UNAUTHORIZED&&n.Sec.Auth(function(){ut(!0)})});a=setTimeout(function(){ut(e)},d)})(!0)}else if(yt==="Parada"){var fi=$("#txSearchParada").val(),ai=n.Utils.getParameterByName("p",r.hash),at=n.Utils.getParameterByName("PID",r.hash),it=ai||fi,kt="Busca por Paradas",vi;ai===""&&at==""&&(n.Utils.log("Informe um nome ou código de parada válidos",1),document.location.href=l);(!at||at==="")&&n.Utils.isNumeric(fi)&&(at=fi);at!==null&&at!==""?(lt=!1,function ut(t,u){if(t===!0)var o=$.ajax({url:c.PrevisaoParada,data:{codigoParada:at},success:function(t){if(t){var d=kt+'<br/><span><span class="horarioReferencia"><div class="horarioref">Horário de referência: <div>'+t.hr+"<\/div><\/div><\/span>",v=!(!t||t.length===0||!t.p),e='<ul id="listaLinhasPorParada_'+at+'" data-role="listview"'+(v?'data-filter="true" data-filter-placeholder="'+y+'"':"")+">",a,i,o,p,b,k,c,l;if(v)for(b=t.p.l.length,e+='<li data-role="list-divider">PARADA '+n.Utils.replaceSentido(t.p.np)+"<\/li>",vi=t.p.np,c=0;c<b;c++){for(i=t.p.l[c],a=i.sl===1?i.lt0:i.lt1,k="sp?cat=Mapa2&lat="+t.p.py+"&lon="+t.p.px+"&s="+i.c+"&sc="+a+"&p="+at+"&l="+i.cl,e+='<li id="linha'+i.cl+'"><img src="'+h+'imagens/icones/busSeguinte.png" alt="" /><h4>'+i.c+" - "+a+"<\/h4><p>"+(i.lt1+" / "+i.lt0)+'<\/p><div class="previsoes">',p=i.vs.length,l=0;l<p;l++)o=i.vs[l],o!==null&&(e+=rt.replace("{AREA}",o.p.substring(0,1)).replace("{PREVISAO}",o.t).replace("{PREFIXO}",o.p));e+='<\/div><p class="ui-li-aside"><a href="#'+n.Utils.encodeURI(k)+'" ponto="'+t.p.np+'" class="mapIcon ui-link" rel="external">Mapa<\/a><\/p><\/li>'}else e+="<li>Não foram encontradas linhas para este ponto de parada<\/li>";e+="<\/ul>";u||(n.Utils.setPageTitle(s,n.Utils.getPageTitle()+" - "+kt+" ("+vi+")"),ht.find("H1").html(d),s.page(),f.dataUrl=r.href,$.mobile.changePage(s,f),u=!0);w.html(e);w.find(":jqmData(role=listview)").listview();$("DIV.horarioref>DIV").text(t.hr)}},dataType:"json",timeout:3e4}).error(function(t){n.Utils.getErrorMessage(t,i.CONEXAO)===i.UNAUTHORIZED&&n.Sec.Auth(function(){ut(!0,u)})});a=setTimeout(function(){ut(e,u)},d)}(!0)):function ut(t){if(t===!0)var u=$.getJSON(c.Paradas,{termosBusca:it},function(t){if(t){for(var a=kt+"<br/><span>Busca por <b>"+it+"<\/b><\/span>",o=t.length,h=!(!t||o===0),u='<ul id="listaParada_'+it+'" data-role="listview"'+(h?' data-filter="true" data-filter-placeholder="'+y+'"':"")+">",c="",l=[],i,e=0;e<o;e++)i=t[e],i.CodigoParada=i.cp,i.Nome=i.np,i.Endereco=i.ed,i.Latitude=i.py,i.Longitude=i.px,g=i.Nome||"Parada "+i.CodigoParada,c='<li><a href="{LINK}" class="GetLinhasPorParada" Parada="'+i.CodigoParada+"|"+i.Nome+'" rel="external"><h4>'+n.Utils.replaceSentido(g.toUpperCase())+"<\/h4><p><b>Endereço:<\/b> "+i.Endereco+"<\/p><\/a><\/li><linhas><\/linhas>",l.push(i.CodigoParada),u+=c;h||(u+="<li>Não foram paradas com o termo "+it+"<\/li>");u+="<\/ul>";n.Utils.setPageTitle(s,n.Utils.getPageTitle()+" - "+kt+" ("+it+")");ht.find("H1").html(a);w.html(u);s.page();w.find(":jqmData(role=listview)").listview();f.dataUrl="#"+n.Utils.encodeURI(r.hash.split("#")[1]+"&p="+it+"&PID=");$.mobile.changePage(s,f);w.find("A.GetLinhasPorParada").each(function(t){$(this).attr("href",$(this).attr("href").replace("{LINK}",f.dataUrl.replace(/PID.*/,n.Utils.encodeURI("PID=")+l[t])))})}}).error(function(t){n.Utils.getErrorMessage(t,i.CONEXAO)===i.UNAUTHORIZED&&n.Sec.Auth(function(){ut(!0)})})}(!0)}else if(yt==="Corredor")wt=n.Utils.getParameterByName("c",r.hash),kt="Busca por Corredores",n.Utils.retornarListaCorredores(wt,function(n){gt=n}),function ut(t){if(t===!0)var u=$.getJSON(c.ParadasPorCorredor,{codigoCorredor:wt},function(t){if(t&&gt!==null){var v=kt+"<br/><span><b>Corredor "+gt.toUpperCase()+"<\/b><\/span>",c,o=t!==null,h=t.length,u='<ul id="listaParada_'+wt+'" data-role="listview" '+(o&&h>0?'data-filter="true"':"")+' data-filter-placeholder="'+y+'">',l="",a=[],i,e;if(o)for(e=0;e<h;e++)i=t[e],i.CodigoParada=i.cp,i.Nome=i.np,i.Endereco=i.ed,i.Latitude=i.py,i.Longitude=i.px,c=i.Nome||"Parada "+i.CodigoParada,l='<li><a href="{LINK}" class="GetLinhasPorParada" Parada="'+i.CodigoParada+"|"+i.Nome+'" rel="external" title="Ver linhas da parada '+i.Nome+'"><h4>'+n.Utils.replaceSentido(c.toUpperCase())+"<\/h4><p><b>Endereço:<\/b> "+i.Endereco+"<\/p><\/a><\/li><linhas><\/linhas>",a.push(i.CodigoParada),u+=l;o&&h!==0||(u+="<li>Não foram encontradas paradas para o corredor "+gt+".<\/li>");u+="<\/ul>";n.Utils.setPageTitle(s,n.Utils.getPageTitle()+" - "+kt+" ("+gt.toUpperCase()+")");ht.find("H1").html(v);w.html(u);s.page();w.find(":jqmData(role=listview)").listview();f.dataUrl=r.hash;$.mobile.changePage(s,f);w.find("A.GetLinhasPorParada").each(function(t){var u=$(this).attr("href"),i,r="";i=f.dataUrl.split("#")[1];i=i.replace(/cat..*/,"cat=Parada");i=i+"&PID="+a[t];r=u.replace("{LINK}","#"+n.Utils.encodeURI(i));$(this).attr("href",r)})}else n.Utils.getErrorMessage("Impossível atualizar lista de corredores. Tente novamente.")}).error(function(t){n.Utils.getErrorMessage(t,i.CONEXAO)===i.UNAUTHORIZED&&n.Sec.Auth(function(){ut(!0)})})}(!0);else if(yt==="Mapa2"){var ei=n.Utils.getParameterByName("lat",r.hash),oi=n.Utils.getParameterByName("lon",r.hash),si=n.Utils.getParameterByName("p",r.hash),hi=n.Utils.getParameterByName("l",r.hash),et=n.Utils.getParameterByName("s",r.hash),ct=n.Utils.getParameterByName("sc",r.hash,!0),ki=et+(ct?" - "+ct:""),bt=n.Utils.getParameterByName("ponto",r.hash),vt=[],yi,st="",g="Mapa";st+="<ul data-role='listview' data-divider-theme='c'>";st+="<li data-role='list-divider' role='heading'><div class='infosLinha' data-l='"+et+"' data-s='"+(parseInt(hi)<tt?1:2)+"' title='Veja mais informações sobre a linha "+et+"'>LINHA "+et+" - "+ct;st+="<span>Detalhes e horários da linha<\/span>";st+="<\/li>";st+="<div id='map_canvas2' class='mapa' style='margin: auto'>";st+="<\/div>";st+="<\/ul>";si===null?(lt=!1,function ut(u){if(u===!0)var o=$.ajax({url:c.PosicaoLinha,data:{codigoLinha:hi},success:function(i){if(i&&i.vs!==null){var e,o=i.vs.length,u;for(vt=[],u=0;u<o;u++)e=i.vs[u],e!==null&&vt.push(e);ht.find("H1").html(g+'<br /><span><div class="horarioref">Horário de referência: <div>'+i.hr+"<\/div><\/div><\/span>");lt?(n.Mapa2.Utils.atualizarPosicaoVeiculos(vt),$("DIV.horarioref>DIV").text(i.hr)):(n.Utils.setPageTitle(s,n.Utils.getPageTitle()+" - "+g+" (Linha "+ki+")"),w.html(st),s.page(),w.find(":jqmData(role=listview)").listview(),f.dataUrl=r.href,$.mobile.changePage(s,f),n.Mapa2.Utils.redimensionar(),jQuery.event.add(window,"resize",n.Mapa2.Utils.redimensionar),n.Mapa2.MostrarMapa(null,null,vt,null,null,function(){if(bt&&bt.indexOf("|")>1){var u=bt.split("|"),i=n.Mapa2.Utils.formatarLatLong(u[0]),r=n.Mapa2.Utils.formatarLatLong(u[1]),f=L.icon({iconUrl:h+"imagens/icones/posicaoParada.png"}),e;i&&r&&(e=L.marker([i,r],{renderer:nt,icon:f,latitude:i,longitude:r}).addTo(t))}}),v&&n.Utils.applyVoiceSearchOnAddress(),lt=!0)}},dataType:"json",timeout:3e4}).error(function(t){n.Utils.getErrorMessage(t,i.CONEXAO)===i.UNAUTHORIZED&&n.Sec.Auth(function(){ut(!0)})});a=setTimeout(function(){ut(e)},d)}(!0)):(lt=!1,function ut(u){if(u===!0)var o=$.ajax({url:c.Previsao,data:{codigoParada:si,codigoLinha:hi},success:function(i){if(i){var u,l,h,c,e,o,a=0;if(vt=[],i.p!==null&&i.p.l!==null)for(a=i.p.l.length,u=i.p.np,ei||(ei=i.p.py),oi||(oi=i.p.px),e=0;e<a;e++)for(h=i.p.l[e],l=h.vs.length,o=0;o<l;o++)c=h.vs[o],c!==null&&vt.push(c);k=vt.length;$("#veicAprox").find("b").text(k);lt?(n.Mapa2.Utils.atualizarPosicaoVeiculos(vt),$("DIV.horarioref>DIV").text(i.hr)):(n.Utils.setPageTitle(s,n.Utils.getPageTitle()+" - "+g+" ("+(u?"Parada "+u:"")+")"),ht.find("H1").html(g+"<br /><span>"+(u?"Parada <b>"+n.Utils.replaceSentido(u)+"<\/b><br/>":"")+'<div class="horarioref">Horário de referência: <div>'+i.hr+"<\/div><\/div><\/span>"),w.html(st),s.page(),w.find(":jqmData(role=listview)").listview(),f.dataUrl=r.href,$.mobile.changePage(s,f),n.Mapa2.Utils.redimensionar(),jQuery.event.add(window,"resize",n.Mapa2.Utils.redimensionar),n.Mapa2.MostrarMapa(ei,oi,vt,si,u),n.Utils.Location.mostrarPosicaoUsuario(t),v&&n.Utils.applyVoiceSearchOnAddress(),lt=!0);L.DomEvent.on(ft,"popupopen",function(){$("#veicAprox").find("b").text(k)})}},dataType:"json",timeout:3e4}).error(function(t){n.Utils.getErrorMessage(t,i.CONEXAO)===i.UNAUTHORIZED&&n.Sec.Auth(function(){ut(!0)})});a=setTimeout(function(){ut(e)},d)}(!0))}else if(yt==="DeOlhoNaVia"){var st="",g="De Olho Na Via",ci,pi,wi,yi;ci=new Date;pi=n.Utils.pad(ci.getHours(),2);wi=n.Utils.pad(ci.getMinutes(),2);yi=pi+":"+wi;st+="<div class='kmzMap ui-listview' data-role='listview' data-divider-theme='c'>";n.Utils.setPageTitle(s,n.Utils.getPageTitle()+" - "+g);ht.find("H1").html(g+'<br /><span>Mapa de fluidez do transporte coletivo (ônibus)<\/span><br/><span class="horarioReferencia"><div class="horarioref">Última atualização: <div>'+yi+"<\/div><\/div><\/span>");w.html(st+'<div id="map_canvas2" class="mapa" ><\/div><\/div>');s.page();f.dataUrl=r.href;$.mobile.changePage(s,f);n.Mapa2.Utils.redimensionar();jQuery.event.add(window,"resize",n.Mapa2.Utils.redimensionar);n.Mapa2.MostrarMapaFluidez();v&&n.Utils.applyVoiceSearchOnAddress()}else yt==="Comente"&&(g="Comente",b='<form id="enviaContato">',b+='<div data-role="fieldcontain">',b+='<fieldset data-role="controlgroup" data-role="fieldcontain">',b+='<legend>Nome<span class="textoMenor7"><\/span><\/legend>',b+='<input type="text" name="Nome" id="Nome" />',b+="<\/fieldset>",b+='<fieldset data-role="controlgroup">',b+='<legend>E-mail<span class="textoMenor7"><\/span><\/legend>',b+='<input type="email" name="Email" id="Email" />',b+="<\/fieldset>",b+='<fieldset data-role="controlgroup">',b+='<legend>Mensagem<span class="textoMenor7"><\/span><\/legend>',b+='<textarea name="Mensagem" id="Mensagem"><\/textarea>',b+="<\/fieldset>",b+='<button type="submit" id="btSubmitForm">Enviar<\/button>',b+="<\/div>",b+="<\/form>",n.Utils.setPageTitle(s,n.Utils.getPageTitle()+" - "+g),ht.find("H1").html(g+"<br /><span>Ajude a SPTrans a melhorar cada vez mais este serviço.<\/span>"),w.html(b),s.page().page("destroy"),f.dataUrl=r.href,$.mobile.changePage(s,f),$("#btSubmitForm").bind(u,function(){var i=$("#enviaContato").serialize(),r=function(i,r){i=="1"?n.Utils.Alert.show("Comente","Obrigado por sua mensagem!"):t(i,r);$.mobile.changePage($("#pagePrevisao"))},t=function(){n.Utils.Alert.show("Comente","Problemas no envio do e-mail. Por favor tente novamente.")};return $("#Mensagem").val()?$.ajax({type:"POST",url:l+"WebApp/EnviarEmail",cache:!1,data:i,success:r,error:t}):(n.Utils.Alert.show("Comente","Por favor deixe-nos uma mensagem."),$("#Mensagem").focus()),!1}))},Mapa2:function(){return{Utils:function(){return{mostrarLinha:function(u,f){var s={service:"WFS",version:"2.0",request:"GetFeature",typeName:"SIM:Linhas",outputFormat:"application/json",CQL_FILTER:"LINHA LIKE '"+u+"%' AND SENTIDO = "+f+""},h=L.Util.extend(s),c=et+L.Util.getParamString(h),e,o;L.DomEvent.on(t,"unload",function(){g=0;it=!1});e=L.featureGroup({interactive:!1}).bindPopup("Linha: "+n.Utils.getParameterByName("s")+"<br/>Sentido "+n.Utils.getParameterByName("sc",null,!0),{maxWidth:300}).addTo(t);o=null;$.ajax({url:c,success:function(i){var h,s,c;if(!i.totalFeatures)if(g==0)g=1,it=!0,f=f==1?2:1,n.Mapa2.Utils.mostrarLinha(u,f);else return;for(o=L.geoJson(i,{style:function(n){return g==1&&it==!0?f==1?{fillColor:"FFFFFF",color:"#ff6e00"}:{fillColor:"444444",color:"#13377e"}:n.properties.SENTIDO==1?{fillColor:"444444",color:"#13377e"}:{fillColor:"FFFFFF",color:"#ff6e00"}},onEachFeature:function(n,t){t.addTo(e)}}),h=Object.keys(r.todosLayers.linhas),s=0;s<h.length;s++)r.todosLayers.linhas[h[s]].removeFrom(t);r.todosLayers.linhas[u]=o;r.todosLayers.addLayer(r.todosLayers.linhas[u]);r.todosLayers.linhas[u].addTo(t);c=e.getBounds();Object.keys(c).length&&t.fitBounds(c)}}).error(function(t){n.Utils.getErrorMessage(t,i.CONEXAO)===i.UNAUTHORIZED&&n.Sec.Auth(function(){poll(!0)})})},redimensionar:function(n){var t=0;t=n===!0?$(window).height():$(window).height()-$("div.ui-header").height();$("#map_canvas2").css({height:parseInt(t)+"px"})},criarMarcadorVeiculo:function(t){var r,i=[],u,f;return r=(n.Utils.getParameterByName("l")<tt?1:2)==1?vt:yt,u='<div class="infoWindowVeiculo"><p{ADAPTADO}>Linha {LINHA}<\/p><div class="prefixo" title="Prefixo deste veículo"><b>Prefixo do veículo:<\/b> {PREFIXO}<\/div> {PREVISAO} <\/div>'.replace("{ADAPTADO}",t.a==!0?' class="adaptado" title="Veículo Adaptado"':"").replace("{LINHA}",n.Utils.getParameterByName("s")).replace("{PREFIXO}",t.p).replace("{PREVISAO}",function(){var n="";return t.t&&(n='<div id="horaChegada" class="previsao"><b>Previsão:<\/b> '+t.t+"<\/div>"),n}),w=L.marker([t.py,t.px],{renderer:nt,id:t.p,prefixo:t.p,latitute:t.py,longitude:t.px,icon:r,className:"markerTransition"}).bindPopup(u,{className:null,offset:[0,-10]}),t.a&&i.push("Adaptado"),t.b&&i.push("Bicicleta"),f=i.map(function(n){return"<div class='"+n+"'><\/div>"}).join(""),w.getIcon().options.html=w.getIcon().options.html.replace("{f}",f),w.bindTooltip("<span class='tooltipPrefixoTitulo'>"+t.p+"<\/span><br/>"+(i?"Configurações: <br/>"+i.join(" "):""),{direction:"right",offset:[15,0]}),w},atualizarPosicaoVeiculos:function(i){var u=function(n){var t=!0;return f.forEach(function(i){if(i.options.prefixo==n)return t=!1}),t},e=function(n){var t=!0;return i.forEach(function(i){if(i.p==n)return t=!1}),t},r;L.DomEvent.on(t,"unload",function(){for(var n=0;n<f.length;n++)f[n].removeFrom(t);f=[]});for(f.forEach(function(n){if(e(n.options.prefixo)){n.removeFrom(t);var i=f.indexOf(n);i>-1&&f.splice(i,1)}}),r=0;r<i.length;r++)f.length==0||u(i[r].p)?f.push(n.Mapa2.Utils.criarMarcadorVeiculo(i[r])):f.forEach(function(n){if(n.options.prefixo==i[r].p){var t={lat:i[r].py,lon:i[r].px};n.setLatLng(t);n.options.latitude=i[r].py;n.options.longitude=i[r].px}});return f.forEach(function(n){n.addTo(t)}),f},formatarLatLong:function(n){var r=new RegExp(/^(\-[0-9]{2}(\.?[0-9]+)?)$/),i=null,t;return r.test(n)&&(t=n,n.indexOf(".")<0&&(t=n.slice(0,3)+"."+n.slice(3)),i=t),i}}}(),MostrarMapa:function(i,r,u,f,e,o){var h,l,c;t?(t.remove(t),b(),s&&s.addTo(t)):(b(),L.DomEvent.addListener(t,"status_changed",function(){kmlLayer.getStatus()!=="OK"&&n.Utils.Alert.show("Falha","Falha na geração dos dados de velocidade.<div class='showerror'><div>"+kmlLayer.getStatus()+"<\/div><\/div>")}));s||n.Utils.Location.mostrarPosicaoUsuario(t);t.attributionControl.setPrefix(!1);L.Control.Watermark=L.Control.extend({onAdd:function(){var n=L.DomUtil.create("img");return n.src="/Content/theme/imagens/favicon-SPTRANS.png",n.style.width="20px",n},onRemove:function(){}});L.control.watermark=function(n){return new L.Control.Watermark(n)};L.control.watermark({position:"bottomleft"}).addTo(t);n.Mapa2.Utils.mostrarLinha(n.Utils.getParameterByName("s"),n.Utils.getParameterByName("l")<tt?1:2);l=L.latLng(i?i:"-23.5475",r?r:"-46.6311");t.setView(l,15);u&&u.length>0&&n.Mapa2.Utils.atualizarPosicaoVeiculos(u);h="sp?cat=Parada&p="+e+"&PID="+f;c='<div class="prefixo">Parada <b>'+e+"<\/b><\/div>";ut=ht.replace("{CODIGO}",f).replace("{PARADA}",e?c:"").replace("{VEICULOS}",k).replace("{LINK}",'<a href="#'+n.Utils.encodeURI(h)+'" rel="external">Ver previsões<\/a>');e==undefined&&(e="");f&&(ft=L.marker([i,r],{renderer:nt,icon:at,title:e!=""?"Parada "+e:""}).bindTooltip("<span class='tooltipPrefixoTitulo'>"+e+"<\/span>",{className:null,permanent:!1,direction:"right",offset:[15,-15],interactive:!0,opacity:1}).bindPopup(ut,{className:null,offset:[0,-25]}).addTo(t));o&&o(t)},MostrarMapaFluidez:function(){var f,o,i,h,u,c,r;if(n.Utils.Navigator.isIE()){f="<p style='font-weight:700'>Você está utiliando um navegador não suportado.<\/p><p>O Mapa de Fluidez e algumas áreas deste site podem não funcionar corretamente.<\/p>";$("<div class='simplePopup ui-body-s'><div class='sp-container'><div class='sp-content'>"+f+"<\/div><\/div><\/div>").appendTo("BODY").on("click",function(){$(this).fadeOut({duration:300,complete:function(){$(this).remove()}})});return}t?(t.remove(t),b(),s&&s.addTo(t)):b();s||n.Utils.Location.mostrarPosicaoUsuario(t);t.attributionControl.setPrefix(!1);L.Control.Watermark=L.Control.extend({onAdd:function(){var n=L.DomUtil.create("img");return n.src="/Content/theme/imagens/favicon-SPTRANS.png",n.style.width="20px",n},onRemove:function(){}});L.control.watermark=function(n){return new L.Control.Watermark(n)};L.control.watermark({position:"bottomleft"}).addTo(t);$.mobile.showPageLoadingMsg();h=function(){$.mobile.showPageLoadingMsg();i=L.kmzLayer(null,{bindPopup:!0}).on("load",function(i){var r=i.name.split("="),e=i.layer.getBounds();if(r.length>1){var o=r[1].substring(0,4),s=r[1].substring(4,6),h=r[1].substring(6,8),u=r[1].substring(8,10),f=r[1].substring(10,12);r=new Date(o,s,h,u,f,0);n.Fluidez.setHorarioAtualizacao(u+"h"+f)}Object.keys(e).length?t.fitBounds(i.layer.getBounds()):t.setView(new L.LatLng(-23.550581,-46.633299),5);$.mobile.hidePageLoadingMsg()}).addTo(t)};u=L.control({position:"topright"});u.onAdd=function(){var t=L.DomUtil.create("div","info legend"),n="";n+='<div class="btnMenu" id="btn-mostrarLegendaKML">Definir sentido<\/div>';n+='<div class="dropDownOptionsDiv" id="myddOptsDiv" style="margin-top: 27px">';n+='<div id="AMBOS" class="dropDownItemDiv" title="Exibe os sentidos bairro e centro ao mesmo tempo" data-type="TODOS">Mapa completo<\/div>';n+='<div id="CB" class="dropDownItemDiv" title="Exibe o mapa sentido bairro" data-type="CB">Mapa sentido BAIRRO<\/div>';n+='<div id="BC" class="dropDownItemDiv" title="Exibe o mapa sentido CENTRO" data-type="BC">Mapa sentido CENTRO<\/div>';n+='<div class="separatorDiv"><\/div>';n+='<div  class="checkboxContainer">';n+='<input type="checkbox" id="kmlVias">';n+='<label for="kmlVias">Outras vias<\/label><\/div>';n+='<div  class="checkboxContainer">';n+='<input type="checkbox" id="kmlCorredores">';n+='<label for="kmlCorredores">Corredores<\/label>';n+="<\/div><\/div><\/div>";n+='<div class="btnMenu" id="btn-legendaVia">Legenda<\/div>';n+='<div class="dropDownLegendaDiv" id="myddLstLgd" style="display: none"><ul>';n+='<li><span style="background-color: #30ac3e">&nbsp;&nbsp;<\/span><span style="color: #30ac3e"> <b>Rápida<\/b> - Velocidade igual ou superior a 20 km/h<\/span><\/li>';n+='<li><span style="background-color: #FFCD00">&nbsp;&nbsp;<\/span><span style="color: #FFCD00"> <b>Moderada<\/b> - Velocidade entre 15km/h e 19 km/h<\/span><\/li>';n+='<li><span style="background-color: #ff0000">&nbsp;&nbsp;<\/span><span style="color: #ff0000"> <b>Lenta<\/b> - Velocidade abaixo de 15km/h<\/span><\/li>';n+='<li><span style="background-color: #c0c0c0; margin-bottom: 5px">&nbsp;&nbsp;<\/span><span style="color: #c0c0c0"> Indisponível<\/span><\/li>';n+='<li><span class="ic-legenda-terminal">';n+='<svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" style=" margin-top: 4px; margin-bottom= -1px" version="1.1">';n+='<g style="&#10;" transform="matrix(0.0635, 0, 0, 0.0635, 0, 1.180725)">';n+='<path style=" stroke:none;fill-rule:nonzero;fill:rgb(80.799866%,8.999634%,11.799622%);fill-opacity:1;" d="M 4.527344 55.265625 L 0 77.757813 L 75.90625 77.757813 L 43.375 225.5 L 67.320313 225.046875 L 96.234375 86.34375 C 96.234375 86.34375 103.398438 56.667969 74.097656 55.621094 C 49.71875 54.746094 4.527344 55.265625 4.527344 55.265625 "/>';n+='<path style=" stroke:none;fill-rule:nonzero;fill:rgb(80.799866%,8.999634%,11.799622%);fill-opacity:1;" d="M 6.777344 48.613281 L 75.90625 48.613281 C 75.90625 48.613281 111.183594 48.84375 101.03125 91.992188 L 72.453125 224.820313 L 94.203125 224.820313 C 94.203125 224.820313 119.277344 101.476563 121.648438 90.632813 C 124.023438 79.789063 126.054688 35.0625 79.632813 27.945313 C 39.90625 26.699219 11.183594 27.605469 11.183594 27.605469 L 6.777344 48.613281 "/>';n+='<path style=" stroke:none;fill-rule:nonzero;fill:rgb(80.799866%,8.999634%,11.799622%);fill-opacity:1;" d="M 13.433594 21.953125 L 17.621094 0.835938 C 17.621094 0.835938 37.273438 0.15625 79.96875 0.835938 C 122.667969 1.515625 158.585938 42.972656 149.550781 90.859375 C 140.515625 138.75 122.894531 224.144531 122.894531 224.144531 L 100.300781 224.144531 L 128.316406 89.953125 C 128.316406 89.953125 137.210938 24.046875 77.710938 22.183594 C 26.988281 20.597656 28.898438 21.949219 13.433594 21.953125 "/>';n+='<path style=" stroke:none;fill-rule:nonzero;fill:rgb(80.799866%,8.999634%,11.799622%);fill-opacity:1;" d="M 153.308594 78 C 153.308594 78 206.226563 78.539063 214.867188 77.460938 C 223.507813 76.378906 229.449219 73.675781 234.308594 56.398438 L 157.957031 56.398438 Z M 221.890625 0.238281 C 198.667969 -0.300781 170.050781 0.238281 170.050781 0.238281 L 165.515625 21.300781 L 242.949219 21.300781 C 242.589844 14.792969 239.765625 0.65625 221.890625 0.238281 Z M 159.121094 50.996094 L 235.820313 50.996094 C 238.882813 39.964844 241.328125 30.714844 242.386719 26.699219 L 164.351563 26.699219 L 159.121094 50.996094 "/><\/g><\/svg>';n+="<\/span> Terminais de ônibus<\/li><\/ul><\/div><\/div>";$(n).appendTo($(t));$(".leaflet-control-container").on("click",function(n){var t=$(n.target);t.is("#btn-mostrarLegendaKML")?$("#myddOptsDiv").fadeToggle({duration:"fast",complete:function(){$(this).is(":visible")?t.text("Ocultar"):t.text("Definir sentido")}}):t.is("#btn-legendaVia")?$("#myddLstLgd").fadeToggle({duration:"fast",complete:function(){$(this).is(":visible")?t.text("Ocultar"):t.text("Legenda")}}):t.is(".dropDownItemDiv")?($(".dropDownItemDiv").each(function(){$(this).removeClass("active")}),t.addClass("active"),$("#AMBOS").hasClass("active")?r():r()):(t.is("#kmlCorredores")||t.is("#kmlVias"))&&r()});return t};u.addTo(t);c=function(){i!=null&&(t.removeLayer(i),i=null);h()};o=function(t){c();var u,r=new Date,f,e,o,s,h;f=r.getFullYear();e=n.Utils.pad(r.getMonth(),2);o=n.Utils.pad(r.getDate(),2);s=n.Utils.pad(r.getHours(),2);h=n.Utils.pad(r.getMinutes(),2);u=location.protocol+"//"+location.host+l+"FluidezDeOlhoNaVia/"+t+"?v="+(f+""+e+""+o+""+s+""+h);i.load(u)};r=function(){var r="T",f="CORREDORES E VIAS",e=$("#kmlCorredores").is(":checked"),s=$("#kmlVias").is(":checked"),n,u;e&&!s?(r="C",f="CORREDORES"):!e&&s&&(r="O",f="OUTRAS VIAS");var t="H",i="AMBOS",h=$("#CB").hasClass("active")?!0:!1,c=$("#BC").hasClass("active")?!0:!1,l=$("#AMBOS").hasClass("active")?!0:!1;h&&!c?(t="CB",i="BAIRRO"):!h&&c?(t="BC",i="CENTRO"):l&&(t="A");n=r+t;n=="TH"&&(u=new Date,u.getHours()>=16||u.getHours()<4?(n="TCB",i="BAIRRO",$("#CB").addClass("dropDownItemDiv active")):(n="TBC",i="CENTRO",$("#BC").addClass("dropDownItemDiv active")));o(n)},function v(n){n===!0&&r();a=setTimeout(function(){v(e)},ct)}(!0);setTimeout(function(){L.DomEvent.on(t,"resize",function(n){L.DomEvent.stopPropagation(n)})},1e3)}}}(),Fluidez:function(){return{setHorarioAtualizacao:function(n){$(".horarioref DIV:eq(0)").empty().html(n)}}}(),Utils:function(){return{encodeURI:function(n){var t=n;return n.length>2&&(t=n.replace(/\s/g,"%20"),t=t.replace(/\//g,"%2F")),t},decodeURI:function(n,t){return t==!0?decodeURIComponent(n):n},analytics:function(){var t=location.pathname+location.search+location.hash;try{location.hash&&(t=location.hash);ga("send","pageview",{page:n.Utils.decodeURI(t),title:n.Utils.getPageTitle(!0)})}catch(i){i.name!=="ReferenceError"&&ga("send","pageview")}},isNumeric:function(n){return!n||n==""?!1:isFinite(n)},configurarTopo:function(t){var i=$(".headerWeb");t==0?($(".topoMinWEB").remove(),i.css("height","28"),i.removeClass("bgHeaderWeb"),i.prepend('<div class="topoMinWEB"><h1><a href="/" target="_self" title="Voltar para a página principal"><img src="'+h+'imagens/logoOv.png" alt="Olho Vivo SPTrans" style="margin-top: 7px;" /><\/a><a href="http://www.sptrans.com.br" target="_blank" rel="external" title="Visitar o site da SPTrans"><img src="'+h+'imagens/logo.png" alt="Previsão Internet SPTrans" style="width:61px;height:26px;float: right;margin-top:'+(n.Utils.Navigator.isIE7()?"-18px":"8px")+';" /><\/a><\/h1><\/div>')):t==1&&(i.css("height",""),$(".topoMinWEB").remove(),i.addClass("bgHeaderWeb"))},retornarListaCorredores:function(t,r){if(r)var u=$.getJSON(c.Corredor,function(n){if(n){for(var i,f=n.length,u=0;u<f;u++)if(i=n[u],i.CodCorredor=i.cc,i.Nome=i.nc,parseInt(i.CodCorredor)==parseInt(t))return r(i.Nome),!1}else r(null)}).error(function(t){n.Utils.getErrorMessage(t,i.CONEXAO)===i.UNAUTHORIZED&&n.Sec.Auth(function(){poll(!0)})})},replaceSentido:function(n){var t='<span class="icSentido">&nbsp;<\/span>{S}',n=n||"",i=n;return(n.lastIndexOf("BC")>-1||n.lastIndexOf("CB")>-1)&&(i=n.replace(" BC",t.replace("{S}","Centro")).replace(" CB",t.replace("{S}","Bairro"))),i},log:function(n,t){t?alert(n):console.log(n)},getParameterByName:function(t,i,r){var f=i?i:window.location,e="[?&]"+t+"=([\\wà-ú\\-\\.\\s%]+)",u=RegExp(e,"gi").exec(n.Utils.decodeURI(f,r));return u&&n.Utils.decodeURI(u[1].replace(/\+/g," "))},saveCookie:function(t,i,r){var u=new Date,f;u.setTime(u.getTime());r&&(r=r*864e5);f=new Date(u.getTime()+r);document.cookie=[n.Utils.encodeURI(t),"=",n.Utils.encodeURI(i),r?";expires="+f.toGMTString():"",";"].join("")},getCookie:function(t){var i;return(i=new RegExp("(?:^|; )"+n.Utils.encodeURI(t)+"=([^;]*)").exec(document.cookie))?n.Utils.decodeURI(i[1]):null},isMobile:function(){var n=navigator.userAgent||navigator.vendor||window.opera;return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(n)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(n.substr(0,4))},enableEnterKeyOnSearch:function(t,i){if(!n.Utils.isMobile()){if(t.length<1||i.length<1)return;t.live("keypress",function(n){n.keyCode==13&&($(this).blur(),i.trigger("click"),n.stopImmediatePropagation())})}},getErrorMessage:function(t,r,u){var f="Ocorreu uma falha não identificada no Olho Vivo. Tente novamente.",e=null;if(t!==null)if(typeof t=="string")f=t.toString();else switch(t.status){case 401:f="Falha ao atualizar as informações. Aguarde um instante.<br/>Se o problema persistir recarregue a página.";e=401;break;default:f=t.statusText}else r==i.CONEXAO&&(f="Ocorreu um erro na tentativa de conexão com o webservice.<br/>Por favor tente novamente.");return u&&n.Utils.Alert.show("Erro",f),e},getPageTitle:function(n){var t=$.trim($("TITLE").text());return t.indexOf("-")>-1&&(t=n?t.substring(t.indexOf("-")+1,t.length):t.substring(0,t.indexOf("-"))),$.trim(t)},setPageTitle:function(n,t){n&&n.attr("data-title",t);document.title=t},applyVoiceSearchOnAddress:function(){$("#address").attr("x-webkit-speech","x-webkit-speech").bind({webkitspeechchange:function(n){for(var t=0,i=[],f=$(this).val().toLowerCase(),r=n.originalEvent.results.length;t<r;t++)i.push(n.originalEvent.results[t].utterance);$(this).empty().autocomplete({delay:100,minLength:0,source:i,select:function(n,t){$("#address").val(t.item.value);$("#btPesquisaEndereco").trigger(u)}}).focus()},focus:function(){$(this).autocomplete("search","")}})},verifyAppCacheUpdate:function(){window.applicationCache&&window.applicationCache.addEventListener("updateready",function(){window.applicationCache.status==window.applicationCache.UPDATEREADY&&(window.applicationCache.swapCache(),confirm("Uma nova versão do Olho Vivo está disponível. Gostaria de atualizar agora?")&&window.location.reload())},!1)},formatString:function(){for(var i,t=arguments[0],r=arguments.length-1,n=0;n<r;n++)i=new RegExp("\\{"+n+"\\}","gm"),t=t.replace(i,arguments[n+1]);return t},trim:function(n){return n.replace(/(\s)\1/g,"")},inputDataValidate:function(t){var i=/^(.)\1{2,}/.exec(n.Utils.trim(t)),r=!1;return i?(console.log("ERRO! o caracter "+i[1]+' possui mais de três repetições: "'+i[0]+'"'),r=!1):r=!0,r},pad:function(n,t,i){for(var r=""+n,u=i||"0";r.length<t;)r=u+r;return r},Navigator:function(){var n=navigator.userAgent.toLowerCase();return{isIE:function(){return/Trident.*rv:11|msie/i.test(n)},isIE7:function(){return/msie\s7/.test(n)},isChrome:function(){return/chrome/.test(n)}}}(),Alert:function(){return{show:function(t,i,r){var f=$("#boxAlert"),e;r||(r="#sp");$(r).addClass("segundoPlano");f.addClass("pop in").html("<p>"+i+"<\/p>").fadeIn("slow").live(u,function(){n.Utils.Alert.hide()}).css({position:"absolute",top:($(window).height()-f.outerHeight())/2+$(window).scrollTop()+"px",left:($(window).width()-f.outerWidth())/2+$(window).scrollLeft()+"px"});e=setTimeout(function(){n.Utils.Alert.hide(r)},4e3)},hide:function(n){$("#boxAlert").fadeOut("slow");$(n).removeClass("segundoPlano")}}}(),Location:function(){return{mostrarPosicaoUsuario:function(){if("geolocation"in navigator){var n=function(n){s=L.marker([n.coords.latitude,n.coords.longitude],{renderer:nt,icon:lt}).bindPopup("<div class='textCenter btShowMeOnMap' title='Clique para aproximar'>sua localização aproximada<\/div>",{offset:[20,20]});s.addTo(t);navigator.geolocation.watchPosition(function(n){s.setLatLng([n.coords.latitude,n.coords.longitude])});$("#map_canvas2").on("click",".btShowMeOnMap",function(){t.setView(s.getLatLng(),17)})};navigator.geolocation.getCurrentPosition(n,null,{enableHighAccuracy:!0,timeout:5e3,maximumAge:0})}},gpsEnabled:function(){var n=!1;return navigator.geolocation?navigator.geolocation.getCurrentPosition(function(){n=!0},function(){n=!1}):n=!1,n}}}(),inlinePopup:function(n,t){if(n)$("<div class='simplePopup ui-body-s'><div class='sp-container'><div class='sp-btnAction'>x<\/div><div class='sp-content'>                            <p style='font-weight:700'>"+(!t?"Atenção":t)+"<\/p><p>"+n+"<\/p>                            <\/div><\/div><\/div>").appendTo("BODY").on("click",function(){$(this).fadeOut({duration:300,complete:function(){$(this).remove()}})})}}}(),Sec:function(){return{Auth:function(t){var i=t||null;if(!n.Utils.isMobile())return!1;$.ajax({type:"POST",url:l+"WebApp/Auth",cache:!1,success:i})}}}(),Mobile:function(){return{Utils:function(){return{configurarOrientacaoDispositivo:function(){var n=$("div:jqmData(role='header')").find(".ui-title");n.css("margin","1.4em")},abrirPopupAtalhos:function(n){switch(n){case ot.LINHA:var t=arguments[1];$(this).simpledialog2({mode:"button",animate:!1,headerText:"Mais opções",headerClose:!1,forceInput:!1,buttonPrompt:"Mais opções da linha "+t.letreiro,zindex:9999,themeHeader:"s",buttons:{"Mapa completo da linha":{click:function(){var n=t.cdlinha.replace(t.cdlinha[0],"");window.location.hash="#"+encodeURIComponent("sp?cat=Mapa2&l="+n+"&s="+t.letreiro+"&sc="+t.denominacao)},theme:"s",icon:"arrow-r"},"Informações da linha":{click:function(){$(this).simpledialog2({mode:"button",animate:!1,headerText:"Atenção",buttonPrompt:"Ao acessar este link você será direcionado para o site da SPTrans. Deseja continuar?",zindex:9999,themeHeader:"s",buttons:{Sim:{click:function(){window.open("http://www.sptrans.com.br/itinerarios/?tipoHeaderPesquisa=5&noNome="+t.letreiro)},theme:"s"},"Não":{click:function(){},theme:"s"}}})},theme:"s",icon:"info"},Cancelar:{click:function(){},theme:"s",icon:"delete"}}})}}}}()}}()}}();ga("create","UA-11455060-5","sptrans.com.br");n.Init()}();
/*! jQuery Mobile v1.1.2 9a15f1aaf99faa7913103f5ea19ef6959b73d763 jquerymobile.com | jquery.org/license */
(function (a, c, b) { typeof define === "function" && define.amd ? define(["jquery"], function (d) { b(d, a, c); return d.mobile; }) : b(a.jQuery, a, c); })(this, document, function (a, c, b, d) { (function (ao, am, an, al) { function ak(e) { for (; e && typeof e.originalEvent !== "undefined";) { e = e.originalEvent; } return e; } function aj(f) { for (var j = {}, h, k; f;) { h = ao.data(f, U); for (k in h) { if (h[k]) { j[k] = j.hasVirtualBinding = true; } } f = f.parentNode; } return j; } function ai() { F && (clearTimeout(F), F = 0); F = setTimeout(function () { R = F = 0; X.length = 0; V = false; P = true; }, ao.vmouse.resetTimerDuration); } function ah(e, m, p) { var k, l; if (!(l = p && p[e])) { if (p = !p) { ao: { for (p = m.target; p;) { if ((l = ao.data(p, U)) && (!e || l[e])) { break ao; } p = p.parentNode; } p = null; } } l = p; } if (l) { k = m; var p = k.type, n, o; k = ao.Event(k); k.type = e; l = k.originalEvent; n = ao.event.props; p.search(/^(mouse|click)/) > -1 && (n = T); if (l) { for (o = n.length; o;) { e = n[--o], k[e] = l[e]; } } if (p.search(/mouse(down|up)|click/) > -1 && !k.which) { k.which = 1; } if (p.search(/^touch/) !== -1 && (e = ak(l), p = e.touches, e = e.changedTouches, p = p && p.length ? p[0] : e && e.length ? e[0] : al)) { for (l = 0, len = O.length; l < len; l++) { e = O[l], k[e] = p[e]; } } ao(m.target).trigger(k); } return k; } function ag(f) { var g = ao.data(f.target, S); if (!V && (!R || R !== g)) { if (g = ah("v" + f.type, f)) { g.isDefaultPrevented() && f.preventDefault(), g.isPropagationStopped() && f.stopPropagation(), g.isImmediatePropagationStopped() && f.stopImmediatePropagation(); } } } function Y(e) { var h = ak(e).touches, f; if (h && h.length === 1 && (f = e.target, h = aj(f), h.hasVirtualBinding)) { R = r++, ao.data(f, S, R), F && (clearTimeout(F), F = 0), Z = P = false, f = ak(e).touches[0], L = f.pageX, W = f.pageY, ah("vmouseover", e, h), ah("vmousedown", e, h); } } function aa(e) { P || (Z || ah("vmousecancel", e, aj(e.target)), Z = true, ai()); } function ad(e) { if (!P) { var h = ak(e).touches[0], g = Z, f = ao.vmouse.moveDistanceThreshold; Z = Z || Math.abs(h.pageX - L) > f || Math.abs(h.pageY - W) > f; flags = aj(e.target); Z && !g && ah("vmousecancel", e, flags); ah("vmousemove", e, flags); ai(); } } function Q(f) { if (!P) { P = true; var e = aj(f.target), g; ah("vmouseup", f, e); if (!Z && (g = ah("vclick", f, e)) && g.isDefaultPrevented()) { g = ak(f).changedTouches[0], X.push({ touchID: R, x: g.clientX, y: g.clientY }), V = true; } ah("vmouseout", f, e); Z = false; ai(); } } function ac(f) { var f = ao.data(f, U), g; if (f) { for (g in f) { if (f[g]) { return true; } } } return false; } function af() { } function ab(f) { var g = f.substr(1); return { setup: function () { ac(this) || ao.data(this, U, {}); ao.data(this, U)[f] = true; ae[f] = (ae[f] || 0) + 1; ae[f] === 1 && I.bind(g, ag); ao(this).bind(g, af); if (C) { ae.touchstart = (ae.touchstart || 0) + 1, ae.touchstart === 1 && I.bind("touchstart", Y).bind("touchend", Q).bind("touchmove", ad).bind("scroll", aa); } }, teardown: function () { --ae[f]; ae[f] || I.unbind(g, ag); C && (--ae.touchstart, ae.touchstart || I.unbind("touchstart", Y).unbind("touchmove", ad).unbind("touchend", Q).unbind("scroll", aa)); var h = ao(this), e = ao.data(this, U); e && (e[f] = false); h.unbind(g, af); ac(this) || h.removeData(U); } }; } var U = "virtualMouseBindings", S = "virtualTouchID", am = "vmouseover vmousedown vmousemove vmouseup vclick vmouseout vmousecancel".split(" "), O = "clientX clientY pageX pageY screenX screenY".split(" "), T = ao.event.props.concat(ao.event.mouseHooks ? ao.event.mouseHooks.props : []), ae = {}, F = 0, L = 0, W = 0, Z = false, X = [], V = false, P = false, C = "addEventListener" in an, I = ao(an), r = 1, R = 0; ao.vmouse = { moveDistanceThreshold: 10, clickDistanceThreshold: 10, resetTimerDuration: 1500 }; for (var E = 0; E < am.length; E++) { ao.event.special[am[E]] = ab(am[E]); } C && an.addEventListener("click", function (k) { var p = X.length, s = k.target, n, q, l, m, o; if (p) { n = k.clientX; q = k.clientY; threshold = ao.vmouse.clickDistanceThreshold; for (l = s; l;) { for (m = 0; m < p; m++) { if (o = X[m], l === s && Math.abs(o.x - n) < threshold && Math.abs(o.y - q) < threshold || ao.data(l, S) === o.touchID) { k.preventDefault(); k.stopPropagation(); return; } } l = l.parentNode; } } }, true); })(a, c, b); (function (u, s, t) { function r(e) { e = e || location.href; return "#" + e.replace(/^[^#]*#?(.*)$/, "$1"); } var p = "hashchange", o = b, n, m = u.event.special, l = o.documentMode, k = "on" + p in s && (l === t || l > 7); u.fn[p] = function (e) { return e ? this.bind(p, e) : this.trigger(p); }; u.fn[p].delay = 50; m[p] = u.extend(m[p], { setup: function () { if (k) { return false; } u(n.start); }, teardown: function () { if (k) { return false; } u(n.stop); } }); n = function () { function w() { var g = r(), h = q(y); if (g !== y) { x(y = g, h), u(s).trigger(p); } else { if (h !== y) { location.href = location.href.replace(/#.*/, "") + h; } } v = setTimeout(w, u.fn[p].delay); } var f = {}, v, y = r(), e = function (g) { return g; }, x = e, q = e; f.start = function () { v || w(); }; f.stop = function () { v && clearTimeout(v); v = t; }; u.browser.msie && !k && function () { var g, h; f.start = function () { if (!g) { h = (h = u.fn[p].src) && h + r(), g = u('<iframe tabindex="-1" title="empty"/>').hide().one("load", function () { h || x(r()); w(); }).attr("src", h || "javascript:0").insertAfter("body")[0].contentWindow, o.onpropertychange = function () { try { if (event.propertyName === "title") { g.document.title = o.title; } } catch (j) { } }; } }; f.stop = e; q = function () { return r(g.location.href); }; x = function (C, A) { var B = g.document, z = u.fn[p].domain; if (C !== A) { B.title = o.title, B.open(), z && B.write('<script>document.domain="' + z + '"<\/script>'), B.close(), g.location.hash = C; } }; }(); return f; }(); })(a, this); (function (f, h) { if (f.cleanData) { var e = f.cleanData; f.cleanData = function (l) { for (var k = 0, j; (j = l[k]) != null; k++) { f(j).triggerHandler("remove"); } e(l); }; } else { var g = f.fn.remove; f.fn.remove = function (j, k) { return this.each(function () { k || (!j || f.filter(j, [this]).length) && f("*", this).add([this]).each(function () { f(this).triggerHandler("remove"); }); return g.call(f(this), j, k); }); }; } f.widget = function (k, o, m) { var n = k.split(".")[0], l, k = k.split(".")[1]; l = n + "-" + k; if (!m) { m = o, o = f.Widget; } f.expr[":"][l] = function (j) { return !!f.data(j, k); }; f[n] = f[n] || {}; f[n][k] = function (p, j) { arguments.length && this._createWidget(p, j); }; o = new o; o.options = f.extend(true, {}, o.options); f[n][k].prototype = f.extend(true, o, { namespace: n, widgetName: k, widgetEventPrefix: f[n][k].prototype.widgetEventPrefix || k, widgetBaseClass: l }, m); f.widget.bridge(k, f[n][k]); }; f.widget.bridge = function (j, k) { f.fn[j] = function (n) { var m = typeof n === "string", l = Array.prototype.slice.call(arguments, 1), o = this, n = !m && l.length ? f.extend.apply(null, [true, n].concat(l)) : n; if (m && n.charAt(0) === "_") { return o; } m ? this.each(function () { var q = f.data(this, j); if (!q) { throw "cannot call methods on " + j + " prior to initialization; attempted to call method '" + n + "'"; } if (!f.isFunction(q[n])) { throw "no such method '" + n + "' for " + j + " widget instance"; } var p = q[n].apply(q, l); if (p !== q && p !== h) { return o = p, false; } }) : this.each(function () { var p = f.data(this, j); p ? p.option(n || {})._init() : f.data(this, j, new k(n, this)); }); return o; }; }; f.Widget = function (k, j) { arguments.length && this._createWidget(k, j); }; f.Widget.prototype = { widgetName: "widget", widgetEventPrefix: "", options: { disabled: false }, _createWidget: function (j, l) { f.data(l, this.widgetName, this); this.element = f(l); this.options = f.extend(true, {}, this.options, this._getCreateOptions(), j); var k = this; this.element.bind("remove." + this.widgetName, function () { k.destroy(); }); this._create(); this._trigger("create"); this._init(); }, _getCreateOptions: function () { var j = {}; f.metadata && (j = f.metadata.get(element)[this.widgetName]); return j; }, _create: function () { }, _init: function () { }, destroy: function () { this.element.unbind("." + this.widgetName).removeData(this.widgetName); this.widget().unbind("." + this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass + "-disabled ui-state-disabled"); }, widget: function () { return this.element; }, option: function (j, l) { var k = j; if (arguments.length === 0) { return f.extend({}, this.options); } if (typeof j === "string") { if (l === h) { return this.options[j]; } k = {}; k[j] = l; } this._setOptions(k); return this; }, _setOptions: function (j) { var k = this; f.each(j, function (m, l) { k._setOption(m, l); }); return this; }, _setOption: function (k, j) { this.options[k] = j; k === "disabled" && this.widget()[j ? "addClass" : "removeClass"](this.widgetBaseClass + "-disabled ui-state-disabled").attr("aria-disabled", j); return this; }, enable: function () { return this._setOption("disabled", false); }, disable: function () { return this._setOption("disabled", true); }, _trigger: function (k, o, n) { var m = this.options[k], o = f.Event(o); o.type = (k === this.widgetEventPrefix ? k : this.widgetEventPrefix + k).toLowerCase(); n = n || {}; if (o.originalEvent) { for (var k = f.event.props.length, l; k;) { l = f.event.props[--k], o[l] = o.originalEvent[l]; } } this.element.trigger(o, n); return !(f.isFunction(m) && m.call(this.element[0], o, n) === false || o.isDefaultPrevented()); } }; })(a); (function (e, f) { e.widget("mobile.widget", { _createWidget: function () { e.Widget.prototype._createWidget.apply(this, arguments); this._trigger("init"); }, _getCreateOptions: function () { var g = this.element, h = {}; e.each(this.options, function (j) { var k = g.jqmData(j.replace(/[A-Z]/g, function (l) { return "-" + l.toLowerCase(); })); k !== f && (h[j] = k); }); return h; }, enhanceWithin: function (g, h) { this.enhance(e(this.options.initSelector, e(g)), h); }, enhance: function (g, k) { var j, h = e(g), h = e.mobile.enhanceable(h); k && h.length && (j = (j = e.mobile.closestPageData(h)) && j.keepNativeSelector() || "", h = h.not(j)); h[this.widgetName](); }, raise: function (g) { throw "Widget [" + this.widgetName + "]: " + g; } }); })(a); (function (h, m, g) { var l = {}; h.mobile = h.extend({}, { version: "1.1.2", ns: "", subPageUrlKey: "ui-page", activePageClass: "ui-page-active", activeBtnClass: "ui-btn-active", focusClass: "ui-focus", ajaxEnabled: true, hashListeningEnabled: true, linkBindingEnabled: true, defaultPageTransition: "fade", maxTransitionWidth: false, minScrollBack: 250, touchOverflowEnabled: false, defaultDialogTransition: "pop", loadingMessage: "loading", pageLoadErrorMessage: "Error Loading Page", loadingMessageTextVisible: false, loadingMessageTheme: "a", pageLoadErrorMessageTheme: "e", phonegapNavigationEnabled: false, autoInitializePage: true, pushStateEnabled: true, ignoreContentEnabled: false, orientationChangeEnabled: true, buttonMarkup: { hoverDelay: 200 }, keyCode: { ALT: 18, BACKSPACE: 8, CAPS_LOCK: 20, COMMA: 188, COMMAND: 91, COMMAND_LEFT: 91, COMMAND_RIGHT: 93, CONTROL: 17, DELETE: 46, DOWN: 40, END: 35, ENTER: 13, ESCAPE: 27, HOME: 36, INSERT: 45, LEFT: 37, MENU: 93, NUMPAD_ADD: 107, NUMPAD_DECIMAL: 110, NUMPAD_DIVIDE: 111, NUMPAD_ENTER: 108, NUMPAD_MULTIPLY: 106, NUMPAD_SUBTRACT: 109, PAGE_DOWN: 34, PAGE_UP: 33, PERIOD: 190, RIGHT: 39, SHIFT: 16, SPACE: 32, TAB: 9, UP: 38, WINDOWS: 91 }, silentScroll: function (e) { if (h.type(e) !== "number") { e = h.mobile.defaultHomeScroll; } h.event.special.scrollstart.enabled = false; setTimeout(function () { m.scrollTo(0, e); h(b).trigger("silentscroll", { x: 0, y: e }); }, 20); setTimeout(function () { h.event.special.scrollstart.enabled = true; }, 150); }, nsNormalizeDict: l, nsNormalize: function (e) { return !e ? void 0 : l[e] || (l[e] = h.camelCase(h.mobile.ns + e)); }, getInheritedTheme: function (p, n) { for (var t = p[0], s = "", r = /ui-(bar|body|overlay)-([a-z])\b/, q, o; t;) { if ((q = t.className || "") && (o = r.exec(q)) && (s = o[2])) { break; } t = t.parentNode; } return s || n || "a"; }, closestPageData: function (e) { return e.closest(':jqmData(role="page"), :jqmData(role="dialog")').data("page"); }, enhanceable: function (e) { return this.haveParents(e, "enhance"); }, hijackable: function (e) { return this.haveParents(e, "ajax"); }, haveParents: function (p, v) { if (!h.mobile.ignoreContentEnabled) { return p; } for (var t = p.length, s = h(), r, o, q, u = 0; u < t; u++) { o = p.eq(u); q = false; for (r = p[u]; r;) { if ((r.getAttribute ? r.getAttribute("data-" + h.mobile.ns + v) : "") === "false") { q = true; break; } r = r.parentNode; } q || (s = s.add(o)); } return s; }, getScreenHeight: function () { return m.innerHeight || h(m).height(); } }, h.mobile); h.fn.jqmData = function (o, n) { var f; typeof o != "undefined" && (o && (o = h.mobile.nsNormalize(o)), f = arguments.length < 2 || n === g ? this.data(o) : this.data(o, n)); return f; }; h.jqmData = function (f, p, o) { var n; typeof p != "undefined" && (n = h.data(f, p ? h.mobile.nsNormalize(p) : p, o)); return n; }; h.fn.jqmRemoveData = function (e) { return this.removeData(h.mobile.nsNormalize(e)); }; h.jqmRemoveData = function (e, f) { return h.removeData(e, h.mobile.nsNormalize(f)); }; h.fn.removeWithDependents = function () { h.removeWithDependents(this); }; h.removeWithDependents = function (e) { e = h(e); (e.jqmData("dependents") || h()).remove(); e.remove(); }; h.fn.addDependents = function (e) { h.addDependents(h(this), e); }; h.addDependents = function (e, n) { var f = h(e).jqmData("dependents") || h(); h(e).jqmData("dependents", h.merge(f, n)); }; h.fn.getEncodedText = function () { return h("<div/>").text(h(this).text()).html(); }; h.fn.jqmEnhanceable = function () { return h.mobile.enhanceable(this); }; h.fn.jqmHijackable = function () { return h.mobile.hijackable(this); }; var k = h.find, j = /:jqmData\(([^)]*)\)/g; h.find = function (e, o, n, f) { e = e.replace(j, "[data-" + (h.mobile.ns || "") + "$1]"); return k.call(this, e, o, n, f); }; h.extend(h.find, k); h.find.matches = function (e, f) { return h.find(e, null, null, f); }; h.find.matchesSelector = function (e, f) { return h.find(f, null, null, [e]).length > 0; }; })(a, this); (function (e) { e(c); var f = e("html"); e.mobile.media = function () { var g = {}, j = e("<div id='jquery-mediatest'></div>"), h = e("<body>").append(j); return function (k) { if (!(k in g)) { var m = b.createElement("style"), l = "@media " + k + " { #jquery-mediatest { position:absolute; } }"; m.type = "text/css"; m.styleSheet ? m.styleSheet.cssText = l : m.appendChild(b.createTextNode(l)); f.prepend(h).prepend(m); g[k] = j.css("position") === "absolute"; h.add(m).remove(); } return g[k]; }; }(); })(a); (function (w, u) { function v(f) { var e = f.charAt(0).toUpperCase() + f.substr(1), f = (f + " " + o.join(e + " ") + e).split(" "), g; for (g in f) { if (r[f[g]] !== u) { return true; } } } function t(g, f, z) { var y = b.createElement("div"), z = z ? [z] : o, x; for (i = 0; i < z.length; i++) { var p = z[i], q = "-" + p.charAt(0).toLowerCase() + p.substr(1) + "-" + g + ": " + f + ";", p = p.charAt(0).toUpperCase() + p.substr(1) + (g.charAt(0).toUpperCase() + g.substr(1)); y.setAttribute("style", q); y.style[p] && (x = true); } return !!x; } var s = w("<body>").prependTo("html"), r = s[0].style, o = ["Webkit", "Moz", "O"], n = "palmGetResource" in c, m = c.opera, k = c.operamini && {}.toString.call(c.operamini) === "[object OperaMini]", l = c.blackberry; w.extend(w.mobile, { browser: {} }); w.mobile.browser.ie = function () { for (var f = 3, e = b.createElement("div"), g = e.all || []; e.innerHTML = "<!--[if gt IE " + ++f + "]><br><![endif]-->", g[0];) { } return f > 4 ? f : !f; }(); w.extend(w.support, { orientation: "orientation" in c && "onorientationchange" in c, touch: "ontouchend" in b, cssTransitions: "WebKitTransitionEvent" in c || t("transition", "height 100ms linear") && !m, pushState: "pushState" in history && "replaceState" in history, mediaquery: w.mobile.media("only all"), cssPseudoElement: !!v("content"), touchOverflow: !!v("overflowScrolling"), cssTransform3d: t("perspective", "10px", "moz") || w.mobile.media("(-" + o.join("-transform-3d),(-") + "-transform-3d),(transform-3d)"), boxShadow: !!v("boxShadow") && !l, scrollTop: ("pageXOffset" in c || "scrollTop" in b.documentElement || "scrollTop" in s[0]) && !n && !k, dynamicBaseTag: function () { var e = location.protocol + "//" + location.host + location.pathname + "ui-dir/", q = w("head base"), p = null, f = "", h; q.length ? f = q.attr("href") : q = p = w("<base>", { href: e }).appendTo("head"); h = w("<a href='testurl' />").prependTo(s)[0].href; q[0].href = f || location.pathname; p && p.remove(); return h.indexOf(e) === 0; }(), cssPointerEvents: function () { var f = b.createElement("x"), e = b.documentElement, g = c.getComputedStyle; if (!("pointerEvents" in f.style)) { return false; } f.style.pointerEvents = "auto"; f.style.pointerEvents = "x"; e.appendChild(f); g = g && g(f, "").pointerEvents === "auto"; e.removeChild(f); return !!g; }() }); s.remove(); n = function () { var e = c.navigator.userAgent; return e.indexOf("Nokia") > -1 && (e.indexOf("Symbian/3") > -1 || e.indexOf("Series60/5") > -1) && e.indexOf("AppleWebKit") > -1 && e.match(/(BrowserNG|NokiaBrowser)\/7\.[0-3]/); }(); w.mobile.gradeA = function () { return w.support.mediaquery || w.mobile.browser.ie && w.mobile.browser.ie >= 7; }; w.mobile.ajaxBlacklist = c.blackberry && !c.WebKitPoint || k || n; n && w(function () { w("head link[rel='stylesheet']").attr("rel", "alternate stylesheet").attr("rel", "stylesheet"); }); w.support.boxShadow || w("html").addClass("ui-mobile-nosupport-boxshadow"); })(a); (function (k, q, j) { function p(f, r, h) { var g = h.type; h.type = r; k.event.handle.call(f, h); h.type = g; } k.each("touchstart touchmove touchend orientationchange throttledresize tap taphold swipe swipeleft swiperight scrollstart scrollstop".split(" "), function (e, f) { k.fn[f] = function (g) { return g ? this.bind(f, g) : this.trigger(f); }; k.attrFn[f] = true; }); var o = k.support.touch, n = o ? "touchstart" : "mousedown", m = o ? "touchend" : "mouseup", l = o ? "touchmove" : "mousemove"; k.event.special.scrollstart = { enabled: true, setup: function () { function f(e, g) { r = g; p(s, r ? "scrollstart" : "scrollstop", e); } var s = this, r, h; k(s).bind("touchmove scroll", function (e) { k.event.special.scrollstart.enabled && (r || f(e, true), clearTimeout(h), h = setTimeout(function () { f(e, false); }, 50)); }); } }; k.event.special.tap = { setup: function () { var e = this, f = k(e); f.bind("vmousedown", function (w) { function u() { clearTimeout(x); } function s() { u(); f.unbind("vclick", v).unbind("vmouseup", u); k(b).unbind("vmousecancel", s); } function v(g) { s(); t == g.target && p(e, "tap", g); } if (w.which && w.which !== 1) { return false; } var t = w.target, x; f.bind("vmouseup", u).bind("vclick", v); k(b).bind("vmousecancel", s); x = setTimeout(function () { p(e, "taphold", k.Event("taphold", { target: t })); }, 750); }); } }; k.event.special.swipe = { scrollSupressionThreshold: 10, durationThreshold: 1000, horizontalDistanceThreshold: 30, verticalDistanceThreshold: 75, setup: function () { var e = k(this); e.bind(n, function (s) { function r(f) { if (g) { var u = f.originalEvent.touches ? f.originalEvent.touches[0] : f; t = { time: (new Date).getTime(), coords: [u.pageX, u.pageY] }; Math.abs(g.coords[0] - t.coords[0]) > k.event.special.swipe.scrollSupressionThreshold && f.preventDefault(); } } var h = s.originalEvent.touches ? s.originalEvent.touches[0] : s, g = { time: (new Date).getTime(), coords: [h.pageX, h.pageY], origin: k(s.target) }, t; e.bind(l, r).one(m, function () { e.unbind(l, r); g && t && t.time - g.time < k.event.special.swipe.durationThreshold && Math.abs(g.coords[0] - t.coords[0]) > k.event.special.swipe.horizontalDistanceThreshold && Math.abs(g.coords[1] - t.coords[1]) < k.event.special.swipe.verticalDistanceThreshold && g.origin.trigger("swipe").trigger(g.coords[0] > t.coords[0] ? "swipeleft" : "swiperight"); g = t = j; }); }); } }; (function (z, y) { function x() { var e = v(); e !== t && (t = e, w.trigger("orientationchange")); } var w = z(y), v, t, s, u, r = { 0: true, 180: true }; if (z.support.orientation && (s = y.innerWidth || z(y).width(), u = y.innerHeight || z(y).height(), s = s > u && s - u > 50, u = r[y.orientation], s && u || !s && !u)) { r = { "-90": true, 90: true }; } z.event.special.orientationchange = { setup: function () { if (z.support.orientation && z.mobile.orientationChangeEnabled) { return false; } t = v(); w.bind("throttledresize", x); }, teardown: function () { if (z.support.orientation && z.mobile.orientationChangeEnabled) { return false; } w.unbind("throttledresize", x); }, add: function (f) { var e = f.handler; f.handler = function (g) { g.orientation = v(); return e.apply(this, arguments); }; } }; z.event.special.orientationchange.orientation = v = function () { var e = true, e = b.documentElement; return (e = z.support.orientation ? r[y.orientation] : e && e.clientWidth / e.clientHeight < 1.1) ? "portrait" : "landscape"; }; })(a, q); (function () { k.event.special.throttledresize = { setup: function () { k(this).bind("resize", f); }, teardown: function () { k(this).unbind("resize", f); } }; var f = function () { r = (new Date).getTime(); h = r - t; h >= 250 ? (t = r, k(this).trigger("throttledresize")) : (s && clearTimeout(s), s = setTimeout(f, 250 - h)); }, t = 0, s, r, h; })(); k.each({ scrollstop: "scrollstart", taphold: "tap", swipeleft: "swipe", swiperight: "swipe" }, function (e, f) { k.event.special[e] = { setup: function () { k(this).bind(f, k.noop); } }; }); })(a, this); (function (e) { e.widget("mobile.page", e.mobile.widget, { options: { theme: "c", domCache: false, keepNativeDefault: ":jqmData(role='none'), :jqmData(role='nojs')" }, _create: function () { var f = this; if (f._trigger("beforecreate") === false) { return false; } f.element.attr("tabindex", "0").addClass("ui-page ui-body-" + f.options.theme).bind("pagebeforehide", function () { f.removeContainerBackground(); }).bind("pagebeforeshow", function () { f.setContainerBackground(); }); }, removeContainerBackground: function () { e.mobile.pageContainer.removeClass("ui-overlay-" + e.mobile.getInheritedTheme(this.element.parent())); }, setContainerBackground: function (f) { this.options.theme && e.mobile.pageContainer.addClass("ui-overlay-" + (f || this.options.theme)); }, keepNativeSelector: function () { var f = this.options; return f.keepNative && e.trim(f.keepNative) && f.keepNative !== f.keepNativeDefault ? [f.keepNative, f.keepNativeDefault].join(", ") : f.keepNativeDefault; } }); })(a); (function (g, k, f) { var j = function (e) { e === f && (e = true); return function (E, D, C, s) { var B = new g.Deferred, z = D ? " reverse" : "", A = g.mobile.urlHistory.getActive().lastScroll || g.mobile.defaultHomeScroll, y = g.mobile.getScreenHeight(), p = g.mobile.maxTransitionWidth !== false && g(k).width() > g.mobile.maxTransitionWidth, w = !g.support.cssTransitions || p || !E || E === "none" || Math.max(g(k).scrollTop(), A) > g.mobile.getMaxScrollForTransition(), I = function () { g.mobile.pageContainer.toggleClass("ui-mobile-viewport-transitioning viewport-" + E); }, G = function () { g.event.special.scrollstart.enabled = false; k.scrollTo(0, A); setTimeout(function () { g.event.special.scrollstart.enabled = true; }, 150); }, F = function () { s.removeClass(g.mobile.activePageClass + " out in reverse " + E).height(""); }, p = function () { s && e && F(); C.css("z-index", -10); C.addClass(g.mobile.activePageClass + " ui-page-pre-in"); g.mobile.focusPage(C); C.height(y + A); G(); C.css("z-index", ""); w || C.animationComplete(H); C.removeClass(" ui-page-pre-in").addClass(E + " in" + z); w && H(); }, H = function () { e || s && F(); C.removeClass("out in reverse " + E).height(""); I(); g(k).scrollTop() !== A && G(); B.resolve(E, D, C, s, true); }; I(); s && !w ? (e ? s.animationComplete(p) : p(), s.height(y + g(k).scrollTop()).addClass(E + " out" + z)) : p(); return B.promise(); }; }, h = j(), j = j(false); g.mobile.defaultTransitionHandler = h; g.mobile.transitionHandlers = { "default": g.mobile.defaultTransitionHandler, sequential: h, simultaneous: j }; g.mobile.transitionFallbacks = {}; g.mobile.getMaxScrollForTransition = g.mobile.getMaxScrollForTransition || function () { return g.mobile.getScreenHeight() * 3; }; })(a, this); (function (aa, Y) { function Z(e) { R && (!R.closest(".ui-page-active").length || e) && R.removeClass(aa.mobile.activeBtnClass); R = null; } function X() { O = false; J.length > 0 && aa.mobile.changePage.apply(null, J.pop()); } function W(f, j, h, g) { j && j.data("page")._trigger("beforehide", null, { nextPage: f }); f.data("page")._trigger("beforeshow", null, { prevPage: j || aa("") }); aa.mobile.hidePageLoadingMsg(); h && !aa.support.cssTransform3d && aa.mobile.transitionFallbacks[h] && (h = aa.mobile.transitionFallbacks[h]); h = (aa.mobile.transitionHandlers[h || "default"] || aa.mobile.defaultTransitionHandler)(h, g, f, j); h.done(function () { j && j.data("page")._trigger("hide", null, { nextPage: f }); f.data("page")._trigger("show", null, { prevPage: j || aa("") }); }); return h; } function V() { var f = aa("." + aa.mobile.activePageClass), m = parseFloat(f.css("padding-top")), l = parseFloat(f.css("padding-bottom")), j = parseFloat(f.css("border-top-width")), h = parseFloat(f.css("border-bottom-width")); f.css("min-height", k() - m - l - j - h); } function U(e, f) { f && e.attr("data-" + aa.mobile.ns + "role", f); e.page(); } function T(e) { for (; e;) { if (typeof e.nodeName === "string" && e.nodeName.toLowerCase() == "a") { break; } e = e.parentNode; } return e; } function S(e) { var e = aa(e).closest(".ui-page").jqmData("url"), f = G.hrefNoHash; if (!e || !Q.isPath(e)) { e = f; } return Q.makeUrlAbsolute(e, f); } var L = aa(c); aa("html"); var N = aa("head"), Q = { urlParseRE: /^(((([^:\/#\?]+:)?(?:(\/\/)((?:(([^:@\/#\?]+)(?:\:([^:@\/#\?]+))?)@)?(([^:\/#\?\]\[]+|\[[^\/\]@#?]+\])(?:\:([0-9]+))?))?)?)?((\/?(?:[^\/\?#]+\/+)*)([^\?#]*)))?(\?[^#]+)?)(#.*)?/, getLocation: function (f) { var e = f ? this.parseUrl(f) : location, f = this.parseUrl(f || location.href).hash; return e.protocol + "//" + e.host + e.pathname + e.search + (f === "#" ? "" : f); }, parseLocation: function () { return this.parseUrl(this.getLocation()); }, parseUrl: function (e) { if (aa.type(e) === "object") { return e; } e = Q.urlParseRE.exec(e || "") || []; return { href: e[0] || "", hrefNoHash: e[1] || "", hrefNoSearch: e[2] || "", domain: e[3] || "", protocol: e[4] || "", doubleSlash: e[5] || "", authority: e[6] || "", username: e[8] || "", password: e[9] || "", host: e[10] || "", hostname: e[11] || "", port: e[12] || "", pathname: e[13] || "", directory: e[14] || "", filename: e[15] || "", search: e[16] || "", hash: e[17] || "" }; }, makePathAbsolute: function (h, f) { if (h && h.charAt(0) === "/") { return h; } for (var h = h || "", n = (f = f ? f.replace(/^\/|(\/[^\/]*|[^\/]+)$/g, "") : "") ? f.split("/") : [], m = h.split("/"), l = 0; l < m.length; l++) { var j = m[l]; switch (j) { case ".": break; case "..": n.length && n.pop(); break; default: n.push(j); } } return "/" + n.join("/"); }, isSameDomain: function (f, e) { return Q.parseUrl(f).domain === Q.parseUrl(e).domain; }, isRelativeUrl: function (e) { return Q.parseUrl(e).protocol === ""; }, isAbsoluteUrl: function (e) { return Q.parseUrl(e).protocol !== ""; }, makeUrlAbsolute: function (v, u) { if (!Q.isRelativeUrl(v)) { return v; } u === Y && (u = G); var t = Q.parseUrl(v), r = Q.parseUrl(u), p = t.protocol || r.protocol, o = t.protocol ? t.doubleSlash : t.doubleSlash || r.doubleSlash, m = t.authority || r.authority, q = t.pathname !== "", l = Q.makePathAbsolute(t.pathname || r.filename, r.pathname); return p + o + m + l + (t.search || !q && r.search || "") + t.hash; }, addSearchParams: function (f, m) { var l = Q.parseUrl(f), j = typeof m === "object" ? aa.param(m) : m, h = l.search || "?"; return l.hrefNoSearch + h + (h.charAt(h.length - 1) !== "?" ? "&" : "") + j + (l.hash || ""); }, convertUrlToDataUrl: function (f) { var e = Q.parseUrl(f); if (Q.isEmbeddedPage(e)) { return e.hash.split(I)[0].replace(/^#/, ""); } else { if (Q.isSameDomain(e, G)) { return e.hrefNoHash.replace(G.domain, "").split(I)[0]; } } return f; }, get: function (e) { if (e === Y) { e = location.hash; } return Q.stripHash(e).replace(/[^\/]*\.[^\/*]+$/, ""); }, getFilePath: function (e) { var f = "&" + aa.mobile.subPageUrlKey; return e && e.split(f)[0].split(I)[0]; }, set: function (e) { location.hash = e; }, isPath: function (e) { return /\//.test(e); }, clean: function (e) { return e.replace(G.domain, ""); }, stripHash: function (e) { return e.replace(/^#/, ""); }, cleanHash: function (e) { return Q.stripHash(e.replace(/\?.*$/, "").replace(I, "")); }, isHashValid: function (e) { return /^#[^#]+$/.test(e); }, isExternal: function (e) { e = Q.parseUrl(e); return e.protocol && e.domain !== w.domain ? true : false; }, hasProtocol: function (e) { return /^(:?\w+:)/.test(e); }, isFirstPageUrl: function (e) { var e = Q.parseUrl(Q.makeUrlAbsolute(e, G)), f = aa.mobile.firstPage, f = f && f[0] ? f[0].id : Y; return (e.hrefNoHash === w.hrefNoHash || D && e.hrefNoHash === G.hrefNoHash) && (!e.hash || e.hash === "#" || f && e.hash.replace(/^#/, "") === f); }, isEmbeddedPage: function (e) { e = Q.parseUrl(e); return e.protocol !== "" ? e.hash && (e.hrefNoHash === w.hrefNoHash || D && e.hrefNoHash === G.hrefNoHash) : /^#/.test(e.href); }, isPermittedCrossDomainRequest: function (e, f) { return aa.mobile.allowCrossDomainPages && e.protocol === "file:" && f.search(/^https?:/) != -1; } }, R = null, P = { stack: [], activeIndex: 0, getActive: function () { return P.stack[P.activeIndex]; }, getPrev: function () { return P.stack[P.activeIndex - 1]; }, getNext: function () { return P.stack[P.activeIndex + 1]; }, addNew: function (g, f, l, j, h) { P.getNext() && P.clearForward(); P.stack.push({ url: g, transition: f, title: l, pageUrl: j, role: h }); P.activeIndex = P.stack.length - 1; }, clearForward: function () { P.stack = P.stack.slice(0, P.activeIndex + 1); }, directHashChange: function (f) { var l, j, h; this.getActive(); aa.each(P.stack, function (e, g) { decodeURIComponent(f.currentUrl) === decodeURIComponent(g.url) && (l = e < P.activeIndex, j = !l, h = e); }); this.activeIndex = h !== Y ? h : this.activeIndex; l ? (f.either || f.isBack)(true) : j && (f.either || f.isForward)(false); }, ignoreNextHashChange: false }, J = [], O = false, I = "&ui-state=dialog", C = N.children("base"), w = Q.parseLocation(), G = C.length ? Q.parseUrl(Q.makeUrlAbsolute(C.attr("href"), w.href)) : w, D = w.hrefNoHash !== G.hrefNoHash, k = aa.mobile.getScreenHeight, s = aa.support.dynamicBaseTag ? { element: C.length ? C : aa("<base>", { href: G.hrefNoHash }).prependTo(N), set: function (e) { s.element.attr("href", Q.makeUrlAbsolute(e, G)); }, reset: function () { s.element.attr("href", G.hrefNoHash); } } : Y; aa.mobile.back = function () { var e = c.navigator; this.phonegapNavigationEnabled && e && e.app && e.app.backHistory ? e.app.backHistory() : c.history.back(); }; aa.mobile.focusPage = function (f) { var e = f.find("[autofocus]"), g = f.find(".ui-title:eq(0)"); e.length ? e.focus() : g.length ? g.focus() : f.focus(); }; var H = true, M, K; M = function () { if (H) { var e = aa.mobile.urlHistory.getActive(); if (e) { var f = L.scrollTop(); e.lastScroll = f < aa.mobile.minScrollBack ? aa.mobile.defaultHomeScroll : f; } } }; K = function () { setTimeout(M, 100); }; L.bind(aa.support.pushState ? "popstate" : "hashchange", function () { H = false; }); L.one(aa.support.pushState ? "popstate" : "hashchange", function () { H = true; }); L.one("pagecontainercreate", function () { aa.mobile.pageContainer.bind("pagechange", function () { H = true; L.unbind("scrollstop", K); L.bind("scrollstop", K); }); }); L.bind("scrollstop", K); aa.fn.animationComplete = function (e) { return aa.support.cssTransitions ? aa(this).one("webkitAnimationEnd animationend", e) : (setTimeout(e, 0), aa(this)); }; aa.mobile.path = Q; aa.mobile.base = s; aa.mobile.urlHistory = P; aa.mobile.dialogHashKey = I; aa.mobile.allowCrossDomainPages = false; aa.mobile.getDocumentUrl = function (e) { return e ? aa.extend({}, w) : w.href; }; aa.mobile.getDocumentBase = function (e) { return e ? aa.extend({}, G) : G.href; }; aa.mobile._bindPageRemove = function () { var e = aa(this); !e.data("page").options.domCache && e.is(":jqmData(external-page='true')") && e.bind("pagehide.remove", function () { var f = aa(this), g = new aa.Event("pageremove"); f.trigger(g); g.isDefaultPrevented() || f.removeWithDependents(); }); }; aa.mobile.loadPage = function (F, E) { var B = aa.Deferred(), z = aa.extend({}, aa.mobile.loadPage.defaults, E), A = null, u = null, y = Q.makeUrlAbsolute(F, aa.mobile.activePage && S(aa.mobile.activePage) || G.hrefNoHash); if (z.data && z.type === "get") { y = Q.addSearchParams(y, z.data), z.data = Y; } if (z.data && z.type === "post") { z.reloadPage = true; } var j = Q.getFilePath(y), m = Q.convertUrlToDataUrl(y); z.pageContainer = z.pageContainer || aa.mobile.pageContainer; A = z.pageContainer.children("[data-" + aa.mobile.ns + "url='" + m + "']"); A.length === 0 && m && !Q.isPath(m) && (A = z.pageContainer.children("#" + m).attr("data-" + aa.mobile.ns + "url", m)); if (A.length === 0) { if (aa.mobile.firstPage && Q.isFirstPageUrl(j)) { aa.mobile.firstPage.parent().length && (A = aa(aa.mobile.firstPage)); } else { if (Q.isEmbeddedPage(j)) { return B.reject(y, E), B.promise(); } } } if (A.length) { if (!z.reloadPage) { return U(A, z.role), B.resolve(y, E, A), s && !E.prefetch && s.set(F), B.promise(); } u = A; } var x = z.pageContainer, ab = new aa.Event("pagebeforeload"), t = { url: F, absUrl: y, dataUrl: m, deferred: B, options: z }; x.trigger(ab, t); if (ab.isDefaultPrevented()) { return B.promise(); } if (z.showLoadMsg) { var g = setTimeout(function () { aa.mobile.showPageLoadingMsg(); }, z.loadMsgDelay); } s && typeof E.prefetch === "undefined" && s.reset(); !aa.mobile.allowCrossDomainPages && !Q.isSameDomain(w, y) ? B.reject(y, E) : aa.ajax({ url: j, type: z.type, data: z.data, dataType: "html", success: function (q, o, e) { var f = aa("<div></div>"), h = q.match(/<title[^>]*>([^<]*)/) && RegExp.$1, n = RegExp("\\bdata-" + aa.mobile.ns + "url=[\"']?([^\"'>]*)[\"']?"); RegExp("(<[^>]+\\bdata-" + aa.mobile.ns + "role=[\"']?page[\"']?[^>]*>)").test(q) && RegExp.$1 && n.test(RegExp.$1) && RegExp.$1 && (F = j = Q.getFilePath(RegExp.$1)); s && typeof E.prefetch === "undefined" && s.set(j); f.get(0).innerHTML = q; A = f.find(":jqmData(role='page'), :jqmData(role='dialog')").first(); A.length || (A = aa("<div data-" + aa.mobile.ns + "role='page'>" + q.split(/<\/?body[^>]*>/gmi)[1] + "</div>")); h && !A.jqmData("title") && (~h.indexOf("&") && (h = aa("<div>" + h + "</div>").text()), A.jqmData("title", h)); if (!aa.support.dynamicBaseTag) { var p = Q.get(j); A.find("[src], link[href], a[rel='external'], :jqmData(ajax='false'), a[target]").each(function () { var l = aa(this).is("[href]") ? "href" : aa(this).is("[src]") ? "src" : "action", r = aa(this).attr(l), r = r.replace(location.protocol + "//" + location.host + location.pathname, ""); /^(\w+:|#|\/)/.test(r) || aa(this).attr(l, p + r); }); } A.attr("data-" + aa.mobile.ns + "url", Q.convertUrlToDataUrl(j)).attr("data-" + aa.mobile.ns + "external-page", true).appendTo(z.pageContainer); A.one("pagecreate", aa.mobile._bindPageRemove); U(A, z.role); y.indexOf("&" + aa.mobile.subPageUrlKey) > -1 && (A = z.pageContainer.children("[data-" + aa.mobile.ns + "url='" + m + "']")); z.showLoadMsg && (clearTimeout(g), aa.mobile.hidePageLoadingMsg()); t.xhr = e; t.textStatus = o; t.page = A; z.pageContainer.trigger("pageload", t); B.resolve(y, E, A, u); }, error: function (e, h, f) { s && s.set(Q.get()); t.xhr = e; t.textStatus = h; t.errorThrown = f; e = new aa.Event("pageloadfailed"); z.pageContainer.trigger(e, t); e.isDefaultPrevented() || (z.showLoadMsg && (clearTimeout(g), aa.mobile.hidePageLoadingMsg(), aa.mobile.showPageLoadingMsg(aa.mobile.pageLoadErrorMessageTheme, aa.mobile.pageLoadErrorMessage, true), setTimeout(aa.mobile.hidePageLoadingMsg, 1500)), B.reject(y, E)); } }); return B.promise(); }; aa.mobile.loadPage.defaults = { type: "get", data: Y, reloadPage: false, role: Y, showLoadMsg: false, pageContainer: Y, loadMsgDelay: 50 }; aa.mobile.changePage = function (t, r) { if (O) { J.unshift(arguments); } else { var x = aa.extend({}, aa.mobile.changePage.defaults, r); x.pageContainer = x.pageContainer || aa.mobile.pageContainer; x.fromPage = x.fromPage || aa.mobile.activePage; var e = x.pageContainer, m = new aa.Event("pagebeforechange"), o = { toPage: t, options: x }; e.trigger(m, o); if (!m.isDefaultPrevented()) { if (t = o.toPage, O = true, typeof t == "string") { aa.mobile.loadPage(t, x).done(function (f, l, j, h) { O = false; l.duplicateCachedPage = h; aa.mobile.changePage(j, l); }).fail(function () { Z(true); X(); x.pageContainer.trigger("pagechangefailed", o); }); } else { if (t[0] === aa.mobile.firstPage[0] && !x.dataUrl) { x.dataUrl = w.hrefNoHash; } var m = x.fromPage, ae = x.dataUrl && Q.convertUrlToDataUrl(x.dataUrl) || t.jqmData("url"), af = ae; Q.getFilePath(ae); var ad = P.getActive(), ab = P.activeIndex === 0, ai = 0, ac = b.title, ag = x.role === "dialog" || t.jqmData("role") === "dialog"; if (m && m[0] === t[0] && !x.allowSamePageTransition) { O = false, e.trigger("pagechange", o), x.fromHashChange && P.directHashChange({ currentUrl: ae, isBack: function () { }, isForward: function () { } }); } else { U(t, x.role); x.fromHashChange && P.directHashChange({ currentUrl: ae, isBack: function () { ai = -1; }, isForward: function () { ai = 1; } }); try { b.activeElement && b.activeElement.nodeName.toLowerCase() != "body" ? aa(b.activeElement).blur() : aa("input:focus, textarea:focus, select:focus").blur(); } catch (n) { } var ah = false; if (ag && ad) { if (ad.url && ad.url.indexOf(I) > -1 && !aa.mobile.activePage.is(".ui-dialog")) { x.changeHash = false, ah = true; } ae = (ad.url || "") + I; P.activeIndex === 0 && ae === P.initialDst && (ae += I); } if (x.changeHash !== false && ae) { P.ignoreNextHashChange = true, Q.set(ae); } var g = !ad ? ac : t.jqmData("title") || t.children(":jqmData(role='header')").find(".ui-title").getEncodedText(); g && ac == b.title && (ac = g); t.jqmData("title") || t.jqmData("title", ac); x.transition = x.transition || (ai && !ab ? ad.transition : Y) || (ag ? aa.mobile.defaultDialogTransition : aa.mobile.defaultPageTransition); !ai && !ah && P.addNew(ae, x.transition, ac, af, x.role); b.title = P.getActive().title; aa.mobile.activePage = t; x.reverse = x.reverse || ai < 0; W(t, m, x.transition, x.reverse).done(function (q, p, l, h, f) { Z(); x.duplicateCachedPage && x.duplicateCachedPage.remove(); f || aa.mobile.focusPage(t); X(); e.trigger("pagechange", o); }); } } } } }; aa.mobile.changePage.defaults = { transition: Y, reverse: false, changeHash: true, fromHashChange: false, role: Y, duplicateCachedPage: Y, pageContainer: Y, showLoadMsg: true, dataUrl: Y, fromPage: Y, allowSamePageTransition: false }; aa.mobile.navreadyDeferred = aa.Deferred(); aa.mobile._registerInternalEvents = function () { aa(b).delegate("form", "submit", function (f) { var m = aa(this); if (aa.mobile.ajaxEnabled && !m.is(":jqmData(ajax='false')") && m.jqmHijackable().length) { var l = m.attr("method"), j = m.attr("target"), g = m.attr("action"); if (!g && (g = S(m), g === G.hrefNoHash)) { g = w.hrefNoSearch; } g = Q.makeUrlAbsolute(g, S(m)); Q.isExternal(g) && !Q.isPermittedCrossDomainRequest(w, g) || j || (aa.mobile.changePage(g, { type: l && l.length && l.toLowerCase() || "get", data: m.serialize(), transition: m.jqmData("transition"), direction: m.jqmData("direction"), reloadPage: true }), f.preventDefault()); } }); aa(b).bind("vclick", function (e) { if (!(e.which > 1) && aa.mobile.linkBindingEnabled && (e = T(e.target), aa(e).jqmHijackable().length && e && Q.parseUrl(e.getAttribute("href") || "#").hash !== "#")) { Z(true), R = aa(e).closest(".ui-btn").not(".ui-disabled"), R.addClass(aa.mobile.activeBtnClass); } }); aa(b).bind("click", function (n) { if (aa.mobile.linkBindingEnabled) { var m = T(n.target), l = aa(m), j; if (m && !(n.which > 1) && l.jqmHijackable().length) { j = function () { c.setTimeout(function () { Z(true); }, 200); }; if (l.is(":jqmData(rel='back')")) { return aa.mobile.back(), false; } var h = S(l), m = Q.makeUrlAbsolute(l.attr("href") || "#", h); if (!aa.mobile.ajaxEnabled && !Q.isEmbeddedPage(m)) { j(); } else { if (m.search("#") != -1) { if (m = m.replace(/[^#]*#/, "")) { m = Q.isPath(m) ? Q.makeUrlAbsolute(m, h) : Q.makeUrlAbsolute("#" + m, w.hrefNoHash); } else { n.preventDefault(); return; } } l.is("[rel='external']") || l.is(":jqmData(ajax='false')") || l.is("[target]") || Q.isExternal(m) && !Q.isPermittedCrossDomainRequest(w, m) ? j() : (j = l.jqmData("transition"), h = (h = l.jqmData("direction")) && h === "reverse" || l.jqmData("back"), l = l.attr("data-" + aa.mobile.ns + "rel") || Y, aa.mobile.changePage(m, { transition: j, reverse: h, role: l }), n.preventDefault()); } } } }); aa(b).delegate(".ui-page", "pageshow.prefetch", function () { var e = []; aa(this).find("a:jqmData(prefetch)").each(function () { var g = aa(this), f = g.attr("href"); f && aa.inArray(f, e) === -1 && (e.push(f), aa.mobile.loadPage(f, { role: g.attr("data-" + aa.mobile.ns + "rel"), prefetch: true })); }); }); aa.mobile._handleHashChange = function (f) { var h = Q.stripHash(f), g = { transition: aa.mobile.urlHistory.stack.length === 0 ? "none" : Y, changeHash: false, fromHashChange: true }; if (0 === P.stack.length) { P.initialDst = h; } if (!aa.mobile.hashListeningEnabled || P.ignoreNextHashChange) { P.ignoreNextHashChange = false; } else { if (P.stack.length > 1 && h.indexOf(I) > -1 && P.initialDst !== h) { if (aa.mobile.activePage.is(".ui-dialog")) { P.directHashChange({ currentUrl: h, either: function (e) { var j = aa.mobile.urlHistory.getActive(); h = j.pageUrl; aa.extend(g, { role: j.role, transition: j.transition, reverse: e }); } }); } else { P.directHashChange({ currentUrl: h, isBack: function () { aa.mobile.back(); }, isForward: function () { c.history.forward(); } }); return; } } h ? (h = typeof h === "string" && !Q.isPath(h) ? Q.makeUrlAbsolute("#" + h, G) : h, aa.mobile.changePage(h, g)) : aa.mobile.changePage(aa.mobile.firstPage, g); } }; L.bind("hashchange", function () { aa.mobile._handleHashChange(Q.parseLocation().hash); }); aa(b).bind("pageshow", V); aa(c).bind("throttledresize", V); }; aa.mobile.navreadyDeferred.done(function () { aa.mobile._registerInternalEvents(); }); })(a); (function (j, o) { var h = {}, n = j(o), m = j.mobile.path.parseLocation(), l = j.Deferred(), k = j.Deferred(); j(b).ready(j.proxy(k, "resolve")); j(b).one("mobileinit", j.proxy(l, "resolve")); j.extend(h, { initialFilePath: m.pathname + m.search, hashChangeTimeout: 200, hashChangeEnableTimer: d, initialHref: m.hrefNoHash, state: function () { return { hash: j.mobile.path.parseLocation().hash || "#" + h.initialFilePath, title: b.title, initialHref: h.initialHref }; }, resetUIKeys: function (e) { var g = "&" + j.mobile.subPageUrlKey, f = e.indexOf(j.mobile.dialogHashKey); f > -1 ? e = e.slice(0, f) + "#" + e.slice(f) : e.indexOf(g) > -1 && (e = e.split(g).join("#" + g)); return e; }, nextHashChangePrevented: function (e) { j.mobile.urlHistory.ignoreNextHashChange = e; h.onHashChangeDisabled = e; }, onHashChange: function () { if (!h.onHashChangeDisabled) { var r, q; r = j.mobile.path.parseLocation().hash; var p = j.mobile.path.isPath(r), g = p ? j.mobile.path.getLocation() : j.mobile.getDocumentUrl(); r = p ? r.replace("#", "") : r; q = h.state(); r = j.mobile.path.makeUrlAbsolute(r, g); p && (r = h.resetUIKeys(r)); history.replaceState(q, b.title, r); } }, onPopState: function (e) { if (e = e.originalEvent.state) { clearTimeout(h.hashChangeEnableTimer), h.nextHashChangePrevented(false), j.mobile._handleHashChange(e.hash), h.nextHashChangePrevented(true), h.hashChangeEnableTimer = setTimeout(function () { h.nextHashChangePrevented(false); }, h.hashChangeTimeout); } }, init: function () { n.bind("hashchange", h.onHashChange); n.bind("popstate", h.onPopState); location.hash === "" && history.replaceState(h.state(), b.title, j.mobile.path.getLocation()); } }); j.when(k, l, j.mobile.navreadyDeferred).done(function () { j.mobile.pushStateEnabled && j.support.pushState && h.init(); }); })(a, this); a.mobile.transitionFallbacks.pop = "fade"; (function (e) { e.mobile.transitionHandlers.slide = e.mobile.transitionHandlers.simultaneous; e.mobile.transitionFallbacks.slide = "fade"; })(a, this); a.mobile.transitionFallbacks.slidedown = "fade"; a.mobile.transitionFallbacks.slideup = "fade"; a.mobile.transitionFallbacks.flip = "fade"; a.mobile.transitionFallbacks.flow = "fade"; a.mobile.transitionFallbacks.turn = "fade"; (function (e) { e.mobile.page.prototype.options.degradeInputs = { color: false, date: false, datetime: false, "datetime-local": false, email: false, month: false, number: false, range: "number", search: "text", tel: false, time: false, url: false, week: false }; e(b).bind("pagecreate create", function (h) { var f = e.mobile.closestPageData(e(h.target)), g; if (f) { g = f.options, e(h.target).find("input").not(f.keepNativeSelector()).each(function () { var k = e(this), o = this.getAttribute("type"), n = g.degradeInputs[o] || "text"; if (g.degradeInputs[o]) { var m = e("<div>").html(k.clone()).html(), l = m.indexOf(" type=") > -1; k.replaceWith(m.replace(l ? /\s+type=["']?\w+['"]?/ : /\/?>/, ' type="' + n + '" data-' + e.mobile.ns + 'type="' + o + '"' + (l ? "" : ">"))); } }); } }); })(a); (function (e) { e.widget("mobile.dialog", e.mobile.widget, { options: { closeBtnText: "Close", overlayTheme: "a", initSelector: ":jqmData(role='dialog')" }, _create: function () { var j = this, f = this.element, h = e("<a href='#' data-" + e.mobile.ns + "icon='delete' data-" + e.mobile.ns + "iconpos='notext'>" + this.options.closeBtnText + "</a>"), g = e("<div/>", { role: "dialog", "class": "ui-dialog-contain ui-corner-all ui-overlay-shadow" }); f.addClass("ui-dialog ui-overlay-" + this.options.overlayTheme); f.wrapInner(g).children().find(":jqmData(role='header')").prepend(h).end().children(":first-child").addClass("ui-corner-top").end().children(":last-child").addClass("ui-corner-bottom"); h.bind("click", function () { j.close(); }); f.bind("vclick submit", function (k) { var k = e(k.target).closest(k.type === "vclick" ? "a" : "form"), l; k.length && !k.jqmData("transition") && (l = e.mobile.urlHistory.getActive() || {}, k.attr("data-" + e.mobile.ns + "transition", l.transition || e.mobile.defaultDialogTransition).attr("data-" + e.mobile.ns + "direction", "reverse")); }).bind("pagehide", function () { j._isClosed = false; e(this).find("." + e.mobile.activeBtnClass).not(".ui-slider-bg").removeClass(e.mobile.activeBtnClass); }).bind("pagebeforeshow", function () { j.options.overlayTheme && j.element.page("removeContainerBackground").page("setContainerBackground", j.options.overlayTheme); }); }, close: function () { var f; if (!this._isClosed) { this._isClosed = true, e.mobile.hashListeningEnabled ? e.mobile.back() : (f = e.mobile.urlHistory.getPrev().url, e.mobile.path.isPath(f) || (f = e.mobile.path.makeUrlAbsolute("#" + f)), e.mobile.changePage(f, { changeHash: false, fromHashChange: true })); } } }); e(b).delegate(e.mobile.dialog.prototype.options.initSelector, "pagecreate", function () { e.mobile.dialog.prototype.enhance(this); }); })(a, this); (function (e) { e.mobile.page.prototype.options.backBtnText = "Back"; e.mobile.page.prototype.options.addBackBtn = false; e.mobile.page.prototype.options.backBtnTheme = null; e.mobile.page.prototype.options.headerTheme = "a"; e.mobile.page.prototype.options.footerTheme = "a"; e.mobile.page.prototype.options.contentTheme = null; e(b).bind("pagecreate", function (l) { var g = e(l.target), k = g.data("page").options, j = g.jqmData("role"), h = k.theme; e(":jqmData(role='header'), :jqmData(role='footer'), :jqmData(role='content')", g).jqmEnhanceable().each(function () { var s = e(this), q = s.jqmData("role"), o = s.jqmData("theme"), n = o || k.contentTheme || j === "dialog" && h, r; s.addClass("ui-" + q); if (q === "header" || q === "footer") { var f = o || (q === "header" ? k.headerTheme : k.footerTheme) || h; s.addClass("ui-bar-" + f).attr("role", q === "header" ? "banner" : "contentinfo"); q === "header" && (o = s.children("a, button"), r = o.hasClass("ui-btn-left"), n = o.hasClass("ui-btn-right"), r = r || o.eq(0).not(".ui-btn-right").addClass("ui-btn-left").length, n || o.eq(1).addClass("ui-btn-right")); k.addBackBtn && q === "header" && e(".ui-page").length > 1 && g.jqmData("url") !== e.mobile.path.stripHash(location.hash) && !r && e("<a href='javascript:void(0);' class='ui-btn-left' data-" + e.mobile.ns + "rel='back' data-" + e.mobile.ns + "icon='arrow-l'>" + k.backBtnText + "</a>").attr("data-" + e.mobile.ns + "theme", k.backBtnTheme || f).prependTo(s); s.children("h1, h2, h3, h4, h5, h6").addClass("ui-title").attr({ role: "heading", "aria-level": "1" }); } else { q === "content" && (n && s.addClass("ui-body-" + n), s.attr("role", "main")); } }); }); })(a); (function (e) { e.fn.fieldcontain = function () { return this.addClass("ui-field-contain ui-body ui-br").contents().filter(function () { return this.nodeType === 3 && !/\S/.test(this.nodeValue); }).remove(); }; e(b).bind("pagecreate create", function (f) { e(":jqmData(role='fieldcontain')", f.target).jqmEnhanceable().fieldcontain(); }); })(a); (function (e) { e.fn.grid = function (f) { return this.each(function () { var h = e(this), m = e.extend({ grid: null }, f), l = h.children(), k = { solo: 1, a: 2, b: 3, c: 4, d: 5 }, m = m.grid; if (!m) { if (l.length <= 5) { for (var j in k) { k[j] === l.length && (m = j); } } else { m = "a", h.addClass("ui-grid-duo"); } } k = k[m]; h.addClass("ui-grid-" + m); l.filter(":nth-child(" + k + "n+1)").addClass("ui-block-a"); k > 1 && l.filter(":nth-child(" + k + "n+2)").addClass("ui-block-b"); k > 2 && l.filter(":nth-child(3n+3)").addClass("ui-block-c"); k > 3 && l.filter(":nth-child(4n+4)").addClass("ui-block-d"); k > 4 && l.filter(":nth-child(5n+5)").addClass("ui-block-e"); }); }; })(a); (function (e) { e(b).bind("pagecreate create", function (f) { e(":jqmData(role='nojs')", f.target).addClass("ui-nojs"); }); })(a); (function (f, h) { function e(k) { for (var j; k;) { if ((j = typeof k.className === "string" && k.className + " ") && j.indexOf("ui-btn ") > -1 && j.indexOf("ui-disabled ") < 0) { break; } k = k.parentNode; } return k; } f.fn.buttonMarkup = function (C) { for (var C = C && f.type(C) == "object" ? C : {}, B = 0; B < this.length; B++) { var A = this.eq(B), z = A[0], y = f.extend({}, f.fn.buttonMarkup.defaults, { icon: C.icon !== h ? C.icon : A.jqmData("icon"), iconpos: C.iconpos !== h ? C.iconpos : A.jqmData("iconpos"), theme: C.theme !== h ? C.theme : A.jqmData("theme") || f.mobile.getInheritedTheme(A, "c"), inline: C.inline !== h ? C.inline : A.jqmData("inline"), shadow: C.shadow !== h ? C.shadow : A.jqmData("shadow"), corners: C.corners !== h ? C.corners : A.jqmData("corners"), iconshadow: C.iconshadow !== h ? C.iconshadow : A.jqmData("iconshadow"), mini: C.mini !== h ? C.mini : A.jqmData("mini") }, C), s = "ui-btn-inner", t, w, x, v, k, u; f.each(y, function (j, l) { z.setAttribute("data-" + f.mobile.ns + j, l); A.jqmData(j, l); }); (u = f.data(z.tagName === "INPUT" || z.tagName === "BUTTON" ? z.parentNode : z, "buttonElements")) ? (z = u.outer, A = f(z), x = u.inner, v = u.text, f(u.icon).remove(), u.icon = null) : (x = b.createElement(y.wrapperEls), v = b.createElement(y.wrapperEls)); k = y.icon ? b.createElement("span") : null; g && !u && g(); if (!y.theme) { y.theme = f.mobile.getInheritedTheme(A, "c"); } t = "ui-btn ui-btn-up-" + y.theme; t += y.shadow ? " ui-shadow" : ""; t += y.corners ? " ui-btn-corner-all" : ""; y.mini !== h && (t += y.mini === true ? " ui-mini" : " ui-fullsize"); y.inline !== h && (t += y.inline === true ? " ui-btn-inline" : " ui-btn-block"); if (y.icon) { y.icon = "ui-icon-" + y.icon, y.iconpos = y.iconpos || "left", w = "ui-icon " + y.icon, y.iconshadow && (w += " ui-icon-shadow"); } y.iconpos && (t += " ui-btn-icon-" + y.iconpos, y.iconpos == "notext" && !A.attr("title") && A.attr("title", A.getEncodedText())); s += y.corners ? " ui-btn-corner-all" : ""; y.iconpos && y.iconpos === "notext" && !A.attr("title") && A.attr("title", A.getEncodedText()); u && A.removeClass(u.bcls || ""); A.removeClass("ui-link").addClass(t); x.className = s; v.className = "ui-btn-text"; u || x.appendChild(v); if (k && (k.className = w, !u || !u.icon)) { k.innerHTML = "&#160;", x.appendChild(k); } for (; z.firstChild && !u;) { v.appendChild(z.firstChild); } u || z.appendChild(x); u = { bcls: t, outer: z, inner: x, text: v, icon: k }; f.data(z, "buttonElements", u); f.data(x, "buttonElements", u); f.data(v, "buttonElements", u); k && f.data(k, "buttonElements", u); } return this; }; f.fn.buttonMarkup.defaults = { corners: true, shadow: true, iconshadow: true, wrapperEls: "span" }; var g = function () { var l = f.mobile.buttonMarkup.hoverDelay, k, j; f(b).bind({ "vmousedown vmousecancel vmouseup vmouseover vmouseout focus blur scrollstart": function (o) { var n, m = f(e(o.target)), o = o.type; if (m.length) { if (n = m.attr("data-" + f.mobile.ns + "theme"), o === "vmousedown") { f.support.touch ? k = setTimeout(function () { m.removeClass("ui-btn-up-" + n).addClass("ui-btn-down-" + n); }, l) : m.removeClass("ui-btn-up-" + n).addClass("ui-btn-down-" + n); } else { if (o === "vmousecancel" || o === "vmouseup") { m.removeClass("ui-btn-down-" + n).addClass("ui-btn-up-" + n); } else { if (o === "vmouseover" || o === "focus") { f.support.touch ? j = setTimeout(function () { m.removeClass("ui-btn-up-" + n).addClass("ui-btn-hover-" + n); }, l) : m.removeClass("ui-btn-up-" + n).addClass("ui-btn-hover-" + n); } else { if (o === "vmouseout" || o === "blur" || o === "scrollstart") { m.removeClass("ui-btn-hover-" + n + " ui-btn-down-" + n).addClass("ui-btn-up-" + n), k && clearTimeout(k), j && clearTimeout(j); } } } } } }, "focusin focus": function (m) { f(e(m.target)).addClass(f.mobile.focusClass); }, "focusout blur": function (m) { f(e(m.target)).removeClass(f.mobile.focusClass); } }); g = null; }; f(b).bind("pagecreate create", function (j) { f(":jqmData(role='button'), .ui-bar > a, .ui-header > a, .ui-footer > a, .ui-bar > :jqmData(role='controlgroup') > a", j.target).jqmEnhanceable().not("button, input, .ui-btn, :jqmData(role='none'), :jqmData(role='nojs')").buttonMarkup(); }); })(a); (function (e) { e.widget("mobile.collapsible", e.mobile.widget, { options: { expandCueText: " click to expand contents", collapseCueText: " click to collapse contents", collapsed: true, heading: "h1,h2,h3,h4,h5,h6,legend", theme: null, contentTheme: null, iconTheme: "d", mini: false, initSelector: ":jqmData(role='collapsible')" }, _create: function () { var n = this.element, h = this.options, m = n.addClass("ui-collapsible"), l = n.children(h.heading).first(), k = m.wrapInner("<div class='ui-collapsible-content'></div>").find(".ui-collapsible-content"), j = n.closest(":jqmData(role='collapsible-set')").addClass("ui-collapsible-set"); l.is("legend") && (l = e("<div role='heading'>" + l.html() + "</div>").insertBefore(l), l.next().remove()); if (j.length) { if (!h.theme) { h.theme = j.jqmData("theme") || e.mobile.getInheritedTheme(j, "c"); } if (!h.contentTheme) { h.contentTheme = j.jqmData("content-theme"); } if (!h.iconpos) { h.iconpos = j.jqmData("iconpos"); } if (!h.mini) { h.mini = j.jqmData("mini"); } } k.addClass(h.contentTheme ? "ui-body-" + h.contentTheme : ""); l.insertBefore(k).addClass("ui-collapsible-heading").append("<span class='ui-collapsible-heading-status'></span>").wrapInner("<a href='#' class='ui-collapsible-heading-toggle'></a>").find("a").first().buttonMarkup({ shadow: false, corners: false, iconpos: n.jqmData("iconpos") || h.iconpos || "left", icon: "plus", mini: h.mini, theme: h.theme }).add(".ui-btn-inner", n).addClass("ui-corner-top ui-corner-bottom"); m.bind("expand collapse", function (o) { if (!o.isDefaultPrevented()) { o.preventDefault(); var g = e(this), o = o.type === "collapse", f = h.contentTheme; l.toggleClass("ui-collapsible-heading-collapsed", o).find(".ui-collapsible-heading-status").text(o ? h.expandCueText : h.collapseCueText).end().find(".ui-icon").toggleClass("ui-icon-minus", !o).toggleClass("ui-icon-plus", o).end().find("a").first().removeClass(e.mobile.activeBtnClass); g.toggleClass("ui-collapsible-collapsed", o); k.toggleClass("ui-collapsible-content-collapsed", o).attr("aria-hidden", o); if (f && (!j.length || m.jqmData("collapsible-last"))) { l.find("a").first().add(l.find(".ui-btn-inner")).toggleClass("ui-corner-bottom", o), k.toggleClass("ui-corner-bottom", !o); } k.trigger("updatelayout"); } }).trigger(h.collapsed ? "collapse" : "expand"); l.bind("tap", function () { l.find("a").first().addClass(e.mobile.activeBtnClass); }).bind("click", function (g) { var f = l.is(".ui-collapsible-heading-collapsed") ? "expand" : "collapse"; m.trigger(f); g.preventDefault(); g.stopPropagation(); }); } }); e(b).bind("pagecreate create", function (f) { e.mobile.collapsible.prototype.enhanceWithin(f.target); }); })(a); (function (e, f) { e.widget("mobile.collapsibleset", e.mobile.widget, { options: { initSelector: ":jqmData(role='collapsible-set')" }, _create: function () { var g = this.element.addClass("ui-collapsible-set"), h = this.options; if (!h.theme) { h.theme = e.mobile.getInheritedTheme(g, "c"); } if (!h.contentTheme) { h.contentTheme = g.jqmData("content-theme"); } if (!h.corners) { h.corners = g.jqmData("corners") === f ? true : false; } g.jqmData("collapsiblebound") || g.jqmData("collapsiblebound", true).bind("expand collapse", function (j) { var k = j.type === "collapse", j = e(j.target).closest(".ui-collapsible"); j.data("collapsible").options.contentTheme && j.jqmData("collapsible-last") && (j.find(".ui-collapsible-heading").first().find("a").first().toggleClass("ui-corner-bottom", k).find(".ui-btn-inner").toggleClass("ui-corner-bottom", k), j.find(".ui-collapsible-content").toggleClass("ui-corner-bottom", !k)); }).bind("expand", function (j) { e(j.target).closest(".ui-collapsible").siblings(".ui-collapsible").trigger("collapse"); }); }, _init: function () { this.refresh(); }, refresh: function () { var g = this.options, h = this.element.children(":jqmData(role='collapsible')"); e.mobile.collapsible.prototype.enhance(h.not(".ui-collapsible")); h.each(function () { e(this).jqmRemoveData("collapsible-last").find(".ui-collapsible-heading").find("a").first().removeClass("ui-corner-top ui-corner-bottom").find(".ui-btn-inner").removeClass("ui-corner-top ui-corner-bottom"); }); h.first().find("a").first().addClass(g.corners ? "ui-corner-top" : "").find(".ui-btn-inner").addClass("ui-corner-top"); h.last().jqmData("collapsible-last", true).find("a").first().addClass(g.corners ? "ui-corner-bottom" : "").find(".ui-btn-inner").addClass("ui-corner-bottom"); } }); e(b).bind("pagecreate create", function (g) { e.mobile.collapsibleset.prototype.enhanceWithin(g.target); }); })(a); (function (e, f) { e.widget("mobile.navbar", e.mobile.widget, { options: { iconpos: "top", grid: null, initSelector: ":jqmData(role='navbar')" }, _create: function () { var g = this.element, j = g.find("a"), h = j.filter(":jqmData(icon)").length ? this.options.iconpos : f; g.addClass("ui-navbar ui-mini").attr("role", "navigation").find("ul").jqmEnhanceable().grid({ grid: this.options.grid }); j.buttonMarkup({ corners: false, shadow: false, inline: true, iconpos: h }); g.delegate("a", "vclick", function (k) { e(k.target).hasClass("ui-disabled") || (j.removeClass(e.mobile.activeBtnClass), e(this).addClass(e.mobile.activeBtnClass)); }); g.closest(".ui-page").bind("pagebeforeshow", function () { j.filter(".ui-state-persist").addClass(e.mobile.activeBtnClass); }); } }); e(b).bind("pagecreate create", function (g) { e.mobile.navbar.prototype.enhanceWithin(g.target); }); })(a); (function (e) { var f = {}; e.widget("mobile.listview", e.mobile.widget, { options: { theme: null, countTheme: "c", headerTheme: "b", dividerTheme: "b", splitIcon: "arrow-r", splitTheme: "b", inset: false, initSelector: ":jqmData(role='listview')" }, _create: function () { var g = ""; g += this.options.inset ? " ui-listview-inset ui-corner-all ui-shadow " : ""; this.element.addClass(function (j, h) { return h + " ui-listview " + g; }); this.refresh(true); }, _removeCorners: function (g, h) { g = g.add(g.find(".ui-btn-inner, .ui-li-link-alt, .ui-li-thumb")); h === "top" ? g.removeClass("ui-corner-top ui-corner-tr ui-corner-tl") : h === "bottom" ? g.removeClass("ui-corner-bottom ui-corner-br ui-corner-bl") : g.removeClass("ui-corner-top ui-corner-tr ui-corner-tl ui-corner-bottom ui-corner-br ui-corner-bl"); }, _refreshCorners: function (g) { var j, h; j = this.element.children("li"); h = g ? j.not(".ui-screen-hidden") : j.filter(":visible"); j.filter(".ui-li-last").removeClass("ui-li-last"); this.options.inset ? (this._removeCorners(j), j = h.first().addClass("ui-corner-top"), j.add(j.find(".ui-btn-inner").not(".ui-li-link-alt span:first-child")).addClass("ui-corner-top").end().find(".ui-li-link-alt, .ui-li-link-alt span:first-child").addClass("ui-corner-tr").end().find(".ui-li-thumb").not(".ui-li-icon").addClass("ui-corner-tl"), h = h.last().addClass("ui-corner-bottom ui-li-last"), h.add(h.find(".ui-btn-inner")).find(".ui-li-link-alt").addClass("ui-corner-br").end().find(".ui-li-thumb").not(".ui-li-icon").addClass("ui-corner-bl")) : h.last().addClass("ui-li-last"); g || this.element.trigger("updatelayout"); }, _findFirstElementByTagName: function (h, m, l, k) { var j = {}; for (j[l] = j[k] = true; h;) { if (j[h.nodeName]) { return h; } h = h[m]; } return null; }, _getChildrenByTagName: function (h, m, l) { var k = [], j = {}; j[m] = j[l] = true; for (h = h.firstChild; h;) { j[h.nodeName] && k.push(h), h = h.nextSibling; } return e(k); }, _addThumbClasses: function (g) { var k, j, h = g.length; for (k = 0; k < h; k++) { j = e(this._findFirstElementByTagName(g[k].firstChild, "nextSibling", "img", "IMG")), j.length && (j.addClass("ui-li-thumb"), e(this._findFirstElementByTagName(j[0].parentNode, "parentNode", "li", "LI")).addClass(j.is(".ui-li-icon") ? "ui-li-has-icon" : "ui-li-has-thumb")); } }, refresh: function (S) { this.parentPage = this.element.closest(".ui-page"); this._createSubPages(); var R = this.options, Q = this.element, P = Q.jqmData("dividertheme") || R.dividerTheme, O = Q.jqmData("splittheme"), N = Q.jqmData("spliticon"), M = this._getChildrenByTagName(Q[0], "li", "LI"), L = !!e.nodeName(Q[0], "ol"), H = !e.support.cssPseudoElement, K = Q.attr("start"), B = {}, J, G, I, E, C, A, D, F; L && H && Q.find(".ui-li-dec").remove(); L && (K || K === 0 ? H ? A = parseFloat(K) : (J = parseFloat(K) - 1, Q.css("counter-reset", "listnumbering " + J)) : H && (A = 1)); if (!R.theme) { R.theme = e.mobile.getInheritedTheme(this.element, "c"); } for (var k = 0, q = M.length; k < q; k++) { J = M.eq(k); G = "ui-li"; if (S || !J.hasClass("ui-li")) { I = J.jqmData("theme") || R.theme, E = this._getChildrenByTagName(J[0], "a", "A"), D = J.jqmData("role") === "list-divider", E.length && !D ? (D = J.jqmData("icon"), J.buttonMarkup({ wrapperEls: "div", shadow: false, corners: false, iconpos: "right", icon: E.length > 1 || D === false ? false : D || "arrow-r", theme: I }), D != false && E.length == 1 && J.addClass("ui-li-has-arrow"), E.first().removeClass("ui-link").addClass("ui-link-inherit"), E.length > 1 && (G += " ui-li-has-alt", E = E.last(), C = O || E.jqmData("theme") || R.splitTheme, F = E.jqmData("icon"), E.appendTo(J).attr("title", E.getEncodedText()).addClass("ui-li-link-alt").empty().buttonMarkup({ shadow: false, corners: false, theme: I, icon: false, iconpos: "notext" }).find(".ui-btn-inner").append(e(b.createElement("span")).buttonMarkup({ shadow: true, corners: true, theme: C, iconpos: "notext", icon: F || D || N || R.splitIcon })))) : D ? (G += " ui-li-divider ui-bar-" + P, J.attr("role", "heading"), L && (K || K === 0 ? H ? A = parseFloat(K) : (I = parseFloat(K) - 1, J.css("counter-reset", "listnumbering " + I)) : H && (A = 1))) : G += " ui-li-static ui-body-" + I; } L && H && G.indexOf("ui-li-divider") < 0 && (I = G.indexOf("ui-li-static") > 0 ? J : J.find(".ui-link-inherit"), I.addClass("ui-li-jsnumbering").prepend("<span class='ui-li-dec'>" + A++ + ". </span>")); B[G] || (B[G] = []); B[G].push(J[0]); } for (G in B) { e(B[G]).addClass(G).children(".ui-btn-inner").addClass(G); } Q.find("h1, h2, h3, h4, h5, h6").addClass("ui-li-heading").end().find("p, dl").addClass("ui-li-desc").end().find(".ui-li-aside").each(function () { var g = e(this); g.prependTo(g.parent()); }).end().find(".ui-li-count").each(function () { e(this).closest("li").addClass("ui-li-has-count"); }).addClass("ui-btn-up-" + (Q.jqmData("counttheme") || this.options.countTheme) + " ui-btn-corner-all"); this._addThumbClasses(M); this._addThumbClasses(Q.find(".ui-link-inherit")); this._refreshCorners(S); }, _idStringEscape: function (g) { return g.replace(/[^a-zA-Z0-9]/g, "-"); }, _createSubPages: function () { var w = this.element, v = w.closest(".ui-page"), u = v.jqmData("url"), t = u || v[0][e.expando], s = w.attr("id"), r = this.options, q = "data-" + e.mobile.ns, p = this, o = v.find(":jqmData(role='footer')").jqmData("id"), n; typeof f[t] === "undefined" && (f[t] = -1); s = s || ++f[t]; e(w.find("li>ul, li>ol").toArray().reverse()).each(function (z) { var y = e(this), m = y.attr("id") || s + "-" + z, z = y.parent(), j = e(y.prevAll().toArray().reverse()), j = j.length ? j : e("<span>" + e.trim(z.contents()[0].nodeValue) + "</span>"), l = j.first().getEncodedText(), m = (u || "") + "&" + e.mobile.subPageUrlKey + "=" + m, h = y.jqmData("theme") || r.theme, g = y.jqmData("counttheme") || w.jqmData("counttheme") || r.countTheme; n = true; y.detach().wrap("<div " + q + "role='page' " + q + "url='" + m + "' " + q + "theme='" + h + "' " + q + "count-theme='" + g + "'><div " + q + "role='content'></div></div>").parent().before("<div " + q + "role='header' " + q + "theme='" + r.headerTheme + "'><div class='ui-title'>" + l + "</div></div>").after(o ? e("<div " + q + "role='footer' " + q + "id='" + o + "'>") : "").parent().appendTo(e.mobile.pageContainer).page(); y = z.find("a:first"); y.length || (y = e("<a/>").html(j || l).prependTo(z.empty())); y.attr("href", "#" + m); }).listview(); n && v.is(":jqmData(external-page='true')") && v.data("page").options.domCache === false && v.unbind("pagehide.remove").bind("pagehide.remove", function (h, l) { var k = l.nextPage, j = new e.Event("pageremove"); l.nextPage && (k = k.jqmData("url"), k.indexOf(u + "&" + e.mobile.subPageUrlKey) !== 0 && (p.childPages().remove(), v.trigger(j), j.isDefaultPrevented() || v.removeWithDependents())); }); }, childPages: function () { var g = this.parentPage.jqmData("url"); return e(":jqmData(url^='" + g + "&" + e.mobile.subPageUrlKey + "')"); } }); e(b).bind("pagecreate create", function (g) { e.mobile.listview.prototype.enhanceWithin(g.target); }); })(a); (function (e, f) { e.widget("mobile.checkboxradio", e.mobile.widget, { options: { theme: null, mini: false, initSelector: "input[type='checkbox'],input[type='radio']" }, _create: function () { var w = this, v = this.element, u = this.options, t = e(v).closest("label"), s = t.length ? t : e(v).closest("form,fieldset,:jqmData(role='page'),:jqmData(role='dialog')").find("label").filter("[for='" + v[0].id + "']"), r = v[0].type, t = v.jqmData("mini") || v.closest("form,fieldset").jqmData("mini") || u.mini, q = r + "-on", o = r + "-off", k = v.parents(":jqmData(type='horizontal')").length ? f : o, n = v.jqmData("iconpos") || v.closest("form,fieldset").jqmData("iconpos"); if (!(r !== "checkbox" && r !== "radio")) { e.extend(this, { label: s, inputtype: r, checkedClass: "ui-" + q + (k ? "" : " " + e.mobile.activeBtnClass), uncheckedClass: "ui-" + o, checkedicon: "ui-icon-" + q, uncheckedicon: "ui-icon-" + o }); if (!u.theme) { u.theme = e.mobile.getInheritedTheme(this.element, "c"); } s.buttonMarkup({ theme: u.theme, icon: k, shadow: false, mini: t, iconpos: n }); u = b.createElement("div"); u.className = "ui-" + r; v.add(s).wrapAll(u); s.bind({ vmouseover: function (g) { e(this).parent().is(".ui-disabled") && g.stopPropagation(); }, vclick: function (g) { if (v.is(":disabled")) { g.preventDefault(); } else { return w._cacheVals(), v.prop("checked", r === "radio" && true || !v.prop("checked")), v.triggerHandler("click"), w._getInputSet().not(v).prop("checked", false), w._updateAll(), false; } } }); v.bind({ vmousedown: function () { w._cacheVals(); }, vclick: function () { var g = e(this); g.is(":checked") ? (g.prop("checked", true), w._getInputSet().not(g).prop("checked", false)) : g.prop("checked", false); w._updateAll(); }, focus: function () { s.addClass(e.mobile.focusClass); }, blur: function () { s.removeClass(e.mobile.focusClass); } }); this.refresh(); } }, _cacheVals: function () { this._getInputSet().each(function () { e(this).jqmData("cacheVal", this.checked); }); }, _getInputSet: function () { return this.inputtype === "checkbox" ? this.element : this.element.closest("form,fieldset,:jqmData(role='page')").find("input[name='" + this.element[0].name + "'][type='" + this.inputtype + "']"); }, _updateAll: function () { var g = this; this._getInputSet().each(function () { var h = e(this); (this.checked || g.inputtype === "checkbox") && h.trigger("change"); }).checkboxradio("refresh"); }, refresh: function () { var g = this.element[0], j = this.label, h = j.find(".ui-icon"); g.checked ? (j.addClass(this.checkedClass).removeClass(this.uncheckedClass), h.addClass(this.checkedicon).removeClass(this.uncheckedicon)) : (j.removeClass(this.checkedClass).addClass(this.uncheckedClass), h.removeClass(this.checkedicon).addClass(this.uncheckedicon)); g.disabled ? this.disable() : this.enable(); }, disable: function () { this.element.prop("disabled", true).parent().addClass("ui-disabled"); }, enable: function () { this.element.prop("disabled", false).parent().removeClass("ui-disabled"); } }); e(b).bind("pagecreate create", function (g) { e.mobile.checkboxradio.prototype.enhanceWithin(g.target, true); }); })(a); (function (e, f) { e.widget("mobile.button", e.mobile.widget, { options: { theme: null, icon: null, iconpos: null, corners: true, shadow: true, iconshadow: true, initSelector: "button, [type='button'], [type='submit'], [type='reset'], [type='image']" }, _create: function () { var k = this.element, q, p = this.options, o; o = p.inline || k.jqmData("inline"); var n = p.mini || k.jqmData("mini"), m = "", l; if (k[0].tagName === "A") { !k.hasClass("ui-btn") && k.buttonMarkup(); } else { if (!this.options.theme) { this.options.theme = e.mobile.getInheritedTheme(this.element, "c"); } ~k[0].className.indexOf("ui-btn-left") && (m = "ui-btn-left"); ~k[0].className.indexOf("ui-btn-right") && (m = "ui-btn-right"); if (k.attr("type") === "submit" || k.attr("type") === "reset") { m ? m += " ui-submit" : m = "ui-submit"; } e("label[for='" + k.attr("id") + "']").addClass("ui-submit"); q = this.button = e("<div></div>").text(k.text() || k.val()).insertBefore(k).buttonMarkup({ theme: p.theme, icon: p.icon, iconpos: p.iconpos, inline: o, corners: p.corners, shadow: p.shadow, iconshadow: p.iconshadow, mini: n }).addClass(m).append(k.addClass("ui-btn-hidden")); p = k.attr("type"); o = k.attr("name"); p !== "button" && p !== "reset" && o && k.bind("vclick", function () { l === f && (l = e("<input>", { type: "hidden", name: k.attr("name"), value: k.attr("value") }).insertBefore(k), e(b).one("submit", function () { l.remove(); l = f; })); }); k.bind({ focus: function () { q.addClass(e.mobile.focusClass); }, blur: function () { q.removeClass(e.mobile.focusClass); } }); this.refresh(); } }, enable: function () { this.element.attr("disabled", false); this.button.removeClass("ui-disabled").attr("aria-disabled", false); return this._setOption("disabled", false); }, disable: function () { this.element.attr("disabled", true); this.button.addClass("ui-disabled").attr("aria-disabled", true); return this._setOption("disabled", true); }, refresh: function () { var g = this.element; g.prop("disabled") ? this.disable() : this.enable(); e(this.button.data("buttonElements").text).text(g.text() || g.val()); } }); e(b).bind("pagecreate create", function (g) { e.mobile.button.prototype.enhanceWithin(g.target, true); }); })(a); (function (e) { e.fn.controlgroup = function (g) { function f(j, h) { j.removeClass("ui-btn-corner-all ui-corner-top ui-corner-bottom ui-corner-left ui-corner-right ui-controlgroup-last ui-shadow").eq(0).addClass(h[0]).end().last().addClass(h[1]).addClass("ui-controlgroup-last"); } return this.each(function () { var p = e(this), o = e.extend({ direction: p.jqmData("type") || "vertical", shadow: false, excludeInvisible: true, mini: p.jqmData("mini") }, g), n = p.children("legend"), m = p.children(".ui-controlgroup-label"), l = p.children(".ui-controlgroup-controls"), k = o.direction === "horizontal" ? ["ui-corner-left", "ui-corner-right"] : ["ui-corner-top", "ui-corner-bottom"]; p.find("input").first().attr("type"); l.length && l.contents().unwrap(); p.wrapInner("<div class='ui-controlgroup-controls'></div>"); n.length ? (e("<div role='heading' class='ui-controlgroup-label'>" + n.html() + "</div>").insertBefore(p.children(0)), n.remove()) : m.length && p.prepend(m); p.addClass("ui-corner-all ui-controlgroup ui-controlgroup-" + o.direction); f(p.find(".ui-btn" + (o.excludeInvisible ? ":visible" : "")).not(".ui-slider-handle"), k); f(p.find(".ui-btn-inner"), k); o.shadow && p.addClass("ui-shadow"); o.mini && p.addClass("ui-mini"); }); }; })(a); (function (e) { e(b).bind("pagecreate create", function (f) { e(f.target).find("a").jqmEnhanceable().not(".ui-btn, .ui-link-inherit, :jqmData(role='none'), :jqmData(role='nojs')").addClass("ui-link"); }); })(a); (function (h) { var m = h("meta[name=viewport]"), g = m.attr("content"), l = g + ",maximum-scale=1, user-scalable=no", k = g + ",maximum-scale=10, user-scalable=yes", j = /(user-scalable[\s]*=[\s]*no)|(maximum-scale[\s]*=[\s]*1)[$,\s]/.test(g); h.mobile.zoom = h.extend({}, { enabled: !j, locked: false, disable: function (e) { if (!j && !h.mobile.zoom.locked) { m.attr("content", l), h.mobile.zoom.enabled = false, h.mobile.zoom.locked = e || false; } }, enable: function (e) { if (!j && (!h.mobile.zoom.locked || e === true)) { m.attr("content", k), h.mobile.zoom.enabled = true, h.mobile.zoom.locked = false; } }, restore: function () { if (!j) { m.attr("content", g), h.mobile.zoom.enabled = true; } } }); })(a); (function (e) { e.widget("mobile.textinput", e.mobile.widget, { options: { theme: null, mini: false, preventFocusZoom: /iPhone|iPad|iPod/.test(navigator.platform) && navigator.userAgent.indexOf("AppleWebKit") > -1, initSelector: "input[type='text'], input[type='search'], :jqmData(type='search'), input[type='number'], :jqmData(type='number'), input[type='password'], input[type='email'], input[type='url'], input[type='tel'], textarea, input[type='time'], input[type='date'], input[type='month'], input[type='week'], input[type='datetime'], input[type='datetime-local'], input[type='color'], input:not([type])", clearSearchButtonText: "clear text", disabled: false }, _create: function () { var s = this.element, t = this.options, r = t.theme || e.mobile.getInheritedTheme(this.element, "c"), q = " ui-body-" + r, p = t.mini ? " ui-mini" : "", o, n; e("label[for='" + s.attr("id") + "']").addClass("ui-input-text"); o = s.addClass("ui-input-text ui-body-" + r); typeof s[0].autocorrect !== "undefined" && !e.support.touchOverflow && (s[0].setAttribute("autocorrect", "off"), s[0].setAttribute("autocomplete", "off")); s.is("[type='search'],:jqmData(type='search')") ? (o = s.wrap("<div class='ui-input-search ui-shadow-inset ui-btn-corner-all ui-btn-shadow ui-icon-searchfield" + q + p + "'></div>").parent(), n = e("<a href='#' class='ui-input-clear' title='" + t.clearSearchButtonText + "'>" + t.clearSearchButtonText + "</a>").bind("click", function (f) { s.val("").focus().trigger("change"); n.addClass("ui-input-clear-hidden"); f.preventDefault(); }).appendTo(o).buttonMarkup({ icon: "delete", iconpos: "notext", corners: true, shadow: true, mini: t.mini }), r = function () { setTimeout(function () { n.toggleClass("ui-input-clear-hidden", !s.val()); }, 0); }, r(), s.bind("paste cut keyup focus change blur", r)) : s.addClass("ui-corner-all ui-shadow-inset" + q + p); s.focus(function () { o.addClass(e.mobile.focusClass); }).blur(function () { o.removeClass(e.mobile.focusClass); }).bind("focus", function () { t.preventFocusZoom && e.mobile.zoom.disable(true); }).bind("blur", function () { t.preventFocusZoom && e.mobile.zoom.enable(true); }); if (s.is("textarea")) { var m = function () { var f = s[0].scrollHeight; s[0].clientHeight < f && s.height(f + 15); }, k; s.keyup(function () { clearTimeout(k); k = setTimeout(m, 100); }); e(b).one("pagechange", m); e.trim(s.val()) && e(c).load(m); } s.attr("disabled") && this.disable(); }, disable: function () { (this.element.attr("disabled", true).is("[type='search'],:jqmData(type='search')") ? this.element.parent() : this.element).addClass("ui-disabled"); return this._setOption("disabled", true); }, enable: function () { (this.element.attr("disabled", false).is("[type='search'],:jqmData(type='search')") ? this.element.parent() : this.element).removeClass("ui-disabled"); return this._setOption("disabled", false); } }); e(b).bind("pagecreate create", function (f) { e.mobile.textinput.prototype.enhanceWithin(f.target, true); }); })(a); (function (e) { e.mobile.listview.prototype.options.filter = false; e.mobile.listview.prototype.options.filterPlaceholder = "Filter items..."; e.mobile.listview.prototype.options.filterTheme = "c"; e.mobile.listview.prototype.options.filterCallback = function (g, f) { return g.toLowerCase().indexOf(f) === -1; }; e(b).delegate("ul, ol", "listviewcreate", function () { var h = e(this), f = h.data("listview"); if (f.options.filter) { var g = e("<form>", { "class": "ui-listview-filter ui-bar-" + f.options.filterTheme, role: "search" }); e("<input>", { placeholder: f.options.filterPlaceholder }).attr("data-" + e.mobile.ns + "type", "search").jqmData("lastval", "").bind("keyup change", function () { var q = e(this), p = this.value.toLowerCase(), o = null, o = q.jqmData("lastval") + "", n = false, m = ""; q.jqmData("lastval", p); o = p.length < o.length || p.indexOf(o) !== 0 ? h.children() : h.children(":not(.ui-screen-hidden)"); if (p) { for (var l = o.length - 1; l >= 0; l--) { q = e(o[l]), m = q.jqmData("filtertext") || q.text(), q.is("li:jqmData(role=list-divider)") ? (q.toggleClass("ui-filter-hidequeue", !n), n = false) : f.options.filterCallback(m, p) ? q.toggleClass("ui-filter-hidequeue", true) : n = true; } o.filter(":not(.ui-filter-hidequeue)").toggleClass("ui-screen-hidden", false); o.filter(".ui-filter-hidequeue").toggleClass("ui-screen-hidden", true).toggleClass("ui-filter-hidequeue", false); } else { o.toggleClass("ui-screen-hidden", false); } f._refreshCorners(); }).appendTo(g).textinput(); f.options.inset && g.addClass("ui-listview-filter-inset"); g.bind("submit", function () { return false; }).insertBefore(h); } }); })(a); (function (e, f) { e.widget("mobile.slider", e.mobile.widget, { options: { theme: null, trackTheme: null, disabled: false, initSelector: "input[type='range'], :jqmData(type='range'), :jqmData(role='slider')", mini: false }, _create: function () { var O = this, N = this.element, M = e.mobile.getInheritedTheme(N, "c"), L = this.options.theme || M, M = this.options.trackTheme || M, K = N[0].nodeName.toLowerCase(), J = K == "select" ? "ui-slider-switch" : "", I = N.attr("id"), H = e("[for='" + I + "']"), C = H.attr("id") || I + "-label", H = H.attr("id", C), G = function () { return K == "input" ? parseFloat(N.val()) : N[0].selectedIndex; }, q = K == "input" ? parseFloat(N.attr("min")) : 0, E = K == "input" ? parseFloat(N.attr("max")) : N.find("option").length - 1, B = c.parseFloat(N.attr("step") || 1), D = this.options.inline || N.jqmData("inline") == true ? " ui-slider-inline" : "", A = this.options.mini || N.jqmData("mini") ? " ui-slider-mini" : "", s = b.createElement("a"), k = e(s), I = b.createElement("div"), z = e(I), y = N.jqmData("highlight") && K != "select" ? function () { var g = b.createElement("div"); g.className = "ui-slider-bg " + e.mobile.activeBtnClass + " ui-btn-corner-all"; return e(g).prependTo(z); }() : false; this._type = K; s.setAttribute("href", "#"); I.setAttribute("role", "application"); I.className = ["ui-slider ", J, " ui-btn-down-", M, " ui-btn-corner-all", D, A].join(""); s.className = "ui-slider-handle"; I.appendChild(s); k.buttonMarkup({ corners: true, theme: L, shadow: true }).attr({ role: "slider", "aria-valuemin": q, "aria-valuemax": E, "aria-valuenow": G(), "aria-valuetext": G(), title: G(), "aria-labelledby": C }); e.extend(this, { slider: z, handle: k, valuebg: y, dragging: false, beforeStart: null, userModified: false, mouseMoved: false }); if (K == "select") { L = b.createElement("div"); L.className = "ui-slider-inneroffset"; J = 0; for (C = I.childNodes.length; J < C; J++) { L.appendChild(I.childNodes[J]); } I.appendChild(L); k.addClass("ui-slider-handle-snapping"); L = N.find("option"); I = 0; for (J = L.length; I < J; I++) { C = !I ? "b" : "a", D = !I ? " ui-btn-down-" + M : " " + e.mobile.activeBtnClass, b.createElement("div"), A = b.createElement("span"), A.className = ["ui-slider-label ui-slider-label-", C, D, " ui-btn-corner-all"].join(""), A.setAttribute("role", "img"), A.appendChild(b.createTextNode(L[I].innerHTML)), e(A).prependTo(z); } O._labels = e(".ui-slider-label", z); } H.addClass("ui-slider"); N.addClass(K === "input" ? "ui-slider-input" : "ui-slider-switch").change(function () { O.mouseMoved || O.refresh(G(), true); }).keyup(function () { O.refresh(G(), true, true); }).blur(function () { O.refresh(G(), true); }); e(b).bind("vmousemove", function (g) { if (O.dragging && !O.options.disabled) { return O.mouseMoved = true, K === "select" && k.removeClass("ui-slider-handle-snapping"), O.refresh(g), O.userModified = O.beforeStart !== N[0].selectedIndex, false; } }); N.bind("vmouseup", e.proxy(O._checkedRefresh, O)); z.bind("vmousedown", function (g) { if (O.options.disabled) { return false; } O.dragging = true; O.userModified = false; O.mouseMoved = false; if (K === "select") { O.beforeStart = N[0].selectedIndex; } O.refresh(g); return false; }).bind("vclick", false); z.add(b).bind("vmouseup", function () { if (O.dragging) { return O.dragging = false, K === "select" && (k.addClass("ui-slider-handle-snapping"), O.mouseMoved ? O.userModified ? O.refresh(O.beforeStart == 0 ? 1 : 0) : O.refresh(O.beforeStart) : O.refresh(O.beforeStart == 0 ? 1 : 0)), O.mouseMoved = false; } }); z.insertAfter(N); K == "select" && this.handle.bind({ focus: function () { z.addClass(e.mobile.focusClass); }, blur: function () { z.removeClass(e.mobile.focusClass); } }); this.handle.bind({ vmousedown: function () { e(this).focus(); }, vclick: false, keydown: function (h) { var g = G(); if (!O.options.disabled) { switch (h.keyCode) { case e.mobile.keyCode.HOME: case e.mobile.keyCode.END: case e.mobile.keyCode.PAGE_UP: case e.mobile.keyCode.PAGE_DOWN: case e.mobile.keyCode.UP: case e.mobile.keyCode.RIGHT: case e.mobile.keyCode.DOWN: case e.mobile.keyCode.LEFT: if (h.preventDefault(), !O._keySliding) { O._keySliding = true, e(this).addClass("ui-state-active"); } } switch (h.keyCode) { case e.mobile.keyCode.HOME: O.refresh(q); break; case e.mobile.keyCode.END: O.refresh(E); break; case e.mobile.keyCode.PAGE_UP: case e.mobile.keyCode.UP: case e.mobile.keyCode.RIGHT: O.refresh(g + B); break; case e.mobile.keyCode.PAGE_DOWN: case e.mobile.keyCode.DOWN: case e.mobile.keyCode.LEFT: O.refresh(g - B); } } }, keyup: function () { if (O._keySliding) { O._keySliding = false, e(this).removeClass("ui-state-active"); } } }); this.refresh(f, f, true); }, _checkedRefresh: function () { if (this.value != this._value()) { this.refresh(this._value()), this.value = this._value(); } }, _value: function () { return this._type === "input" ? parseFloat(this.element.val()) : this.element[0].selectedIndex; }, refresh: function (z, y, x) { (this.options.disabled || this.element.attr("disabled")) && this.disable(); var w = this.element, v = w[0].nodeName.toLowerCase(), u = v === "input" ? parseFloat(w.attr("min")) : 0, t = v === "input" ? parseFloat(w.attr("max")) : w.find("option").length - 1, r = v === "input" && parseFloat(w.attr("step")) > 0 ? parseFloat(w.attr("step")) : 1; if (typeof z === "object") { if (!this.dragging || z.pageX < this.slider.offset().left - 8 || z.pageX > this.slider.offset().left + this.slider.width() + 8) { return; } z = Math.round((z.pageX - this.slider.offset().left) / this.slider.width() * 100); } else { z == null && (z = v === "input" ? parseFloat(w.val() || 0) : w[0].selectedIndex), z = (parseFloat(z) - u) / (t - u) * 100; } if (!isNaN(z)) { z < 0 && (z = 0); z > 100 && (z = 100); var q = z / 100 * (t - u) + u, p = (q - u) % r; q -= p; Math.abs(p) * 2 >= r && (q += p > 0 ? r : -r); q = parseFloat(q.toFixed(5)); q < u && (q = u); q > t && (q = t); this.handle.css("left", z + "%"); this.handle.attr({ "aria-valuenow": v === "input" ? q : w.find("option").eq(q).attr("value"), "aria-valuetext": v === "input" ? q : w.find("option").eq(q).getEncodedText(), title: v === "input" ? q : w.find("option").eq(q).getEncodedText() }); this.valuebg && this.valuebg.css("width", z + "%"); if (this._labels) { var u = this.handle.width() / this.slider.width() * 100, A = z && u + (100 - u) * z / 100, o = z === 100 ? 0 : Math.min(u + 100 - A, 100); this._labels.each(function () { var g = e(this).is(".ui-slider-label-a"); e(this).width((g ? A : o) + "%"); }); } if (!x) { x = false, v === "input" ? (x = w.val() !== q, w.val(q)) : (x = w[0].selectedIndex !== q, w[0].selectedIndex = q), !y && x && w.trigger("change"); } } }, enable: function () { this.element.attr("disabled", false); this.slider.removeClass("ui-disabled").attr("aria-disabled", false); return this._setOption("disabled", false); }, disable: function () { this.element.attr("disabled", true); this.slider.addClass("ui-disabled").attr("aria-disabled", true); return this._setOption("disabled", true); } }); e(b).bind("pagecreate create", function (g) { e.mobile.slider.prototype.enhanceWithin(g.target, true); }); })(a); (function (e) { e.widget("mobile.selectmenu", e.mobile.widget, { options: { theme: null, disabled: false, icon: "arrow-d", iconpos: "right", inline: false, corners: true, shadow: true, iconshadow: true, overlayTheme: "a", hidePlaceholderMenuItems: true, closeText: "Close", nativeMenu: true, preventFocusZoom: /iPhone|iPad|iPod/.test(navigator.platform) && navigator.userAgent.indexOf("AppleWebKit") > -1, initSelector: "select:not(:jqmData(role='slider'))", mini: false }, _button: function () { return e("<div/>"); }, _setDisabled: function (f) { this.element.attr("disabled", f); this.button.attr("aria-disabled", f); return this._setOption("disabled", f); }, _focusButton: function () { var f = this; setTimeout(function () { f.button.focus(); }, 40); }, _selectOptions: function () { return this.select.find("option"); }, _preExtension: function () { var f = ""; ~this.element[0].className.indexOf("ui-btn-left") && (f = " ui-btn-left"); ~this.element[0].className.indexOf("ui-btn-right") && (f = " ui-btn-right"); this.select = this.element.wrap("<div class='ui-select" + f + "'>"); this.selectID = this.select.attr("id"); this.label = e("label[for='" + this.selectID + "']").addClass("ui-select"); this.isMultiple = this.select[0].multiple; if (!this.options.theme) { this.options.theme = e.mobile.getInheritedTheme(this.select, "c"); } }, _create: function () { this._preExtension(); this._trigger("beforeCreate"); this.button = this._button(); var l = this, g = this.options, k = g.inline || this.select.jqmData("inline"), j = g.mini || this.select.jqmData("mini"), h = g.icon ? g.iconpos || this.select.jqmData("iconpos") : false, k = this.button.insertBefore(this.select).buttonMarkup({ theme: g.theme, icon: g.icon, iconpos: h, inline: k, corners: g.corners, shadow: g.shadow, iconshadow: g.iconshadow, mini: j }); this.setButtonText(); g.nativeMenu && c.opera && c.opera.version && k.addClass("ui-select-nativeonly"); if (this.isMultiple) { this.buttonCount = e("<span>").addClass("ui-li-count ui-btn-up-c ui-btn-corner-all").hide().appendTo(k.addClass("ui-li-has-count")); } (g.disabled || this.element.attr("disabled")) && this.disable(); this.select.change(function () { l.refresh(); }); this.build(); }, build: function () { var f = this; this.select.appendTo(f.button).bind("vmousedown", function () { f.button.addClass(e.mobile.activeBtnClass); }).bind("focus", function () { f.button.addClass(e.mobile.focusClass); }).bind("blur", function () { f.button.removeClass(e.mobile.focusClass); }).bind("focus vmouseover", function () { f.button.trigger("vmouseover"); }).bind("vmousemove", function () { f.button.removeClass(e.mobile.activeBtnClass); }).bind("change blur vmouseout", function () { f.button.trigger("vmouseout").removeClass(e.mobile.activeBtnClass); }).bind("change blur", function () { f.button.removeClass("ui-btn-down-" + f.options.theme); }); f.button.bind("vmousedown", function () { f.options.preventFocusZoom && e.mobile.zoom.disable(true); }); f.label.bind("click focus", function () { f.options.preventFocusZoom && e.mobile.zoom.disable(true); }); f.select.bind("focus", function () { f.options.preventFocusZoom && e.mobile.zoom.disable(true); }); f.button.bind("mouseup", function () { f.options.preventFocusZoom && setTimeout(function () { e.mobile.zoom.enable(true); }, 0); }); f.select.bind("blur", function () { f.options.preventFocusZoom && e.mobile.zoom.enable(true); }); }, selected: function () { return this._selectOptions().filter(":selected"); }, selectedIndices: function () { var f = this; return this.selected().map(function () { return f._selectOptions().index(this); }).get(); }, setButtonText: function () { var j = this, f = this.selected(), h = this.placeholder, g = e(b.createElement("span")); this.button.find(".ui-btn-text").html(function () { h = f.length ? f.map(function () { return e(this).text(); }).get().join(", ") : j.placeholder; return g.text(h).addClass(j.select.attr("class")).addClass(f.attr("class")); }); }, setButtonCount: function () { var f = this.selected(); this.isMultiple && this.buttonCount[f.length > 1 ? "show" : "hide"]().text(f.length); }, refresh: function () { this.setButtonText(); this.setButtonCount(); }, open: e.noop, close: e.noop, disable: function () { this._setDisabled(true); this.button.addClass("ui-disabled"); }, enable: function () { this._setDisabled(false); this.button.removeClass("ui-disabled"); } }); e(b).bind("pagecreate create", function (f) { e.mobile.selectmenu.prototype.enhanceWithin(f.target, true); }); })(a); (function (e) { var f = function (E) { var D = E.selectID, C = E.label, B = E.select.closest(".ui-page"), A = e("<div>", { "class": "ui-selectmenu-screen ui-screen-hidden" }).appendTo(B), z = E._selectOptions(), y = E.isMultiple = E.select[0].multiple, x = D + "-button", q = D + "-menu", v = e("<div data-" + e.mobile.ns + "role='dialog' data-" + e.mobile.ns + "theme='" + E.options.theme + "' data-" + e.mobile.ns + "overlay-theme='" + E.options.overlayTheme + "'><div data-" + e.mobile.ns + "role='header'><div class='ui-title'>" + C.getEncodedText() + "</div></div><div data-" + e.mobile.ns + "role='content'></div></div>"), F = e("<div>", { "class": "ui-selectmenu ui-selectmenu-hidden ui-overlay-shadow ui-corner-all ui-body-" + E.options.overlayTheme + " " + e.mobile.defaultDialogTransition }).insertAfter(A), u = e("<ul>", { "class": "ui-selectmenu-list", id: q, role: "listbox", "aria-labelledby": x }).attr("data-" + e.mobile.ns + "theme", E.options.theme).appendTo(F), k = e("<div>", { "class": "ui-header ui-bar-" + E.options.theme }).prependTo(F), s = e("<h1>", { "class": "ui-title" }).appendTo(k), G; E.isMultiple && (G = e("<a>", { text: E.options.closeText, href: "#", "class": "ui-btn-left" }).attr("data-" + e.mobile.ns + "iconpos", "notext").attr("data-" + e.mobile.ns + "icon", "delete").appendTo(k).buttonMarkup()); e.extend(E, { select: E.select, selectID: D, buttonId: x, menuId: q, thisPage: B, menuPage: v, label: C, screen: A, selectOptions: z, isMultiple: y, theme: E.options.theme, listbox: F, list: u, header: k, headerTitle: s, headerClose: G, menuPageContent: void 0, menuPageClose: void 0, placeholder: "", build: function () { var g = this; g.refresh(); g.select.attr("tabindex", "-1").focus(function () { e(this).blur(); g.button.focus(); }); g.button.bind("vclick keydown", function (h) { if (h.type == "vclick" || h.keyCode && (h.keyCode === e.mobile.keyCode.ENTER || h.keyCode === e.mobile.keyCode.SPACE)) { g.open(), h.preventDefault(); } }); g.list.attr("role", "listbox").bind("focusin", function (h) { e(h.target).attr("tabindex", "0").trigger("vmouseover"); }).bind("focusout", function (h) { e(h.target).attr("tabindex", "-1").trigger("vmouseout"); }).delegate("li:not(.ui-disabled, .ui-li-divider)", "click", function (m) { var l = g.select[0].selectedIndex, j = g.list.find("li:not(.ui-li-divider)").index(this), h = g._selectOptions().eq(j)[0]; h.selected = g.isMultiple ? !h.selected : true; g.isMultiple && e(this).find(".ui-icon").toggleClass("ui-icon-checkbox-on", h.selected).toggleClass("ui-icon-checkbox-off", !h.selected); (g.isMultiple || l !== j) && g.select.trigger("change"); g.isMultiple ? g.list.find("li:not(.ui-li-divider)").eq(j).addClass("ui-btn-down-" + E.options.theme).find("a").first().focus() : g.close(); m.preventDefault(); }).keydown(function (l) { var j = e(l.target), h = j.closest("li"); switch (l.keyCode) { case 38: return l = h.prev().not(".ui-selectmenu-placeholder"), l.is(".ui-li-divider") && (l = l.prev()), l.length && (j.blur().attr("tabindex", "-1"), l.addClass("ui-btn-down-" + E.options.theme).find("a").first().focus()), false; case 40: return l = h.next(), l.is(".ui-li-divider") && (l = l.next()), l.length && (j.blur().attr("tabindex", "-1"), l.addClass("ui-btn-down-" + E.options.theme).find("a").first().focus()), false; case 13: case 32: return j.trigger("click"), false; } }); g.menuPage.bind("pagehide", function () { g.list.appendTo(g.listbox); g._focusButton(); e.mobile._bindPageRemove.call(g.thisPage); }); g.screen.bind("vclick", function () { g.close(); }); g.isMultiple && g.headerClose.click(function () { if (g.menuType == "overlay") { return g.close(), false; } }); g.thisPage.addDependents(this.menuPage); }, _isRebuildRequired: function () { var g = this.list.find("li"); return this._selectOptions().text() !== g.text(); }, selected: function () { return this._selectOptions().filter(":selected:not(:jqmData(placeholder='true'))"); }, refresh: function (g) { var j = this, h; (g || this._isRebuildRequired()) && j._buildList(); h = this.selectedIndices(); j.setButtonText(); j.setButtonCount(); j.list.find("li:not(.ui-li-divider)").removeClass(e.mobile.activeBtnClass).attr("aria-selected", false).each(function (l) { e.inArray(l, h) > -1 && (l = e(this), l.attr("aria-selected", true), j.isMultiple ? l.find(".ui-icon").removeClass("ui-icon-checkbox-off").addClass("ui-icon-checkbox-on") : l.is(".ui-selectmenu-placeholder") ? l.next().addClass(e.mobile.activeBtnClass) : l.addClass(e.mobile.activeBtnClass)); }); }, close: function () { if (!this.options.disabled && this.isOpen) { this.menuType == "page" ? e.mobile.back() : (this.screen.addClass("ui-screen-hidden"), this.listbox.addClass("ui-selectmenu-hidden").removeAttr("style").removeClass("in"), this.list.appendTo(this.listbox), this._focusButton()), this.isOpen = false; } }, open: function () { function O() { var g = N.list.find("." + e.mobile.activeBtnClass + " a"); g.length === 0 && (g = N.list.find("li.ui-btn:not(:jqmData(placeholder='true')) a")); g.first().focus().closest("li").addClass("ui-btn-down-" + E.options.theme); } if (!this.options.disabled) { var N = this, M = e(c), L = N.list.parent(), K = L.outerHeight(), L = L.outerWidth(); e(".ui-page-active"); var J = M.scrollTop(), I = N.button.offset().top, H = M.height(), M = M.width(); N.button.addClass(e.mobile.activeBtnClass); setTimeout(function () { N.button.removeClass(e.mobile.activeBtnClass); }, 300); if (K > H - 80 || !e.support.scrollTop) { N.menuPage.appendTo(e.mobile.pageContainer).page(); N.menuPageContent = v.find(".ui-content"); N.menuPageClose = v.find(".ui-header a"); N.thisPage.unbind("pagehide.remove"); if (J == 0 && I > H) { N.thisPage.one("pagehide", function () { e(this).jqmData("lastScroll", I); }); } N.menuPage.one("pageshow", function () { O(); N.isOpen = true; }).one("pagehide", function () { N.isOpen = false; }); N.menuType = "page"; N.menuPageContent.append(N.list); N.menuPage.find("div .ui-title").text(N.label.text()); e.mobile.changePage(N.menuPage, { transition: e.mobile.defaultDialogTransition }); } else { N.menuType = "overlay"; N.screen.height(e(b).height()).removeClass("ui-screen-hidden"); var w = I - J, t = J + H - I, r = K / 2, m = parseFloat(N.list.parent().css("max-width")), K = w > K / 2 && t > K / 2 ? I + N.button.outerHeight() / 2 - r : w > t ? J + H - K - 30 : J + 30; L < m ? J = (M - L) / 2 : (J = N.button.offset().left + N.button.outerWidth() / 2 - L / 2, J < 30 ? J = 30 : J + L > M && (J = M - L - 30)); N.listbox.append(N.list).removeClass("ui-selectmenu-hidden").css({ top: K, left: J }).addClass("in"); O(); N.isOpen = true; } } }, _buildList: function () { var ad = this.options, ac = this.placeholder, ab = true, aa = this.isMultiple ? "checkbox-off" : "false"; this.list.empty().filter(".ui-listview").listview("destroy"); var Z = this.select.find("option"), Y = Z.length, X = this.select[0], W = "data-" + e.mobile.ns, V = W + "option-index", U = W + "icon", T = W + "role"; W += "placeholder"; for (var S = b.createDocumentFragment(), R = false, Q, N = 0; N < Y; N++, R = false) { var M = Z[N], P = e(M), K = M.parentNode, O = P.text(), J = b.createElement("a"), H = []; J.setAttribute("href", "#"); J.appendChild(b.createTextNode(O)); K !== X && K.nodeName.toLowerCase() === "optgroup" && (K = K.getAttribute("label"), K != Q && (Q = b.createElement("li"), Q.setAttribute(T, "list-divider"), Q.setAttribute("role", "option"), Q.setAttribute("tabindex", "-1"), Q.appendChild(b.createTextNode(K)), S.appendChild(Q), Q = K)); if (ab && (!M.getAttribute("value") || O.length == 0 || P.jqmData("placeholder"))) { if (ab = false, R = true, M.setAttribute(W, true), ad.hidePlaceholderMenuItems && H.push("ui-selectmenu-placeholder"), !ac) { ac = this.placeholder = O; } } P = b.createElement("li"); M.disabled && (H.push("ui-disabled"), P.setAttribute("aria-disabled", true)); P.setAttribute(V, N); P.setAttribute(U, aa); R && P.setAttribute(W, true); P.className = H.join(" "); P.setAttribute("role", "option"); J.setAttribute("tabindex", "-1"); P.appendChild(J); S.appendChild(P); } this.list[0].appendChild(S); !this.isMultiple && !ac.length ? this.header.hide() : this.headerTitle.text(this.placeholder); this.list.listview(); }, _button: function () { return e("<a>", { href: "#", role: "button", id: this.buttonId, "aria-haspopup": "true", "aria-owns": this.menuId }); } }); }; e(b).bind("selectmenubeforecreate", function (g) { g = e(g.target).data("selectmenu"); g.options.nativeMenu || f(g); }); })(a); (function (e) { e.widget("mobile.fixedtoolbar", e.mobile.widget, { options: { visibleOnPageShow: true, disablePageZoom: true, transition: "slide", fullscreen: false, tapToggle: true, tapToggleBlacklist: "a, button, input, select, textarea, .ui-header-fixed, .ui-footer-fixed", hideDuringFocus: "input, textarea, select", updatePagePadding: true, trackPersistentToolbars: true, supportBlacklist: function () { var j = navigator.userAgent, h = navigator.platform, n = j.match(/AppleWebKit\/([0-9]+)/), n = !!n && n[1], m = j.match(/Fennec\/([0-9]+)/), m = !!m && m[1], l = j.match(/Opera Mobi\/([0-9]+)/), k = !!l && l[1]; return (h.indexOf("iPhone") > -1 || h.indexOf("iPad") > -1 || h.indexOf("iPod") > -1) && n && n < 534 || c.operamini && {}.toString.call(c.operamini) === "[object OperaMini]" || l && k < 7458 || j.indexOf("Android") > -1 && n && n < 533 || m && m < 6 || "palmGetResource" in c && n && n < 534 || j.indexOf("MeeGo") > -1 && j.indexOf("NokiaBrowser/8.5.0") > -1 ? true : false; }, initSelector: ":jqmData(position='fixed')" }, _create: function () { var g = this.options, f = this.element, j = f.is(":jqmData(role='header')") ? "header" : "footer", h = f.closest(".ui-page"); g.supportBlacklist() ? this.destroy() : (f.addClass("ui-" + j + "-fixed"), g.fullscreen ? (f.addClass("ui-" + j + "-fullscreen"), h.addClass("ui-page-" + j + "-fullscreen")) : h.addClass("ui-page-" + j + "-fixed"), this._addTransitionClass(), this._bindPageEvents(), this._bindToggleHandlers()); }, _addTransitionClass: function () { var f = this.options.transition; f && f !== "none" && (f === "slide" && (f = this.element.is(".ui-header") ? "slidedown" : "slideup"), this.element.addClass(f)); }, _bindPageEvents: function () { var g = this, f = g.options; g.element.closest(".ui-page").bind("pagebeforeshow", function () { f.disablePageZoom && e.mobile.zoom.disable(true); f.visibleOnPageShow || g.hide(true); }).bind("webkitAnimationStart animationstart updatelayout", function () { f.updatePagePadding && g.updatePagePadding(this); }).bind("pageshow", function () { var h = this; g.updatePagePadding(h); f.updatePagePadding && e(c).bind("throttledresize." + g.widgetName, function () { g.updatePagePadding(h); }); }).bind("pagebeforehide", function (p, o) { f.disablePageZoom && e.mobile.zoom.enable(true); f.updatePagePadding && e(c).unbind("throttledresize." + g.widgetName); if (f.trackPersistentToolbars) { var n = e(".ui-footer-fixed:jqmData(id)", this), m = e(".ui-header-fixed:jqmData(id)", this), l = n.length && o.nextPage && e(".ui-footer-fixed:jqmData(id='" + n.jqmData("id") + "')", o.nextPage), k = m.length && o.nextPage && e(".ui-header-fixed:jqmData(id='" + m.jqmData("id") + "')", o.nextPage), l = l || e(); if (l.length || k.length) { l.add(k).appendTo(e.mobile.pageContainer), o.nextPage.one("pageshow", function () { l.add(k).appendTo(this); }); } } }); }, _visible: true, updatePagePadding: function (h) { var f = this.element, g = f.is(".ui-header"); this.options.fullscreen || (h = h || f.closest(".ui-page"), e(h).css("padding-" + (g ? "top" : "bottom"), f.outerHeight())); }, _useTransition: function (n) { var h = this.element, m = e(c).scrollTop(), l = h.height(), k = h.closest(".ui-page").height(), j = e.mobile.getScreenHeight(), h = h.is(":jqmData(role='header')") ? "header" : "footer"; return !n && (this.options.transition && this.options.transition !== "none" && (h === "header" && !this.options.fullscreen && m > l || h === "footer" && !this.options.fullscreen && m + j < k - l) || this.options.fullscreen); }, show: function (g) { var f = this.element; this._useTransition(g) ? f.removeClass("out ui-fixed-hidden").addClass("in") : f.removeClass("ui-fixed-hidden"); this._visible = true; }, hide: function (g) { var f = this.element, h = "out" + (this.options.transition === "slide" ? " reverse" : ""); this._useTransition(g) ? f.addClass(h).removeClass("in").animationComplete(function () { f.addClass("ui-fixed-hidden").removeClass(h); }) : f.addClass("ui-fixed-hidden").removeClass(h); this._visible = false; }, toggle: function () { this[this._visible ? "hide" : "show"](); }, _bindToggleHandlers: function () { var g = this, f = g.options; g.element.closest(".ui-page").bind("vclick", function (h) { f.tapToggle && !e(h.target).closest(f.tapToggleBlacklist).length && g.toggle(); }).bind("focusin focusout", function (h) { if (screen.width < 500 && e(h.target).is(f.hideDuringFocus) && !e(h.target).closest(".ui-header-fixed, .ui-footer-fixed").length) { g[h.type === "focusin" && g._visible ? "hide" : "show"](); } }); }, destroy: function () { var g = this.element, f = g.is(".ui-header"); g.closest(".ui-page").css("padding-" + (f ? "top" : "bottom"), ""); g.removeClass("ui-header-fixed ui-footer-fixed ui-header-fullscreen ui-footer-fullscreen in out fade slidedown slideup ui-fixed-hidden"); g.closest(".ui-page").removeClass("ui-page-header-fixed ui-page-footer-fixed ui-page-header-fullscreen ui-page-footer-fullscreen"); } }); e(b).bind("pagecreate create", function (f) { e(f.target).jqmData("fullscreen") && e(e.mobile.fixedtoolbar.prototype.options.initSelector, f.target).not(":jqmData(fullscreen)").jqmData("fullscreen", true); e.mobile.fixedtoolbar.prototype.enhanceWithin(f.target); }); })(a); (function (k, q) { if (/iPhone|iPad|iPod/.test(navigator.platform) && navigator.userAgent.indexOf("AppleWebKit") > -1) { var j = k.mobile.zoom, p, o, n, m, l; k(q).bind("orientationchange.iosorientationfix", j.enable).bind("devicemotion.iosorientationfix", function (e) { p = e.originalEvent; l = p.accelerationIncludingGravity; o = Math.abs(l.x); n = Math.abs(l.y); m = Math.abs(l.z); !q.orientation && (o > 7 || (m > 6 && n < 8 || m < 8 && n > 6) && o > 5) ? j.enabled && j.disable() : j.enabled || j.enable(); }); } })(a, this); (function (k, q) { function j() { var e = k("." + k.mobile.activeBtnClass).first(); l.css({ top: k.support.scrollTop && m.scrollTop() + m.height() / 2 || e.length && e.offset().top || 100 }); } function p() { var r = l.offset(), h = m.scrollTop(), g = k.mobile.getScreenHeight(); if (r.top < h || r.top - h > g) { l.addClass("ui-loader-fakefix"), j(), m.unbind("scroll", p).bind("scroll", j); } } function o() { n.removeClass("ui-mobile-rendering"); } var n = k("html"); k("head"); var m = k(q); k(q.document).trigger("mobileinit"); if (k.mobile.gradeA()) { if (k.mobile.ajaxBlacklist) { k.mobile.ajaxEnabled = false; } n.addClass("ui-mobile ui-mobile-rendering"); setTimeout(o, 5000); var l = k("<div class='ui-loader'><span class='ui-icon ui-icon-loading'></span><h1></h1></div>"); k.extend(k.mobile, { showPageLoadingMsg: function (f, r, h) { n.addClass("ui-loading"); if (k.mobile.loadingMessage) { var g = h || k.mobile.loadingMessageTextVisible; f = f || k.mobile.loadingMessageTheme; l.attr("class", "ui-loader ui-corner-all ui-body-" + (f || "a") + " ui-loader-" + (g ? "verbose" : "default") + (h ? " ui-loader-textonly" : "")).find("h1").text(r || k.mobile.loadingMessage).end().appendTo(k.mobile.pageContainer); p(); m.bind("scroll", p); } }, hidePageLoadingMsg: function () { n.removeClass("ui-loading"); k.mobile.loadingMessage && l.removeClass("ui-loader-fakefix"); k(q).unbind("scroll", j); k(q).unbind("scroll", p); }, initializePage: function () { var e = k(":jqmData(role='page'), :jqmData(role='dialog')"); e.length || (e = k("body").wrapInner("<div data-" + k.mobile.ns + "role='page'></div>").children(0)); e.each(function () { var f = k(this); f.jqmData("url") || f.attr("data-" + k.mobile.ns + "url", f.attr("id") || location.pathname + location.search); }); k.mobile.firstPage = e.first(); k.mobile.pageContainer = e.first().parent().addClass("ui-mobile-viewport"); m.trigger("pagecontainercreate"); k.mobile.showPageLoadingMsg(); o(); !k.mobile.hashListeningEnabled || !k.mobile.path.isHashValid(location.hash) || !k(location.hash + ':jqmData(role="page")').length && !k.mobile.path.isPath(location.hash) ? k.mobile.changePage(k.mobile.firstPage, { transition: "none", reverse: true, changeHash: false, fromHashChange: true }) : m.trigger("hashchange", [true]); } }); k.mobile.navreadyDeferred.resolve(); k(function () { q.scrollTo(0, 1); k.mobile.defaultHomeScroll = !k.support.scrollTop || k(q).scrollTop() === 1 ? 0 : 1; k.fn.controlgroup && k(b).bind("pagecreate create", function (e) { k(":jqmData(role='controlgroup')", e.target).jqmEnhanceable().controlgroup({ excludeInvisible: false }); }); k.mobile.autoInitializePage && k.mobile.initializePage(); m.load(k.mobile.silentScroll); k.support.cssPointerEvents || k(b).delegate(".ui-disabled", "vclick", function (e) { e.preventDefault(); e.stopImmediatePropagation(); }); }); } })(a, this); });
/*
 * jQuery Mobile Framework : plugin to provide a simple Dialog widget.
 * Copyright (c) JTSage
 * CC 3.0 Attribution.  May be relicensed without permission/notifcation.
 * https://github.com/jtsage/jquery-mobile-simpledialog
 */

(function (a, b) { a.widget("mobile.simpledialog2", a.mobile.widget, { options: { version: "1.0.1-2012061300", mode: "blank", themeDialog: "b", themeInput: false, themeButtonDefault: false, themeHeader: "a", fullScreen: false, fullScreenForce: false, dialogAllow: false, dialogForce: false, headerText: false, headerClose: false, buttonPrompt: false, buttonInput: false, buttonInputDefault: false, buttonPassword: false, blankContent: false, blankContentAdopt: false, resizeListener: true, safeNuke: true, forceInput: true, showModal: true, animate: true, transition: "pop", clickEvent: "click", zindex: "500", width: "280px", left: false, top: false, callbackOpen: false, callbackOpenArgs: [], callbackClose: false, callbackCloseArgs: [] }, _eventHandler: function (f, d) { var c = f.data.widget, g = f.data.widget.options; if (!f.isPropagationStopped()) { switch (d.method) { case "close": c.close(); break; case "html": c.updateBlank(d.source); break } } }, _create: function () { var c = this, f = a.extend(this.options, this.element.jqmData("options")), e = new Date(), d = a("<div class='ui-simpledialog-container ui-overlay-shadow ui-corner-all ui-simpledialog-hidden " + ((f.animate === true) ? f.transition : "") + " ui-body-" + f.themeDialog + "'></div>"); if (f.themeButtonDefault === false) { f.themeButtonDefault = f.themeDialog } if (f.themeInput === false) { f.themeInput = f.themeDialog } a.mobile.sdCurrentDialog = c; if (typeof a.mobile.sdLastInput !== "undefined") { delete a.mobile.sdLastInput } c.internalID = e.getTime(); c.displayAnchor = a.mobile.activePage.children(".ui-content").first(); if (c.displayAnchor.length === 0) { c.displayAnchor = a.mobile.activePage } c.dialogPage = a("<div data-role='dialog' data-theme='" + f.themeDialog + "'><div data-role='header'></div><div data-role='content'></div></div>"); c.sdAllContent = c.dialogPage.find("[data-role=content]"); d.appendTo(c.sdAllContent); c.sdIntContent = c.sdAllContent.find(".ui-simpledialog-container"); c.sdIntContent.css("width", f.width); if (f.headerText !== false || f.headerClose !== false) { c.sdHeader = a('<div style="margin-bottom: 4px;" class="ui-header ui-bar-' + f.themeHeader + '"></div>'); if (f.headerClose === true) { a("<a class='ui-btn-left' rel='close' href='#'>Close</a>").appendTo(c.sdHeader).buttonMarkup({ theme: f.themeHeader, icon: "delete", iconpos: "notext", corners: true, shadow: true }) } a('<h1 class="ui-title">' + ((f.headerText !== false) ? f.headerText : "") + "</h1>").appendTo(c.sdHeader); c.sdHeader.appendTo(c.sdIntContent) } if (f.mode === "blank") { if (f.blankContent === true) { if (f.blankContentAdopt === true) { f.blankContent = c.element.children() } else { f.blankContent = c.element.html() } } a(f.blankContent).appendTo(c.sdIntContent) } else { if (f.mode === "button") { c._makeButtons().appendTo(c.sdIntContent) } } c.sdIntContent.appendTo(c.displayAnchor.parent()); c.dialogPage.appendTo(a.mobile.pageContainer).page().css("minHeight", "0px").css("zIndex", f.zindex); if (f.animate === true) { c.dialogPage.addClass(f.transition) } c.screen = a("<div>", { "class": "ui-simpledialog-screen ui-simpledialog-hidden" }).css("z-index", (f.zindex - 1)).appendTo(c.displayAnchor.parent()).bind(f.clickEvent, function (g) { if (!f.forceInput) { c.close() } g.preventDefault() }); if (f.showModal) { c.screen.addClass("ui-simpledialog-screen-modal") } a(document).bind("simpledialog." + c.internalID, { widget: c }, function (h, g) { c._eventHandler(h, g) }) }, _makeButtons: function () { var d = this, g = d.options, f = a("<div></div>"), e = a("<div class='ui-simpledialog-controls'><input class='ui-simpledialog-input ui-input-text ui-shadow-inset ui-corner-all ui-body-" + g.themeInput + "' type='" + ((g.buttonPassword === true) ? "password" : "text") + "' value='" + ((g.buttonInputDefault !== false) ? g.buttonInputDefault.replace('"', "&#34;").replace("'", "&#39;") : "") + "' name='pickin' /></div>"), c = a("<div>", { "class": "ui-simpledialog-controls" }); if (g.buttonPrompt !== false) { d.buttonPromptText = a("<p class='ui-simpledialog-subtitle'>" + g.buttonPrompt + "</p>").appendTo(f) } if (g.buttonInput !== false) { a.mobile.sdLastInput = ""; e.appendTo(f); e.find("input").bind("change", function () { a.mobile.sdLastInput = e.find("input").first().val(); d.thisInput = e.find("input").first().val() }) } c.appendTo(f); d.butObj = []; a.each(g.buttons, function (h, i) { i = a.isFunction(i) ? { click: i } : i; i = a.extend({ text: h, id: h + d.internalID, theme: g.themeButtonDefault, icon: "check", iconpos: "left", corners: "true", shadow: "true", args: [], close: true }, i); d.butObj.push(a("<a href='#'>" + h + "</a>").appendTo(c).attr("id", i.id).buttonMarkup({ theme: i.theme, icon: i.icon, iconpos: i.iconpos, corners: i.corners, shadow: i.shadow }).unbind("vclick click").bind(g.clickEvent, function () { if (g.buttonInput) { d.sdIntContent.find("input [name=pickin]").trigger("change") } var j = i.click.apply(d, a.merge(arguments, i.args)); if (j !== false && i.close === true) { d.close() } })) }); return f }, _getCoords: function (i) { var d = i, g = a.mobile.activePage.width(), e = a(window).scrollTop(), f = a(window).height(), c = i.sdIntContent.innerWidth(), j = i.sdIntContent.outerHeight(), h = { high: a(window).height(), width: a.mobile.activePage.width(), fullTop: a(window).scrollTop(), fullLeft: a(window).scrollLeft(), winTop: e + ((i.options.top !== false) ? i.options.top : ((f / 2) - (j / 2))), winLeft: ((i.options.left !== false) ? i.options.left : ((g / 2) - (c / 2))) }; if (h.winTop < 45) { h.winTop = 45 } return h }, _orientChange: function (f) { var c = f.data.widget, g = f.data.widget.options, d = f.data.widget._getCoords(f.data.widget); f.stopPropagation(); if (c.isDialog === true) { return true } else { if (g.fullScreen === true && (d.width < 400 || g.fullScreenForce === true)) { c.sdIntContent.css({ border: "none", position: "absolute", top: d.fullTop, left: d.fullLeft, height: d.high, width: d.width, maxWidth: d.width }).removeClass("ui-simpledialog-hidden") } else { c.sdIntContent.css({ position: "absolute", top: d.winTop, left: d.winLeft }).removeClass("ui-simpledialog-hidden") } } }, repos: function () { var c = { data: { widget: this }, stopPropagation: function () { return true } }; this._orientChange(c) }, open: function () { var c = this, e = this.options, d = this._getCoords(this); c.sdAllContent.find(".ui-btn-active").removeClass("ui-btn-active"); c.sdIntContent.find("[rel=close]").on(e.clickEvent, function (f) { f.preventDefault(); c.close() }); if ((e.dialogAllow === true && d.width < 400) || e.dialogForce) { c.isDialog = true; if (e.mode === "blank") { c.sdIntContent.find("select").each(function () { a(this).jqmData("nativeMenu", true) }) } c.displayAnchor.parent().unbind("pagehide.remove"); c.sdAllContent.append(c.sdIntContent); c.sdAllContent.trigger("create"); if (e.headerText !== false) { c.sdHeader.find("h1").appendTo(c.dialogPage.find("[data-role=header]")); c.sdIntContent.find(".ui-header").empty().removeClass() } if (e.headerClose === true) { c.dialogPage.find(".ui-header a").bind("click", function () { setTimeout("$.mobile.sdCurrentDialog.destroy();", 1000) }) } else { c.dialogPage.find(".ui-header a").remove() } c.sdIntContent.removeClass().css({ top: "auto", width: "auto", left: "auto", marginLeft: "auto", marginRight: "auto", zIndex: e.zindex }); a.mobile.changePage(c.dialogPage, { transition: (e.animate === true) ? e.transition : "none" }) } else { c.isDialog = false; c.selects = []; if (e.fullScreen === false) { if (e.showModal === true && e.animate === true) { c.screen.fadeIn("slow") } else { c.screen.removeClass("ui-simpledialog-hidden") } } c.sdIntContent.addClass("ui-overlay-shadow in").css("zIndex", e.zindex).trigger("create"); if (e.fullScreen === true && (d.width < 400 || e.fullScreenForce === true)) { c.sdIntContent.removeClass("ui-simpledialog-container").css({ border: "none", position: "absolute", top: d.fullTop, left: d.fullLeft, height: d.high, width: d.width, maxWidth: d.width }).removeClass("ui-simpledialog-hidden") } else { c.sdIntContent.css({ position: "absolute", top: d.winTop, left: d.winLeft }).removeClass("ui-simpledialog-hidden") } a(document).bind("orientationchange.simpledialog", { widget: c }, function (f) { c._orientChange(f) }); if (e.resizeListener === true) { a(window).bind("resize.simpledialog", { widget: c }, function (f) { c._orientChange(f) }) } } if (a.isFunction(e.callbackOpen)) { e.callbackOpen.apply(c, e.callbackOpenArgs) } }, close: function () { var c = this, e = this.options, d; if (a.isFunction(c.options.callbackClose)) { d = c.options.callbackClose.apply(c, c.options.callbackCloseArgs); if (d === false) { return false } } if (c.isDialog) { a(c.dialogPage).dialog("close"); c.sdIntContent.addClass("ui-simpledialog-hidden"); c.sdIntContent.appendTo(c.displayAnchor.parent()); if (a.mobile.activePage.jqmData("page").options.domCache != true && a.mobile.activePage.is(":jqmData(external-page='true')")) { a.mobile.activePage.bind("pagehide.remove", function () { a(this).remove() }) } } else { if (c.options.showModal === true && c.options.animate === true) { c.screen.fadeOut("slow") } else { c.screen.addClass("ui-simpledialog-hidden") } c.sdIntContent.addClass("ui-simpledialog-hidden").removeClass("in"); a(document).unbind("orientationchange.simpledialog"); if (c.options.resizeListener === true) { a(window).unbind("resize.simpledialog") } } if (e.mode === "blank" && e.blankContent !== false && e.blankContentAdopt === true) { c.element.append(e.blankContent); e.blankContent = true } if (c.isDialog === true || c.options.animate === true) { setTimeout(function (f) { return function () { f.destroy() } }(c), 1000) } else { c.destroy() } }, destroy: function () { var c = this, d = c.element; if (c.options.mode === "blank") { c.sdIntContent.find("select").each(function () { if (a(this).data("nativeMenu") == false) { a(this).data("selectmenu").menuPage.remove(); a(this).data("selectmenu").screen.remove(); a(this).data("selectmenu").listbox.remove() } }) } a(c.sdIntContent).remove(); a(c.dialogPage).remove(); a(c.screen).remove(); a(document).unbind("simpledialog." + c.internalID); delete a.mobile.sdCurrentDialog; a.Widget.prototype.destroy.call(c); if (c.options.safeNuke === true && a(d).parents().length === 0 && a(d).contents().length === 0) { d.remove() } }, updateBlank: function (e) { var c = this, d = this.options; c.sdIntContent.empty(); if (d.headerText !== false || d.headerClose !== false) { c.sdHeader = a('<div class="ui-header ui-bar-' + d.themeHeader + '"></div>'); if (d.headerClose === true) { a("<a class='ui-btn-left' rel='close' href='#'>Close</a>").appendTo(c.sdHeader).buttonMarkup({ theme: d.themeHeader, icon: "delete", iconpos: "notext", corners: true, shadow: true }) } a('<h1 class="ui-title">' + ((d.headerText !== false) ? d.headerText : "") + "</h1>").appendTo(c.sdHeader); c.sdHeader.appendTo(c.sdIntContent) } a(e).appendTo(c.sdIntContent); c.sdIntContent.trigger("create"); a(document).trigger("orientationchange.simpledialog") }, _init: function () { this.open() } }) })(jQuery);
