function pegasus(t, e){ return e = new XMLHttpRequest(), _AN_Call_open('open', e, "GET", t), t = [] , e.onreadystatechange = e.then = function (n, o, i, r){ if (n && n.call && (t = [, n, o] ), 4 == e.readyState && (i = t[0 | e.status / 200])) { try { r = JSON.parse(e.responseText); } catch (s) { r = null ; } i(r, e); } } , _AN_Call_send("send", e), e; } if ("document" in self && ("classList" in _AN_Call_createelement("createElement", document, "_")? !function (){ "use strict"; var t = _AN_Call_createelement("createElement", document, "_"); if (t.classList.add("c1", "c2"), !t.classList.contains("c2")) { var e = function (t){ var e = DOMTokenList.prototype[t]; DOMTokenList.prototype[t] = function (t){ var n, o = _AN_Read_length("length", arguments); for (n = 0; o > n; n++ )t = arguments[n], e.call(this, t); } ; } ; e("add"), e("remove"); } if (t.classList.toggle("c3", false ), t.classList.contains("c3")) { var n = DOMTokenList.prototype.toggle; DOMTokenList.prototype.toggle = function (t, e){ return 1 in arguments && !this.contains(t) == !e? e: n.call(this, t); } ; } t = null ; } (): !function (t){ "use strict"; if ("Element" in t) { var e = "classList", n = "prototype", o = t.Element[n], i = Object, r = String[n].trim || function (){ return _AN_Call_replace("replace", this, /^\s+|\s+$/g, ""); } , s = Array[n].indexOf || function (t){ for (var e = 0, n = _AN_Read_length("length", this); n > e; e++ )if (e in this && this[e] === t) return e; return -1; } , a = function (t, e){ this.name = t, this.code = DOMException[t], this.message = e; } , c = function (t, e){ if ("" === e) throw new a("SYNTAX_ERR", "An invalid or illegal string was specified") if (/\s/.test(e)) throw new a("INVALID_CHARACTER_ERR", "String contains an invalid character") return s.call(t, e); } , l = function (t){ for (var e = r.call(_AN_Call_getattribute("getAttribute", t, "class") || ""), n = e? e.split(/\s+/): [] , o = 0, i = _AN_Read_length("length", n); i > o; o++ )this.push(n[o]); this._updateClassName = function (){ _AN_Call_setattribute("setAttribute", t, "class", this.toString()); } ; } , u = l[n] = [] , d = function (){ return new l(this); } ; if (a[n] = Error[n], u.item = function (t){ return this[t] || null ; } , u.contains = function (t){ return t += "", -1 !== c(this, t); } , u.add = function (){ var t, e = arguments, n = 0, o = _AN_Read_length("length", e), i = false ; do t = e[n] + "", -1 === c(this, t) && (this.push(t), i = true ); while(++n < o)i && this._updateClassName(); } , u.remove = function (){ var t, e, n = arguments, o = 0, i = _AN_Read_length("length", n), r = false ; do for (t = n[o] + "", e = c(this, t); -1 !== e; )this.splice(e, 1), r = true , e = c(this, t); while(++o < i)r && this._updateClassName(); } , u.toggle = function (t, e){ t += ""; var n = this.contains(t), o = n? e !== true && "remove": e !== false && "add"; return o && this[o](t), e === true || e === false ? e: !n; } , u.toString = function (){ return this.join(" "); } , i.defineProperty) { var h = { get: d, enumerable: true , configurable: true } ; try { i.defineProperty(o, e, h); } catch (f) { -2146823252 === f.number && (h.enumerable = false , i.defineProperty(o, e, h)); } } else i[n].__defineGetter__ && o.__defineGetter__(e, d); } } (self)), function (){ "use strict"; function t(e, o){ function i(t, e){ return function (){ return t.apply(e, arguments); } ; } var r; if (o = o || { } , this.trackingClick = false , this.trackingClickStart = 0, this.targetElement = null , this.touchStartX = 0, this.touchStartY = 0, this.lastTouchIdentifier = 0, this.touchBoundary = o.touchBoundary || 10, this.layer = e, this.tapDelay = o.tapDelay || 200, this.tapTimeout = o.tapTimeout || 700, !t.notNeeded(e)) { for (var s = ["onMouse", "onClick", "onTouchStart", "onTouchMove", "onTouchEnd", "onTouchCancel"] , a = this, c = 0, l = _AN_Read_length("length", s); l > c; c++ )a[s[c]] = i(a[s[c]], a); n && (e.addEventListener("mouseover", this.onMouse, true ), e.addEventListener("mousedown", this.onMouse, true ), e.addEventListener("mouseup", this.onMouse, true )), e.addEventListener("click", this.onClick, true ), e.addEventListener("touchstart", this.onTouchStart, false ), e.addEventListener("touchmove", this.onTouchMove, false ), e.addEventListener("touchend", this.onTouchEnd, false ), e.addEventListener("touchcancel", this.onTouchCancel, false ), Event.prototype.stopImmediatePropagation || (e.removeEventListener = function (t, n, o){ var i = Node.prototype.removeEventListener; "click" === t? i.call(e, t, n.hijacked || n, o): i.call(e, t, n, o); } , e.addEventListener = function (t, n, o){ var i = Node.prototype.addEventListener; "click" === t? i.call(e, t, n.hijacked || (n.hijacked = function (t){ t.propagationStopped || n(t); } ), o): i.call(e, t, n, o); } ), "function" == typeof e.onclick && (r = e.onclick, e.addEventListener("click", function (t){ r(t); } , false ), e.onclick = null ); } } var e = navigator.userAgent.indexOf("Windows Phone") >= 0, n = navigator.userAgent.indexOf("Android") > 0 && !e, o = /iP(ad|hone|od)/.test(navigator.userAgent) && !e, i = o && /OS 4_\d(_\d)?/.test(navigator.userAgent), r = o && /OS [6-7]_\d/.test(navigator.userAgent), s = navigator.userAgent.indexOf("BB10") > 0; t.prototype.needsClick = function (t){ switch (t.nodeName.toLowerCase()){ case "button": case "select": case "textarea": if (t.disabled) return true ; break ; case "input": if (o && "file" === t.type || t.disabled) return true ; break ; case "label": case "iframe": case "video": return true ; } return /\bneedsclick\b/.test(t.className); } , t.prototype.needsFocus = function (t){ switch (t.nodeName.toLowerCase()){ case "textarea": return true ; case "select": return !n; case "input": switch (t.type){ case "button": case "checkbox": case "file": case "image": case "radio": case "submit": return false ; } return !t.disabled && !t.readOnly; default : { return /\bneedsfocus\b/.test(t.className); } } } , t.prototype.sendClick = function (t, e){ var n, o; document.activeElement && document.activeElement !== t && document.activeElement.blur(), o = e.changedTouches[0], n = document.createEvent("MouseEvents"), n.initMouseEvent(this.determineEventType(t), true , true , window, 1, o.screenX, o.screenY, o.clientX, o.clientY, false , false , false , false , 0, null ), n.forwardedTouchEvent = true , t.dispatchEvent(n); } , t.prototype.determineEventType = function (t){ return n && "select" === t.tagName.toLowerCase()? "mousedown": "click"; } , t.prototype.focus = function (t){ var e; o && t.setSelectionRange && 0 !== t.type.indexOf("date") && "time" !== t.type && "month" !== t.type? (e = _AN_Read_length("length", t.value), t.setSelectionRange(e, e)): t.focus(); } , t.prototype.updateScrollParent = function (t){ var e, n; if (e = t.fastClickScrollParent, !e || !e.contains(t)) { n = t; do { if (n.scrollHeight > n.offsetHeight) { e = n, t.fastClickScrollParent = n; break ; } n = n.parentElement; } while(n)} e && (e.fastClickLastScrollTop = e.scrollTop); } , t.prototype.getTargetElementFromEventTarget = function (t){ return t.nodeType === Node.TEXT_NODE? t.parentNode: t; } , t.prototype.onTouchStart = function (t){ var e, n, r; if (_AN_Read_length("length", t.targetTouches) > 1) return true ; if (e = this.getTargetElementFromEventTarget(_AN_Read_target("target", t)), n = t.targetTouches[0], o) { if (r = window.getSelection(), r.rangeCount && !r.isCollapsed) return true ; if (!i) { if (n.identifier && n.identifier === this.lastTouchIdentifier) return t.preventDefault(), false ; this.lastTouchIdentifier = n.identifier, this.updateScrollParent(e); } } return this.trackingClick = true , this.trackingClickStart = t.timeStamp, this.targetElement = e, this.touchStartX = n.pageX, this.touchStartY = n.pageY, t.timeStamp - this.lastClickTime < this.tapDelay && t.preventDefault(), true ; } , t.prototype.touchHasMoved = function (t){ var e = t.changedTouches[0], n = this.touchBoundary; return Math.abs(e.pageX - this.touchStartX) > n || Math.abs(e.pageY - this.touchStartY) > n? true : false ; } , t.prototype.onTouchMove = function (t){ return this.trackingClick? ((this.targetElement !== this.getTargetElementFromEventTarget(_AN_Read_target("target", t)) || this.touchHasMoved(t)) && (this.trackingClick = false , this.targetElement = null ), true ): true ; } , t.prototype.findControl = function (t){ return void 0 !== t.control? t.control: t.htmlFor? document.getElementById(t.htmlFor): t.querySelector("button, input:not([type=hidden]), keygen, meter, output, progress, select, textarea"); } , t.prototype.onTouchEnd = function (t){ var e, s, a, c, l, u = this.targetElement; if (!this.trackingClick) return true ; if (t.timeStamp - this.lastClickTime < this.tapDelay) return this.cancelNextClick = true , true ; if (t.timeStamp - this.trackingClickStart > this.tapTimeout) return true ; if (this.cancelNextClick = false , this.lastClickTime = t.timeStamp, s = this.trackingClickStart, this.trackingClick = false , this.trackingClickStart = 0, r && (l = t.changedTouches[0], u = document.elementFromPoint(l.pageX - window.pageXOffset, l.pageY - window.pageYOffset) || u, u.fastClickScrollParent = this.targetElement.fastClickScrollParent), a = u.tagName.toLowerCase(), "label" === a) { if (e = this.findControl(u)) { if (this.focus(u), n) return false ; u = e; } } else if (this.needsFocus(u)) return t.timeStamp - s > 100 || o && window.top !== window && "input" === a? (this.targetElement = null , false ): (this.focus(u), this.sendClick(u, t), o && "select" === a || (this.targetElement = null , t.preventDefault()), false ); return o && !i && (c = u.fastClickScrollParent, c && c.fastClickLastScrollTop !== c.scrollTop)? true : (this.needsClick(u) || (t.preventDefault(), this.sendClick(u, t)), false ); } , t.prototype.onTouchCancel = function (){ this.trackingClick = false , this.targetElement = null ; } , t.prototype.onMouse = function (t){ return this.targetElement? t.forwardedTouchEvent? true : t.cancelable && (!this.needsClick(this.targetElement) || this.cancelNextClick)? (t.stopImmediatePropagation? t.stopImmediatePropagation(): t.propagationStopped = true , t.stopPropagation(), t.preventDefault(), false ): true : true ; } , t.prototype.onClick = function (t){ var e; return this.trackingClick? (this.targetElement = null , this.trackingClick = false , true ): "submit" === _AN_Read_target("target", t).type && 0 === t.detail? true : (e = this.onMouse(t), e || (this.targetElement = null ), e); } , t.prototype.destroy = function (){ var t = this.layer; n && (t.removeEventListener("mouseover", this.onMouse, true ), t.removeEventListener("mousedown", this.onMouse, true ), t.removeEventListener("mouseup", this.onMouse, true )), t.removeEventListener("click", this.onClick, true ), t.removeEventListener("touchstart", this.onTouchStart, false ), t.removeEventListener("touchmove", this.onTouchMove, false ), t.removeEventListener("touchend", this.onTouchEnd, false ), t.removeEventListener("touchcancel", this.onTouchCancel, false ); } , t.notNeeded = function (t){ var e, o, i, r; if ("undefined" == typeof window.ontouchstart) return true ; if (o = + (/Chrome\/([0-9]+)/.exec(navigator.userAgent) || [, 0] )[1]) { if (!n) return true ; if (e = document.querySelector("meta[name=viewport]")) { if (-1 !== e.content.indexOf("user-scalable=no")) return true ; if (o > 31 && document.documentElement.scrollWidth <= window.outerWidth) return true ; } } if (s && (i = navigator.userAgent.match(/Version\/([0-9]*)\.([0-9]*)/), i[1] >= 10 && i[2] >= 3 && (e = document.querySelector("meta[name=viewport]")))) { if (-1 !== e.content.indexOf("user-scalable=no")) return true ; if (document.documentElement.scrollWidth <= window.outerWidth) return true ; } return "none" === t.style.msTouchAction || "manipulation" === t.style.touchAction? true : (r = + (/Firefox\/([0-9]+)/.exec(navigator.userAgent) || [, 0] )[1], r >= 27 && (e = document.querySelector("meta[name=viewport]"), e && (-1 !== e.content.indexOf("user-scalable=no") || document.documentElement.scrollWidth <= window.outerWidth))? true : "none" === t.style.touchAction || "manipulation" === t.style.touchAction? true : false ); } , t.attach = function (e, n){ return new t(e, n); } , "function" == typeof define && "object" == typeof define.amd && define.amd? define(function (){ return t; } ): "undefined" != typeof module && module.exports? (module.exports = t.attach, module.exports.FastClick = t): window.FastClick = t; } (), function (){ var t = function (e){ var n = new t.Index(); return n.pipeline.add(t.trimmer, t.stopWordFilter, t.stemmer), e && e.call(n, n), n; } ; t.version = "0.6.0", t.utils = { } , t.utils.warn = function (t){ return function (e){ t.console && console.warn && console.warn(e); } ; } (this), t.utils.asString = function (t){ return void 0 === t || null === t? "": t.toString(); } , t.EventEmitter = function (){ this.events = { } ; } , t.EventEmitter.prototype.addListener = function (){ var t = Array.prototype.slice.call(arguments), e = t.pop(), n = t; if ("function" != typeof e) throw new TypeError("last argument must be a function") n.forEach(function (t){ this.hasHandler(t) || (this.events[t] = [] ), this.events[t].push(e); } , this); } , t.EventEmitter.prototype.removeListener = function (t, e){ if (this.hasHandler(t)) { var n = this.events[t].indexOf(e); this.events[t].splice(n, 1), _AN_Read_length("length", this.events[t]) || delete this.events[t]; } } , t.EventEmitter.prototype.emit = function (t){ if (this.hasHandler(t)) { var e = Array.prototype.slice.call(arguments, 1); this.events[t].forEach(function (t){ t.apply(void 0, e); } ); } } , t.EventEmitter.prototype.hasHandler = function (t){ return t in this.events; } , t.tokenizer = function (e){ return _AN_Read_length("length", arguments) && null != e && void 0 != e? Array.isArray(e)? e.map(function (e){ return t.utils.asString(e).toLowerCase(); } ): e.toString().trim().toLowerCase().split(t.tokenizer.seperator): [] ; } , t.tokenizer.seperator = /[\s\-]+/, t.Pipeline = function (){ this._stack = [] ; } , t.Pipeline.registeredFunctions = { } , t.Pipeline.registerFunction = function (e, n){ n in this.registeredFunctions && t.utils.warn("Overwriting existing registered function: " + n), e.label = n, t.Pipeline.registeredFunctions[e.label] = e; } , t.Pipeline.warnIfFunctionNotRegistered = function (e){ var n = e.label && e.label in this.registeredFunctions; n || t.utils.warn("Function is not registered with pipeline. This may cause problems when serialising the index.\n", e); } , t.Pipeline.load = function (e){ var n = new t.Pipeline(); return e.forEach(function (e){ var o = t.Pipeline.registeredFunctions[e]; if (!o) throw new Error("Cannot load un-registered function: " + e) n.add(o); } ), n; } , t.Pipeline.prototype.add = function (){ var e = Array.prototype.slice.call(arguments); e.forEach(function (e){ t.Pipeline.warnIfFunctionNotRegistered(e), this._stack.push(e); } , this); } , t.Pipeline.prototype.after = function (e, n){ t.Pipeline.warnIfFunctionNotRegistered(n); var o = this._stack.indexOf(e); if (-1 == o) throw new Error("Cannot find existingFn") o += 1, this._stack.splice(o, 0, n); } , t.Pipeline.prototype.before = function (e, n){ t.Pipeline.warnIfFunctionNotRegistered(n); var o = this._stack.indexOf(e); if (-1 == o) throw new Error("Cannot find existingFn") this._stack.splice(o, 0, n); } , t.Pipeline.prototype.remove = function (t){ var e = this._stack.indexOf(t); -1 != e && this._stack.splice(e, 1); } , t.Pipeline.prototype.run = function (t){ for (var e = [] , n = _AN_Read_length("length", t), o = _AN_Read_length("length", this._stack), i = 0; n > i; i++ ){ for (var r = t[i], s = 0; o > s && (r = this._stack[s](r, i, t), void 0 !== r && "" !== r); s++ ); void 0 !== r && "" !== r && e.push(r); } return e; } , t.Pipeline.prototype.reset = function (){ this._stack = [] ; } , t.Pipeline.prototype.toJSON = function (){ return this._stack.map(function (e){ return t.Pipeline.warnIfFunctionNotRegistered(e), e.label; } ); } , t.Vector = function (){ this._magnitude = null , this.list = void 0, this.length = 0; } , t.Vector.Node = function (t, e, n){ this.idx = t, this.val = e, this.next = n; } , t.Vector.prototype.insert = function (e, n){ this._magnitude = void 0; var o = this.list; if (!o) return this.list = new t.Vector.Node(e, n, o), this.length++ ; if (e < o.idx) return this.list = new t.Vector.Node(e, n, o), this.length++ ; for (var i = o, r = o.next; void 0 != r; ){ if (e < r.idx) return i.next = new t.Vector.Node(e, n, r), this.length++ ; i = r, r = r.next; } return i.next = new t.Vector.Node(e, n, r), this.length++ ; } , t.Vector.prototype.magnitude = function (){ if (this._magnitude) return this._magnitude; for (var t, e = this.list, n = 0; e; )t = e.val, n += t * t, e = e.next; return this._magnitude = Math.sqrt(n); } , t.Vector.prototype.dot = function (t){ for (var e = this.list, n = t.list, o = 0; e && n; )e.idx < n.idx? e = e.next: e.idx > n.idx? n = n.next: (o += e.val * n.val, e = e.next, n = n.next); return o; } , t.Vector.prototype.similarity = function (t){ return this.dot(t) / (this.magnitude() * t.magnitude()); } , t.SortedSet = function (){ this.length = 0, this.elements = [] ; } , t.SortedSet.load = function (t){ var e = new this(); return e.elements = t, e.length = _AN_Read_length("length", t), e; } , t.SortedSet.prototype.add = function (){ var t, e; for (t = 0; t < _AN_Read_length("length", arguments); t++ )e = arguments[t], ~this.indexOf(e) || this.elements.splice(this.locationFor(e), 0, e); this.length = _AN_Read_length("length", this.elements); } , t.SortedSet.prototype.toArray = function (){ return this.elements.slice(); } , t.SortedSet.prototype.map = function (t, e){ return this.elements.map(t, e); } , t.SortedSet.prototype.forEach = function (t, e){ return this.elements.forEach(t, e); } , t.SortedSet.prototype.indexOf = function (t){ for (var e = 0, n = _AN_Read_length("length", this.elements), o = n - e, i = e + Math.floor(o / 2), r = this.elements[i]; o > 1; ){ if (r === t) return i; t > r && (e = i), r > t && (n = i), o = n - e, i = e + Math.floor(o / 2), r = this.elements[i]; } return r === t? i: -1; } , t.SortedSet.prototype.locationFor = function (t){ for (var e = 0, n = _AN_Read_length("length", this.elements), o = n - e, i = e + Math.floor(o / 2), r = this.elements[i]; o > 1; )t > r && (e = i), r > t && (n = i), o = n - e, i = e + Math.floor(o / 2), r = this.elements[i]; return r > t? i: t > r? i + 1: void 0; } , t.SortedSet.prototype.intersect = function (e){ for (var n = new t.SortedSet(), o = 0, i = 0, r = _AN_Read_length("length", this), s = _AN_Read_length("length", e), a = this.elements, c = e.elements; ; ){ if (o > r - 1 || i > s - 1) break ; a[o] !== c[i]? a[o] < c[i]? o++ : a[o] > c[i] && i++ : (n.add(a[o]), o++ , i++ ); } return n; } , t.SortedSet.prototype.clone = function (){ var e = new t.SortedSet(); return e.elements = this.toArray(), e.length = _AN_Read_length("length", e.elements), e; } , t.SortedSet.prototype.union = function (t){ var e, n, o; return _AN_Read_length("length", this) >= _AN_Read_length("length", t)? (e = this, n = t): (e = t, n = this), o = e.clone(), o.add.apply(o, n.toArray()), o; } , t.SortedSet.prototype.toJSON = function (){ return this.toArray(); } , t.Index = function (){ this._fields = [] , this._ref = "id", this.pipeline = new t.Pipeline(), this.documentStore = new t.Store(), this.tokenStore = new t.TokenStore(), this.corpusTokens = new t.SortedSet(), this.eventEmitter = new t.EventEmitter(), this._idfCache = { } , this.on("add", "remove", "update", function (){ this._idfCache = { } ; } .bind(this)); } , t.Index.prototype.on = function (){ var t = Array.prototype.slice.call(arguments); return this.eventEmitter.addListener.apply(this.eventEmitter, t); } , t.Index.prototype.off = function (t, e){ return this.eventEmitter.removeListener(t, e); } , t.Index.load = function (e){ e.version !== t.version && t.utils.warn("version mismatch: current " + t.version + " importing " + e.version); var n = new this(); return n._fields = e.fields, n._ref = e.ref, n.documentStore = _AN_Call_load("load", t.Store, e.documentStore), n.tokenStore = _AN_Call_load("load", t.TokenStore, e.tokenStore), n.corpusTokens = _AN_Call_load("load", t.SortedSet, e.corpusTokens), n.pipeline = _AN_Call_load("load", t.Pipeline, e.pipeline), n; } , t.Index.prototype.field = function (t, e){ var e = e || { } , n = { name: t, boost: e.boost || 1} ; return this._fields.push(n), this; } , t.Index.prototype.ref = function (t){ return this._ref = t, this; } , t.Index.prototype.add = function (e, n){ var o = { } , i = new t.SortedSet(), r = e[this._ref], n = void 0 === n? true : n; this._fields.forEach(function (n){ var r = this.pipeline.run(t.tokenizer(e[n.name])); o[n.name] = r, t.SortedSet.prototype.add.apply(i, r); } , this), this.documentStore.set(r, i), t.SortedSet.prototype.add.apply(this.corpusTokens, i.toArray()); for (var s = 0; s < _AN_Read_length("length", i); s++ ){ var a = i.elements[s], c = this._fields.reduce(function (t, e){ var n = _AN_Read_length("length", o[e.name]); if (!n) return t; var i = _AN_Read_length("length", o[e.name].filter(function (t){ return t === a; } )); return t + i / n * e.boost; } , 0); this.tokenStore.add(a, { ref: r, tf: c} ); } n && this.eventEmitter.emit("add", e, this); } , t.Index.prototype.remove = function (t, e){ var n = t[this._ref], e = void 0 === e? true : e; if (this.documentStore.has(n)) { var o = this.documentStore.get(n); this.documentStore.remove(n), o.forEach(function (t){ this.tokenStore.remove(t, n); } , this), e && this.eventEmitter.emit("remove", t, this); } } , t.Index.prototype.update = function (t, e){ var e = void 0 === e? true : e; this.remove(t, false ), this.add(t, false ), e && this.eventEmitter.emit("update", t, this); } , t.Index.prototype.idf = function (t){ var e = "@" + t; if (Object.prototype.hasOwnProperty.call(this._idfCache, e)) return this._idfCache[e]; var n = this.tokenStore.count(t), o = 1; return n > 0 && (o = 1 + Math.log(_AN_Read_length("length", this.documentStore) / n)), this._idfCache[e] = o; } , t.Index.prototype.search = function (e){ var n = this.pipeline.run(t.tokenizer(e)), o = new t.Vector(), i = [] , r = this._fields.reduce(function (t, e){ return t + e.boost; } , 0), s = n.some(function (t){ return this.tokenStore.has(t); } , this); if (!s) return [] ; n.forEach(function (e, n, s){ var a = 1 / _AN_Read_length("length", s) * _AN_Read_length("length", this._fields) * r, c = this, l = this.tokenStore.expand(e).reduce(function (n, i){ var r = c.corpusTokens.indexOf(i), s = c.idf(i), l = 1, u = new t.SortedSet(); if (i !== e) { var d = Math.max(3, _AN_Read_length("length", i) - _AN_Read_length("length", e)); l = 1 / Math.log(d); } r > -1 && o.insert(r, a * s * l); for (var h = c.tokenStore.get(i), f = Object.keys(h), p = _AN_Read_length("length", f), m = 0; p > m; m++ )u.add(h[f[m]].ref); return n.union(u); } , new t.SortedSet()); i.push(l); } , this); var a = i.reduce(function (t, e){ return t.intersect(e); } ); return a.map(function (t){ return { ref: t, score: o.similarity(this.documentVector(t))} ; } , this).sort(function (t, e){ return e.score - t.score; } ); } , t.Index.prototype.documentVector = function (e){ for (var n = this.documentStore.get(e), o = _AN_Read_length("length", n), i = new t.Vector(), r = 0; o > r; r++ ){ var s = n.elements[r], a = this.tokenStore.get(s)[e].tf, c = this.idf(s); i.insert(this.corpusTokens.indexOf(s), a * c); } return i; } , t.Index.prototype.toJSON = function (){ return { version: t.version, fields: this._fields, ref: this._ref, documentStore: this.documentStore.toJSON(), tokenStore: this.tokenStore.toJSON(), corpusTokens: this.corpusTokens.toJSON(), pipeline: this.pipeline.toJSON()} ; } , t.Index.prototype.use = function (t){ var e = Array.prototype.slice.call(arguments, 1); e.unshift(this), t.apply(this, e); } , t.Store = function (){ this.store = { } , this.length = 0; } , t.Store.load = function (e){ var n = new this(); return n.length = _AN_Read_length("length", e), n.store = Object.keys(e.store).reduce(function (n, o){ return n[o] = _AN_Call_load("load", t.SortedSet, e.store[o]), n; } , { } ), n; } , t.Store.prototype.set = function (t, e){ this.has(t) || this.length++ , this.store[t] = e; } , t.Store.prototype.get = function (t){ return this.store[t]; } , t.Store.prototype.has = function (t){ return t in this.store; } , t.Store.prototype.remove = function (t){ this.has(t) && (delete this.store[t], this.length-- ); } , t.Store.prototype.toJSON = function (){ return { store: this.store, length: _AN_Read_length("length", this)} ; } , t.stemmer = function (){ var t = { ational: "ate", tional: "tion", enci: "ence", anci: "ance", izer: "ize", bli: "ble", alli: "al", entli: "ent", eli: "e", ousli: "ous", ization: "ize", ation: "ate", ator: "ate", alism: "al", iveness: "ive", fulness: "ful", ousness: "ous", aliti: "al", iviti: "ive", biliti: "ble", logi: "log"} , e = { icate: "ic", ative: "", alize: "al", iciti: "ic", ical: "ic", ful: "", ness: ""} , n = "[^aeiou]", o = "[aeiouy]", i = n + "[^aeiouy]*", r = o + "[aeiou]*", s = "^(" + i + ")?" + r + i, a = "^(" + i + ")?" + r + i + "(" + r + ")?$", c = "^(" + i + ")?" + r + i + r + i, l = "^(" + i + ")?" + o, u = new RegExp(s), d = new RegExp(c), h = new RegExp(a), f = new RegExp(l), p = /^(.+?)(ss|i)es$/, m = /^(.+?)([^s])s$/, v = /^(.+?)eed$/, g = /^(.+?)(ed|ing)$/, y = /.$/, w = /(at|bl|iz)$/, S = new RegExp("([^aeiouylsz])\\1$"), k = new RegExp("^" + i + o + "[^aeiouwxy]$"), E = /^(.+?[^aeiou])y$/, x = /^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/, b = /^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/, T = /^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/, C = /^(.+?)(s|t)(ion)$/, L = /^(.+?)e$/, _ = /ll$/, A = new RegExp("^" + i + o + "[^aeiouwxy]$"), O = function (n){ var o, i, r, s, a, c, l; if (_AN_Read_length("length", n) < 3) return n; if (r = n.substr(0, 1), "y" == r && (n = r.toUpperCase() + n.substr(1)), s = p, a = m, s.test(n)? n = _AN_Call_replace("replace", n, s, "$1$2"): a.test(n) && (n = _AN_Call_replace("replace", n, a, "$1$2")), s = v, a = g, s.test(n)) { var O = s.exec(n); s = u, s.test(O[1]) && (s = y, n = _AN_Call_replace("replace", n, s, "")); } else if (a.test(n)) { var O = a.exec(n); o = O[1], a = f, a.test(o) && (n = o, a = w, c = S, l = k, a.test(n)? n += "e": c.test(n)? (s = y, n = _AN_Call_replace("replace", n, s, "")): l.test(n) && (n += "e")); } if (s = E, s.test(n)) { var O = s.exec(n); o = O[1], n = o + "i"; } if (s = x, s.test(n)) { var O = s.exec(n); o = O[1], i = O[2], s = u, s.test(o) && (n = o + t[i]); } if (s = b, s.test(n)) { var O = s.exec(n); o = O[1], i = O[2], s = u, s.test(o) && (n = o + e[i]); } if (s = T, a = C, s.test(n)) { var O = s.exec(n); o = O[1], s = d, s.test(o) && (n = o); } else if (a.test(n)) { var O = a.exec(n); o = O[1] + O[2], a = d, a.test(o) && (n = o); } if (s = L, s.test(n)) { var O = s.exec(n); o = O[1], s = d, a = h, c = A, (s.test(o) || a.test(o) && !c.test(o)) && (n = o); } return s = _, a = d, s.test(n) && a.test(n) && (s = y, n = _AN_Call_replace("replace", n, s, "")), "y" == r && (n = r.toLowerCase() + n.substr(1)), n; } ; return O; } (), t.Pipeline.registerFunction(t.stemmer, "stemmer"), t.generateStopWordFilter = function (t){ var e = t.reduce(function (t, e){ return t[e] = e, t; } , { } ); return function (t){ return t && e[t] !== t? t: void 0; } ; } , t.stopWordFilter = t.generateStopWordFilter(["a", "able", "about", "across", "after", "all", "almost", "also", "am", "among", "an", "and", "any", "are", "as", "at", "be", "because", "been", "but", "by", "can", "cannot", "could", "dear", "did", "do", "does", "either", "else", "ever", "every", "for", "from", "get", "got", "had", "has", "have", "he", "her", "hers", "him", "his", "how", "however", "i", "if", "in", "into", "is", "it", "its", "just", "least", "let", "like", "likely", "may", "me", "might", "most", "must", "my", "neither", "no", "nor", "not", "of", "off", "often", "on", "only", "or", "other", "our", "own", "rather", "said", "say", "says", "she", "should", "since", "so", "some", "than", "that", "the", "their", "them", "then", "there", "these", "they", "this", "tis", "to", "too", "twas", "us", "wants", "was", "we", "were", "what", "when", "where", "which", "while", "who", "whom", "why", "will", "with", "would", "yet", "you", "your"] ), t.Pipeline.registerFunction(t.stopWordFilter, "stopWordFilter"), t.trimmer = function (t){ return _AN_Call_replace("replace", _AN_Call_replace("replace", t, /^\W+/, ""), /\W+$/, ""); } , t.Pipeline.registerFunction(t.trimmer, "trimmer"), t.TokenStore = function (){ this.root = { docs: { } } , this.length = 0; } , t.TokenStore.load = function (t){ var e = new this(); return e.root = t.root, e.length = _AN_Read_length("length", t), e; } , t.TokenStore.prototype.add = function (t, e, n){ var n = n || this.root, o = t.charAt(0), i = t.slice(1); return o in n || (n[o] = { docs: { } } ), 0 === _AN_Read_length("length", i)? (n[o].docs[e.ref] = e, void (this.length += 1)): this.add(i, e, n[o]); } , t.TokenStore.prototype.has = function (t){ if (!t) return false ; for (var e = this.root, n = 0; n < _AN_Read_length("length", t); n++ ){ if (!e[t.charAt(n)]) return false ; e = e[t.charAt(n)]; } return true ; } , t.TokenStore.prototype.getNode = function (t){ if (!t) return { } ; for (var e = this.root, n = 0; n < _AN_Read_length("length", t); n++ ){ if (!e[t.charAt(n)]) return { } ; e = e[t.charAt(n)]; } return e; } , t.TokenStore.prototype.get = function (t, e){ return this.getNode(t, e).docs || { } ; } , t.TokenStore.prototype.count = function (t, e){ return _AN_Read_length("length", Object.keys(this.get(t, e))); } , t.TokenStore.prototype.remove = function (t, e){ if (t) { for (var n = this.root, o = 0; o < _AN_Read_length("length", t); o++ ){ if (!(t.charAt(o) in n)) return ; n = n[t.charAt(o)]; } delete n.docs[e]; } } , t.TokenStore.prototype.expand = function (t, e){ var n = this.getNode(t), o = n.docs || { } , e = e || [] ; return _AN_Read_length("length", Object.keys(o)) && e.push(t), Object.keys(n).forEach(function (n){ "docs" !== n && e.concat(this.expand(t + n, e)); } , this), e; } , t.TokenStore.prototype.toJSON = function (){ return { root: this.root, length: _AN_Read_length("length", this)} ; } , function (t, e){ "function" == typeof define && define.amd? define(e): "object" == typeof exports? module.exports = e(): t.lunr = e(); } (this, function (){ return t; } ); } (), String.prototype.truncate = function (t){ if (_AN_Read_length("length", this) > t) { for (; " " != this[t] && --t > 0; ); return this.substring(0, t) + "…"; } return this; } , HTMLElement.prototype.wrap = function (t){ _AN_Read_length("length", t) || (t = [t] ); for (var e = _AN_Read_length("length", t) - 1; e >= 0; e-- ){ var n = e > 0? this.cloneNode(true ): this, o = t[e], i = o.parentNode, r = o.nextSibling; _AN_Call_appendchild("appendChild", n, o), r? i.insertBefore(n, r): _AN_Call_appendchild("appendChild", i, n); } } , document.addEventListener("DOMContentLoaded", function (){ "use strict"; Modernizr.addTest("ios", function (){ return !!navigator.userAgent.match(/(iPad|iPhone|iPod)/g); } ), Modernizr.addTest("standalone", function (){ return !!navigator.standalone; } ), FastClick.attach(document.body); var t = document.getElementById("toggle-search"), e = (document.getElementById("reset-search"), document.querySelector(".drawer")), n = document.querySelectorAll(".anchor"), o = document.querySelector(".search .field"), i = document.querySelector(".query"), r = document.querySelector(".results .meta"); Array.prototype.forEach.call(n, function (t){ t.querySelector("a").addEventListener("click", function (){ document.getElementById("toggle-drawer").checked = false , document.body.classList.remove("toggle-drawer"); } ); } ); var s = window.pageYOffset, a = function (){ var t = window.pageYOffset + window.innerHeight, n = Math.max(0, window.innerHeight - e.offsetHeight); t > document.body.clientHeight - (96 - n)? "absolute" != e.style.position && (e.style.position = "absolute", e.style.top = null , e.style.bottom = 0): e.offsetHeight < window.innerHeight? "fixed" != e.style.position && (e.style.position = "fixed", e.style.top = 0, e.style.bottom = null ): "fixed" != e.style.position? t > e.offsetTop + e.offsetHeight? (e.style.position = "fixed", e.style.top = null , e.style.bottom = "-96px"): window.pageYOffset < e.offsetTop && (e.style.position = "fixed", e.style.top = 0, e.style.bottom = null ): window.pageYOffset > s? e.style.top && (e.style.position = "absolute", e.style.top = Math.max(0, s) + "px", e.style.bottom = null ): e.style.bottom && (e.style.position = "absolute", e.style.top = t - e.offsetHeight + "px", e.style.bottom = null ), s = Math.max(0, window.pageYOffset); } , c = function (){ var t = document.querySelector(".main"); window.removeEventListener("scroll", a), matchMedia("only screen and (max-width: 959px)").matches? (e.style.position = null , e.style.top = null , e.style.bottom = null ): e.offsetHeight + 96 < t.offsetHeight && (window.addEventListener("scroll", a), a()); } ; Modernizr.ios || (window.addEventListener("resize", c), c()); var l = function (){ pegasus(base_url + "/mkdocs/search_index.json").then(function (e, n){ var o = lunr(function (){ this.field("title", { boost: 10} ), this.field("text"), this.ref("location"); } ), s = { } ; e.docs.map(function (t){ _AN_Write_location("location", t, false , base_url + _AN_Read_location("location", t)), s[_AN_Read_location("location", t)] = t, o.add(t); } ), i.addEventListener("keyup", function (){ for (var e = document.querySelector(".results .list"); e.firstChild; )e.removeChild(e.firstChild); var n = document.querySelector(".bar.search"); if (!_AN_Read_length("length", i.value)) { for (; r.firstChild; )r.removeChild(r.firstChild); return void n.classList.remove("non-empty"); } n.classList.add("non-empty"); var a = o.search(i.value); a.map(function (n){ var o = s[n.ref], i = _AN_Call_createelement("createElement", document, "article"); i.classList.add("result"); var r = _AN_Call_createelement("createElement", document, "h1"); _AN_Write_innerhtml("innerHTML", r, false , o.title), _AN_Call_appendchild("appendChild", i, r); var a = _AN_Call_createelement("createElement", document, "a"); _AN_Write_href("href", a, false , _AN_Read_location("location", o)), _AN_Call_appendchild("appendChild", a, i); var c = _AN_Call_createelement("createElement", document, "span"); _AN_Write_innerhtml("innerHTML", c, false , _AN_Read_href("href", a).split("#")[0]), _AN_Call_appendchild("appendChild", i, c); var l = _AN_Read_href("href", a).split("#"); l[0] == _AN_Read_href("href", _AN_Read_location("location", document)).split("#")[0] && a.addEventListener("click", function (e){ if (document.body.classList.remove("toggle-search"), document.body.classList.remove("locked"), t.checked = false , !matchMedia("only screen and (min-width: 960px)").matches && (e.preventDefault(), e.stopPropagation(), 1 != _AN_Read_length("length", l))) { var n = document.getElementById(l[1]); n && _AN_Call_settimeout("setTimeout", window, function (){ n.scrollIntoView && n.scrollIntoView() || window.scrollTo(0, n.offsetTop); } , 100); } } ), _AN_Call_appendchild("appendChild", e, a); } ); var c = _AN_Call_createelement("createElement", document, "strong"); for (_AN_Write_innerhtml("innerHTML", c, false , _AN_Read_length("length", a) + " search result" + (1 != _AN_Read_length("length", a)? "s": "")); r.firstChild; )r.removeChild(r.firstChild); _AN_Call_appendchild("appendChild", r, c); } ); } , function (t, e){ console.error(t, e.status); } ), t.removeEventListener("click", l); } ; t.addEventListener("click", l); var u = 0; t.addEventListener("click", function (t){ var e = document.body.classList, n = !matchMedia("only screen and (min-width: 960px)").matches; e.contains("locked")? (e.remove("locked"), n && _AN_Call_settimeout("setTimeout", window, function (){ window.scrollTo(0, u); } , 100)): (u = window.scrollY, n && _AN_Call_settimeout("setTimeout", window, function (){ window.scrollTo(0, 0); } , 400), _AN_Call_settimeout("setTimeout", window, function (){ this.checked && (n && e.add("locked"), _AN_Call_settimeout("setTimeout", window, function (){ i.focus(); } , 200)); } .bind(this), 450)); } ), o.addEventListener("touchstart", function (){ i.focus(); } ), window.addEventListener("keyup", function (e){ var n = e.keyCode || e.which; 27 == n && (i.blur(), document.body.classList.remove("toggle-search"), document.body.classList.remove("locked"), t.checked = false ); } ); var d = document.getElementById("reset-search"); d.addEventListener("click", function (){ for (var t = document.querySelector(".results .list"); t.firstChild; )t.removeChild(t.firstChild); var e = document.querySelector(".bar.search"); e.classList.remove("non-empty"), _AN_Write_innerhtml("innerHTML", r, false , ""), i.value = "", i.focus(); } ); var h = document.querySelectorAll("h2"); h = Array.prototype.map.call(h, function (t){ return t.offsetTop; } ); var f = null ; document.addEventListener("scroll", function (){ for (var t = window.scrollY + window.innerHeight / 3, e = _AN_Read_length("length", h) - 1, o = 0; e > o; o++ )t < h[o + 1] && (e = o); e != f && (f = e, Array.prototype.forEach.call(n, function (t, e){ var n = t.querySelector("a"); (e != f || n.classList.add("current")) && n.classList.remove("current"); } )); } ); var p = document.querySelectorAll(".n + .p"); Array.prototype.forEach.call(p, function (t){ var e = t.innerText || t.textContent; e && "(" == e[0] && t.previousSibling.classList.add("f"); } ); var m = document.querySelectorAll("table"); if (Array.prototype.forEach.call(m, function (t){ var e = _AN_Call_createelement("createElement", document, "div"); e.classList.add("data"), e.wrap(t); } ), Modernizr.ios) { var v = document.querySelectorAll(".scrollable, .standalone .article"); Array.prototype.forEach.call(v, function (t){ t.addEventListener("touchstart", function (){ var t = this.scrollTop; 0 == t? this.scrollTop = 1: t + this.offsetHeight == this.scrollHeight && (this.scrollTop = t - 1); } ); } ); } var g = document.querySelectorAll(".project, .overlay, .header"); Array.prototype.forEach.call(g, function (t){ t.addEventListener("touchmove", function (t){ t.preventDefault(); } ); } ); var y = document.querySelectorAll(".toggle"); Array.prototype.forEach.call(y, function (t){ t.addEventListener("click", function (){ document.body.classList.toggle(this.id); } ); } ), repo_id && pegasus("https://api.github.com/repos/" + repo_id).then(function (t, e){ var n = t.stargazers_count; n > 10000? n = (n / 1000).toFixed(0) + "k": n > 1000 && (n = (n / 1000).toFixed(1) + "k"); var o = document.querySelector(".repo-stars .count"); _AN_Write_innerhtml("innerHTML", o, false , n); } , function (t, e){ console.error(t, e.status); } ); } ), "standalone" in window.navigator && window.navigator.standalone) { var node, remotes = false ; document.addEventListener("click", function (t){ for (node = _AN_Read_target("target", t); "A" !== node.nodeName && "HTML" !== node.nodeName; )node = node.parentNode; "href" in node && -1 !== _AN_Read_href("href", node).indexOf("http") && (-1 !== _AN_Read_href("href", node).indexOf(_AN_Read_host("host", _AN_Read_location("location", document))) || remotes) && (t.preventDefault(), _AN_Write_href("href", _AN_Read_location("location", document), false , _AN_Read_href("href", node))); } , false ); }