rdoc-generator-sixfish 0.3.1 → 0.5.0.pre20180710102525

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data/.editorconfig +16 -0
  4. data/.ruby-gemset +1 -0
  5. data/.ruby-version +1 -0
  6. data/ChangeLog +675 -0
  7. data/History.md +20 -16
  8. data/Manifest.txt +29 -0
  9. data/README.md +24 -30
  10. data/data/rdoc-generator-sixfish/css/sixfish.css +1184 -2
  11. data/data/rdoc-generator-sixfish/css/sixfish.css.map +7 -1
  12. data/data/rdoc-generator-sixfish/fa/light.js +0 -0
  13. data/data/rdoc-generator-sixfish/fa/light.svg +0 -0
  14. data/data/rdoc-generator-sixfish/fa/loader.js +1 -0
  15. data/data/rdoc-generator-sixfish/fa/regular.js +1 -0
  16. data/data/rdoc-generator-sixfish/fa/regular.svg +662 -0
  17. data/data/rdoc-generator-sixfish/fa/solid.js +1 -0
  18. data/data/rdoc-generator-sixfish/fa/solid.svg +662 -0
  19. data/data/rdoc-generator-sixfish/images/glyphicons-28-search.png +0 -0
  20. data/data/rdoc-generator-sixfish/js/jquery-3.1.1.js +10220 -0
  21. data/data/rdoc-generator-sixfish/js/sixfish.min.js +99 -0
  22. data/data/rdoc-generator-sixfish/templates/class.tmpl +180 -179
  23. data/data/rdoc-generator-sixfish/templates/file.tmpl +16 -4
  24. data/data/rdoc-generator-sixfish/templates/index.tmpl +48 -77
  25. data/data/rdoc-generator-sixfish/templates/layout.tmpl +51 -71
  26. data/lib/rdoc/discover.rb +1 -1
  27. data/lib/rdoc/generator/sixfish.rb +66 -45
  28. data/lib/sixfish.rb +9 -10
  29. data/spec/rdoc/generator/sixfish_spec.rb +16 -22
  30. data/spec/sixfish_spec.rb +5 -1
  31. data.tar.gz.sig +3 -2
  32. metadata +163 -63
  33. metadata.gz.sig +0 -0
  34. data/data/rdoc-generator-sixfish/css/fa-solid-900.515704be.ttf +0 -0
  35. data/data/rdoc-generator-sixfish/css/fa-solid-900.7ba04835.svg +0 -1
  36. data/data/rdoc-generator-sixfish/css/fa-solid-900.8c589fd1.eot +0 -0
  37. data/data/rdoc-generator-sixfish/css/fa-solid-900.c7b072c6.woff +0 -0
  38. data/data/rdoc-generator-sixfish/css/fa-solid-900.f2049a98.woff2 +0 -0
  39. data/data/rdoc-generator-sixfish/js/sixfish.js +0 -39
  40. data/data/rdoc-generator-sixfish/js/sixfish.js.map +0 -1
  41. data/lib/inversion/template/striptag.rb +0 -42
  42. data/lib/sixfish/patches.rb +0 -73
@@ -0,0 +1,99 @@
1
+ /*
2
+ * jQuery dropdown: A simple dropdown plugin
3
+ *
4
+ * Inspired by Bootstrap: http://twitter.github.com/bootstrap/javascript.html#dropdowns
5
+ *
6
+ * Copyright 2011 Cory LaViska for A Beautiful Site, LLC. (http://abeautifulsite.net/)
7
+ *
8
+ * Dual licensed under the MIT or GPL Version 2 licenses
9
+ *
10
+ */
11
+ jQuery&&function(d){function o(o){var e=d(this),n=d(d(this).attr("data-dropdown")),a=e.hasClass("dropdown-open");o.preventDefault(),o.stopPropagation(),t(),a||e.hasClass("dropdown-disabled")||(n.css({left:n.hasClass("anchor-right")?e.offset().left-(n.outerWidth()-e.outerWidth()):e.offset().left,top:e.offset().top+e.outerHeight()}).show(),e.addClass("dropdown-open"))}function t(o){var t=o?d(o.target).parents().andSelf():null;t&&t.is(".dropdown-menu")&&!t.is("A")||d("BODY").find(".dropdown-menu").hide().end().find("[data-dropdown]").removeClass("dropdown-open")}d.extend(d.fn,{dropdown:function(o,e){switch(o){case"hide":return t(),d(this);case"attach":return d(this).attr("data-dropdown",e);case"detach":return t(),d(this).removeAttr("data-dropdown");case"disable":return d(this).addClass("dropdown-disabled");case"enable":return t(),d(this).removeClass("dropdown-disabled")}}}),d(function(){d("BODY").on("click.dropdown","[data-dropdown]",o),d("HTML").on("click.dropdown",t)})}(jQuery);
12
+ /*
13
+ * jQuery Hotkeys Plugin
14
+ * Copyright 2010, John Resig
15
+ * Dual licensed under the MIT or GPL Version 2 licenses.
16
+ *
17
+ * Based upon the plugin by Tzury Bar Yochay:
18
+ * http://github.com/tzuryby/hotkeys
19
+ *
20
+ * Original idea by:
21
+ * Binny V A, http://www.openjs.com/scripts/events/keyboard_shortcuts/
22
+ */
23
+ !function(e){function t(t){if("string"==typeof t.data){var s=t.handler,a=t.data.toLowerCase().split(" ");t.handler=function(t){if(this===t.target||!/textarea|select/i.test(t.target.nodeName)&&"text"!==t.target.type){var r="keypress"!==t.type&&e.hotkeys.specialKeys[t.which],f=String.fromCharCode(t.which).toLowerCase(),i="",h={};t.altKey&&"alt"!==r&&(i+="alt+"),t.ctrlKey&&"ctrl"!==r&&(i+="ctrl+"),t.metaKey&&!t.ctrlKey&&"meta"!==r&&(i+="meta+"),t.shiftKey&&"shift"!==r&&(i+="shift+"),r?h[i+r]=!0:(h[i+f]=!0,h[i+e.hotkeys.shiftNums[f]]=!0,"shift+"===i&&(h[e.hotkeys.shiftNums[f]]=!0));for(var o=0,c=a.length;o<c;o++)if(h[a[o]])return s.apply(this,arguments)}}}}e.hotkeys={version:"0.8",specialKeys:{8:"backspace",9:"tab",13:"return",16:"shift",17:"ctrl",18:"alt",19:"pause",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"insert",46:"del",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9",106:"*",107:"+",109:"-",110:".",111:"/",112:"f1",113:"f2",114:"f3",115:"f4",116:"f5",117:"f6",118:"f7",119:"f8",120:"f9",121:"f10",122:"f11",123:"f12",144:"numlock",145:"scroll",191:"/",224:"meta"},shiftNums:{"`":"~",1:"!",2:"@",3:"#",4:"$",5:"%",6:"^",7:"&",8:"*",9:"(",0:")","-":"_","=":"+",";":": ","'":'"',",":"<",".":">","/":"?","\\":"|"}},e.each(["keydown","keyup","keypress"],function(){e.event.special[this]={add:t}})}(jQuery);
24
+ /*
25
+ * qTip2 - Pretty powerful tooltips - v2.2.1
26
+ * http://qtip2.com
27
+ *
28
+ * Copyright (c) 2014
29
+ * Released under the MIT licenses
30
+ * http://jquery.org/license
31
+ *
32
+ * Date: Sat Sep 6 2014 09:55 EDT-0400
33
+ * Plugins: tips viewport
34
+ * Styles: core basic css3
35
+ */
36
+ !function(t,e,i){!function(t){"use strict";"function"==typeof define&&define.amd?define(["jquery"],t):jQuery&&!jQuery.fn.qtip&&t(jQuery)}(function(s){"use strict";function o(t,e,i,o){this.id=i,this.target=t,this.tooltip=k,this.elements={target:t},this._id=I+"-"+i,this.timers={img:{}},this.options=e,this.plugins={},this.cache={event:{},target:s(),disabled:W,attr:o,onTooltip:W,lastClass:""},this.rendered=this.destroyed=this.disabled=this.waiting=this.hiddenDuringWait=this.positioning=this.triggering=W}function n(t){return t===k||"object"!==s.type(t)}function r(t){return!(s.isFunction(t)||t&&t.attr||t.length||"object"===s.type(t)&&(t.jquery||t.then))}function a(t){var e,i,o,a;return n(t)?W:(n(t.metadata)&&(t.metadata={type:t.metadata}),"content"in t&&(n(e=t.content)||e.jquery||e.done?e=t.content={text:i=r(e)?W:e}:i=e.text,"ajax"in e&&(o=e.ajax,a=o&&o.once!==W,delete e.ajax,e.text=function(t,e){var n=i||s(this).attr(e.options.content.attr)||"Loading...",r=s.ajax(s.extend({},o,{context:e})).then(o.success,k,o.error).then(function(t){return t&&a&&e.set("content.text",t),t},function(t,i,s){e.destroyed||0===t.status||e.set("content.text",i+": "+s)});return a?n:(e.set("content.text",n),r)}),"title"in e&&(s.isPlainObject(e.title)&&(e.button=e.title.button,e.title=e.title.text),r(e.title||W)&&(e.title=W))),"position"in t&&n(t.position)&&(t.position={my:t.position,at:t.position}),"show"in t&&n(t.show)&&(t.show=t.show.jquery?{target:t.show}:t.show===z?{ready:z}:{event:t.show}),"hide"in t&&n(t.hide)&&(t.hide=t.hide.jquery?{target:t.hide}:{event:t.hide}),"style"in t&&n(t.style)&&(t.style={classes:t.style}),s.each(R,function(){this.sanitize&&this.sanitize(t)}),t)}function h(t,e){for(var i,s=0,o=t,n=e.split(".");o=o[n[s++]];)s<n.length&&(i=o);return[i||t,n.pop()]}function l(t,e){var i,s,o;for(i in this.checks)for(s in this.checks[i])(o=new RegExp(s,"i").exec(t))&&(e.push(o),("builtin"===i||this.plugins[i])&&this.checks[i][s].apply(this.plugins[i]||this,e))}function c(t){return Y.concat("").join(t?"-"+t+" ":" ")}function d(t,e){if(e>0)return setTimeout(s.proxy(t,this),e);t.call(this)}function p(t){this.tooltip.hasClass(K)||(clearTimeout(this.timers.show),clearTimeout(this.timers.hide),this.timers.show=d.call(this,function(){this.toggle(z,t)},this.options.show.delay))}function u(t){if(!this.tooltip.hasClass(K)&&!this.destroyed){var e=s(t.relatedTarget),i=e.closest(X)[0]===this.tooltip[0],o=e[0]===this.options.show.target[0];if(clearTimeout(this.timers.show),clearTimeout(this.timers.hide),this!==e[0]&&"mouse"===this.options.position.target&&i||this.options.hide.fixed&&/mouse(out|leave|move)/.test(t.type)&&(i||o))try{t.preventDefault(),t.stopImmediatePropagation()}catch(n){}else this.timers.hide=d.call(this,function(){this.toggle(W,t)},this.options.hide.delay,this)}}function f(t){!this.tooltip.hasClass(K)&&this.options.hide.inactive&&(clearTimeout(this.timers.inactive),this.timers.inactive=d.call(this,function(){this.hide(t)},this.options.hide.inactive))}function g(t){this.rendered&&this.tooltip[0].offsetWidth>0&&this.reposition(t)}function m(t,i,o){s(e.body).delegate(t,(i.split?i:i.join("."+I+" "))+"."+I,function(){var t=x.api[s.attr(this,H)];t&&!t.disabled&&o.apply(t,arguments)})}function v(t,i,n){var r,h,l,c,d,p=s(e.body),u=t[0]===e?p:t,f=t.metadata?t.metadata(n.metadata):k,g="html5"===n.metadata.type&&f?f[n.metadata.name]:k,m=t.data(n.metadata.name||"qtipopts");try{m="string"==typeof m?s.parseJSON(m):m}catch(v){}if(h=(c=s.extend(z,{},x.defaults,n,"object"==typeof m?a(m):k,a(g||f))).position,c.id=i,"boolean"==typeof c.content.text){if(l=t.attr(c.content.attr),c.content.attr===W||!l)return W;c.content.text=l}if(h.container.length||(h.container=p),h.target===W&&(h.target=u),c.show.target===W&&(c.show.target=u),c.show.solo===z&&(c.show.solo=h.container.closest("body")),c.hide.target===W&&(c.hide.target=u),c.position.viewport===z&&(c.position.viewport=h.container),h.container=h.container.eq(0),h.at=new T(h.at,z),h.my=new T(h.my),t.data(I))if(c.overwrite)t.qtip("destroy",!0);else if(c.overwrite===W)return W;return t.attr(N,i),c.suppress&&(d=t.attr("title"))&&t.removeAttr("title").attr(tt,d).attr("title",""),r=new o(t,c,i,!!l),t.data(I,r),r}function y(t){return t.charAt(0).toUpperCase()+t.slice(1)}function b(t,e){var s,o,n=e.charAt(0).toUpperCase()+e.slice(1),r=(e+" "+mt.join(n+" ")+n).split(" "),a=0;if(gt[e])return t.css(gt[e]);for(;s=r[a++];)if((o=t.css(s))!==i)return gt[e]=s,o}function w(t,e){return Math.ceil(parseFloat(b(t,e)))}function _(t,e){this._ns="tip",this.options=e,this.offset=e.offset,this.size=[e.width,e.height],this.init(this.qtip=t)}var x,C,T,q,j,z=!0,W=!1,k=null,A="x",E="y",M="width",S="height",L="top",F="left",P="bottom",D="right",O="center",$="flipinvert",B="shift",R={},I="qtip",N="data-hasqtip",H="data-qtip-id",Y=["ui-widget","ui-tooltip"],X="."+I,U="click dblclick mousedown mouseup mousemove mouseleave mouseenter".split(" "),Q=I+"-fixed",J=I+"-default",V=I+"-focus",G=I+"-hover",K=I+"-disabled",Z="_replacedByqTip",tt="oldtitle",et={ie:function(){for(var t=4,i=e.createElement("div");(i.innerHTML="<!--[if gt IE "+t+"]><i></i><![endif]-->")&&i.getElementsByTagName("i")[0];t+=1);return t>4?t:NaN}(),iOS:parseFloat((""+(/CPU.*OS ([0-9_]{1,5})|(CPU like).*AppleWebKit.*Mobile/i.exec(navigator.userAgent)||[0,""])[1]).replace("undefined","3_2").replace("_",".").replace("_",""))||W};(C=o.prototype)._when=function(t){return s.when.apply(s,t)},C.render=function(t){if(this.rendered||this.destroyed)return this;var e=this,i=this.options,o=this.cache,n=this.elements,r=i.content.text,a=i.content.title,h=i.content.button,l=i.position,c=(this._id,[]);return s.attr(this.target[0],"aria-describedby",this._id),o.posClass=this._createPosClass((this.position={my:l.my,at:l.at}).my),this.tooltip=n.tooltip=s("<div/>",{id:this._id,"class":[I,J,i.style.classes,o.posClass].join(" "),width:i.style.width||"",height:i.style.height||"",tracking:"mouse"===l.target&&l.adjust.mouse,role:"alert","aria-live":"polite","aria-atomic":W,"aria-describedby":this._id+"-content","aria-hidden":z}).toggleClass(K,this.disabled).attr(H,this.id).data(I,this).appendTo(l.container).append(n.content=s("<div />",{"class":I+"-content",id:this._id+"-content","aria-atomic":z})),this.rendered=-1,this.positioning=z,a&&(this._createTitle(),s.isFunction(a)||c.push(this._updateTitle(a,W))),h&&this._createButton(),s.isFunction(r)||c.push(this._updateContent(r,W)),this.rendered=z,this._setWidget(),s.each(R,function(t){var i;"render"===this.initialize&&(i=this(e))&&(e.plugins[t]=i)}),this._unassignEvents(),this._assignEvents(),this._when(c).then(function(){e._trigger("render"),e.positioning=W,e.hiddenDuringWait||!i.show.ready&&!t||e.toggle(z,o.event,W),e.hiddenDuringWait=W}),x.api[this.id]=this,this},C.destroy=function(t){function e(){if(!this.destroyed){this.destroyed=z;var t,e=this.target,i=e.attr(tt);for(t in this.rendered&&this.tooltip.stop(1,0).find("*").remove().end().remove(),s.each(this.plugins,function(){this.destroy&&this.destroy()}),this.timers)clearTimeout(this.timers[t]);e.removeData(I).removeAttr(H).removeAttr(N).removeAttr("aria-describedby"),this.options.suppress&&i&&e.attr("title",i).removeAttr(tt),this._unassignEvents(),this.options=this.elements=this.cache=this.timers=this.plugins=this.mouse=k,delete x.api[this.id]}}return this.destroyed?this.target:(t===z&&"hide"!==this.triggering||!this.rendered?e.call(this):(this.tooltip.one("tooltiphidden",s.proxy(e,this)),!this.triggering&&this.hide()),this.target)},q=C.checks={builtin:{"^id$":function(t,e,i,o){var n=i===z?x.nextid:i,r=I+"-"+n;n!==W&&n.length>0&&!s("#"+r).length?(this._id=r,this.rendered&&(this.tooltip[0].id=this._id,this.elements.content[0].id=this._id+"-content",this.elements.title[0].id=this._id+"-title")):t[e]=o},"^prerender":function(t,e,i){i&&!this.rendered&&this.render(this.options.show.ready)},"^content.text$":function(t,e,i){this._updateContent(i)},"^content.attr$":function(t,e,i,s){this.options.content.text===this.target.attr(s)&&this._updateContent(this.target.attr(i))},"^content.title$":function(t,e,i){if(!i)return this._removeTitle();i&&!this.elements.title&&this._createTitle(),this._updateTitle(i)},"^content.button$":function(t,e,i){this._updateButton(i)},"^content.title.(text|button)$":function(t,e,i){this.set("content."+e,i)},"^position.(my|at)$":function(t,e,i){"string"==typeof i&&(this.position[e]=t[e]=new T(i,"at"===e))},"^position.container$":function(t,e,i){this.rendered&&this.tooltip.appendTo(i)},"^show.ready$":function(t,e,i){i&&(!this.rendered&&this.render(z)||this.toggle(z))},"^style.classes$":function(t,e,i,s){this.rendered&&this.tooltip.removeClass(s).addClass(i)},"^style.(width|height)":function(t,e,i){this.rendered&&this.tooltip.css(e,i)},"^style.widget|content.title":function(){this.rendered&&this._setWidget()},"^style.def":function(t,e,i){this.rendered&&this.tooltip.toggleClass(J,!!i)},"^events.(render|show|move|hide|focus|blur)$":function(t,e,i){this.rendered&&this.tooltip[(s.isFunction(i)?"":"un")+"bind"]("tooltip"+e,i)},"^(show|hide|position).(event|target|fixed|inactive|leave|distance|viewport|adjust)":function(){if(this.rendered){var t=this.options.position;this.tooltip.attr("tracking","mouse"===t.target&&t.adjust.mouse),this._unassignEvents(),this._assignEvents()}}}},C.get=function(t){if(this.destroyed)return this;var e=h(this.options,t.toLowerCase()),i=e[0][e[1]];return i.precedance?i.string():i};var it=/^position\.(my|at|adjust|target|container|viewport)|style|content|show\.ready/i,st=/^prerender|show\.ready/i;C.set=function(t,e){if(this.destroyed)return this;var i,o=this.rendered,n=W,r=this.options;this.checks;return"string"==typeof t?(i=t,(t={})[i]=e):t=s.extend({},t),s.each(t,function(e,i){if(o&&st.test(e))delete t[e];else{var a,l=h(r,e.toLowerCase());a=l[0][l[1]],l[0][l[1]]=i&&i.nodeType?s(i):i,n=it.test(e)||n,t[e]=[l[0],l[1],i,a]}}),a(r),this.positioning=z,s.each(t,s.proxy(l,this)),this.positioning=W,this.rendered&&this.tooltip[0].offsetWidth>0&&n&&this.reposition("mouse"===r.position.target?k:this.cache.event),this},C._update=function(t,e){var i=this,o=this.cache;return this.rendered&&t?(s.isFunction(t)&&(t=t.call(this.elements.target,o.event,this)||""),s.isFunction(t.then)?(o.waiting=z,t.then(function(t){return o.waiting=W,i._update(t,e)},k,function(t){return i._update(t,e)})):t===W||!t&&""!==t?W:(t.jquery&&t.length>0?e.empty().append(t.css({display:"block",visibility:"visible"})):e.html(t),this._waitForContent(e).then(function(t){i.rendered&&i.tooltip[0].offsetWidth>0&&i.reposition(o.event,!t.length)}))):W},C._waitForContent=function(t){var e=this.cache;return e.waiting=z,(s.fn.imagesLoaded?t.imagesLoaded():s.Deferred().resolve([])).done(function(){e.waiting=W}).promise()},C._updateContent=function(t,e){this._update(t,this.elements.content,e)},C._updateTitle=function(t,e){this._update(t,this.elements.title,e)===W&&this._removeTitle(W)},C._createTitle=function(){var t=this.elements,e=this._id+"-title";t.titlebar&&this._removeTitle(),t.titlebar=s("<div />",{"class":I+"-titlebar "+(this.options.style.widget?c("header"):"")}).append(t.title=s("<div />",{id:e,"class":I+"-title","aria-atomic":z})).insertBefore(t.content).delegate(".qtip-close","mousedown keydown mouseup keyup mouseout",function(t){s(this).toggleClass("ui-state-active ui-state-focus","down"===t.type.substr(-4))}).delegate(".qtip-close","mouseover mouseout",function(t){s(this).toggleClass("ui-state-hover","mouseover"===t.type)}),this.options.content.button&&this._createButton()},C._removeTitle=function(t){var e=this.elements;e.title&&(e.titlebar.remove(),e.titlebar=e.title=e.button=k,t!==W&&this.reposition())},C._createPosClass=function(t){return I+"-pos-"+(t||this.options.position.my).abbrev()},C.reposition=function(i,o){if(!this.rendered||this.positioning||this.destroyed)return this;this.positioning=z;var n,r,a,h,l=this.cache,c=this.tooltip,d=this.options.position,p=d.target,u=d.my,f=d.at,g=d.viewport,m=d.container,v=d.adjust,y=v.method.split(" "),b=c.outerWidth(W),w=c.outerHeight(W),_=0,x=0,C=c.css("position"),T={left:0,top:0},q=c[0].offsetWidth>0,j=i&&"scroll"===i.type,k=s(t),A=m[0].ownerDocument,E=this.mouse;if(s.isArray(p)&&2===p.length)f={x:F,y:L},T={left:p[0],top:p[1]};else if("mouse"===p)f={x:F,y:L},(!v.mouse||this.options.hide.distance)&&l.origin&&l.origin.pageX?i=l.origin:!i||i&&("resize"===i.type||"scroll"===i.type)?i=l.event:E&&E.pageX&&(i=E),"static"!==C&&(T=m.offset()),A.body.offsetWidth!==(t.innerWidth||A.documentElement.clientWidth)&&(r=s(e.body).offset()),T={left:i.pageX-T.left+(r&&r.left||0),top:i.pageY-T.top+(r&&r.top||0)},v.mouse&&j&&E&&(T.left-=(E.scrollX||0)-k.scrollLeft(),T.top-=(E.scrollY||0)-k.scrollTop());else{if("event"===p?i&&i.target&&"scroll"!==i.type&&"resize"!==i.type?l.target=s(i.target):i.target||(l.target=this.elements.target):"event"!==p&&(l.target=s(p.jquery?p:this.elements.target)),p=l.target,0===(p=s(p).eq(0)).length)return this;p[0]===e||p[0]===t?(_=et.iOS?t.innerWidth:p.width(),x=et.iOS?t.innerHeight:p.height(),p[0]===t&&(T={top:(g||p).scrollTop(),left:(g||p).scrollLeft()})):R.imagemap&&p.is("area")?n=R.imagemap(this,p,f,R.viewport?y:W):R.svg&&p&&p[0].ownerSVGElement?n=R.svg(this,p,f,R.viewport?y:W):(_=p.outerWidth(W),x=p.outerHeight(W),T=p.offset()),n&&(_=n.width,x=n.height,r=n.offset,T=n.position),T=this.reposition.offset(p,T,m),(et.iOS>3.1&&et.iOS<4.1||et.iOS>=4.3&&et.iOS<4.33||!et.iOS&&"fixed"===C)&&(T.left-=k.scrollLeft(),T.top-=k.scrollTop()),(!n||n&&n.adjustable!==W)&&(T.left+=f.x===D?_:f.x===O?_/2:0,T.top+=f.y===P?x:f.y===O?x/2:0)}return T.left+=v.x+(u.x===D?-b:u.x===O?-b/2:0),T.top+=v.y+(u.y===P?-w:u.y===O?-w/2:0),R.viewport?(a=T.adjusted=R.viewport(this,T,d,_,x,b,w),r&&a.left&&(T.left+=r.left),r&&a.top&&(T.top+=r.top),a.my&&(this.position.my=a.my)):T.adjusted={left:0,top:0},l.posClass!==(h=this._createPosClass(this.position.my))&&c.removeClass(l.posClass).addClass(l.posClass=h),this._trigger("move",[T,g.elem||g],i)?(delete T.adjusted,o===W||!q||isNaN(T.left)||isNaN(T.top)||"mouse"===p||!s.isFunction(d.effect)?c.css(T):s.isFunction(d.effect)&&(d.effect.call(c,this,s.extend({},T)),c.queue(function(t){s(this).css({opacity:"",height:""}),et.ie&&this.style.removeAttribute("filter"),t()})),this.positioning=W,this):this},C.reposition.offset=function(t,i,o){function n(t,e){i.left+=e*t.scrollLeft(),i.top+=e*t.scrollTop()}if(!o[0])return i;var r,a,h,l,c=s(t[0].ownerDocument),d=!!et.ie&&"CSS1Compat"!==e.compatMode,p=o[0];do{"static"!==(a=s.css(p,"position"))&&("fixed"===a?(h=p.getBoundingClientRect(),n(c,-1)):((h=s(p).position()).left+=parseFloat(s.css(p,"borderLeftWidth"))||0,h.top+=parseFloat(s.css(p,"borderTopWidth"))||0),i.left-=h.left+(parseFloat(s.css(p,"marginLeft"))||0),i.top-=h.top+(parseFloat(s.css(p,"marginTop"))||0),r||"hidden"===(l=s.css(p,"overflow"))||"visible"===l||(r=s(p)))}while(p=p.offsetParent);return r&&(r[0]!==c[0]||d)&&n(r,1),i};var ot=(T=C.reposition.Corner=function(t,e){t=(""+t).replace(/([A-Z])/," $1").replace(/middle/gi,O).toLowerCase(),this.x=(t.match(/left|right/i)||t.match(/center/)||["inherit"])[0].toLowerCase(),this.y=(t.match(/top|bottom|center/i)||["inherit"])[0].toLowerCase(),this.forceY=!!e;var i=t.charAt(0);this.precedance="t"===i||"b"===i?E:A}).prototype;ot.invert=function(t,e){this[t]=this[t]===F?D:this[t]===D?F:e||this[t]},ot.string=function(t){var e=this.x,i=this.y,s=e!==i?"center"===e||"center"!==i&&(this.precedance===E||this.forceY)?[i,e]:[e,i]:[e];return!1!==t?s.join(" "):s},ot.abbrev=function(){var t=this.string(!1);return t[0].charAt(0)+(t[1]&&t[1].charAt(0)||"")},ot.clone=function(){return new T(this.string(),this.forceY)},C.toggle=function(t,i){var o=this.cache,n=this.options,r=this.tooltip;if(i){if(/over|enter/.test(i.type)&&o.event&&/out|leave/.test(o.event.type)&&n.show.target.add(i.target).length===n.show.target.length&&r.has(i.relatedTarget).length)return this;o.event=s.event.fix(i)}if(this.waiting&&!t&&(this.hiddenDuringWait=z),!this.rendered)return t?this.render(1):this;if(this.destroyed||this.disabled)return this;var a,h,l,c=t?"show":"hide",d=this.options[c],p=(this.options[t?"hide":"show"],this.options.position),u=this.options.content,f=this.tooltip.css("width"),g=this.tooltip.is(":visible"),m=t||1===d.target.length,v=!i||d.target.length<2||o.target[0]===i.target;return(typeof t).search("boolean|number")&&(t=!g),h=(a=!r.is(":animated")&&g===t&&v)?k:!!this._trigger(c,[90]),this.destroyed?this:(h!==W&&t&&this.focus(i),!h||a?this:(s.attr(r[0],"aria-hidden",!t),t?(this.mouse&&(o.origin=s.event.fix(this.mouse)),s.isFunction(u.text)&&this._updateContent(u.text,W),s.isFunction(u.title)&&this._updateTitle(u.title,W),!j&&"mouse"===p.target&&p.adjust.mouse&&(s(e).bind("mousemove."+I,this._storeMouse),j=z),f||r.css("width",r.outerWidth(W)),this.reposition(i,arguments[2]),f||r.css("width",""),d.solo&&("string"==typeof d.solo?s(d.solo):s(X,d.solo)).not(r).not(d.target).qtip("hide",s.Event("tooltipsolo"))):(clearTimeout(this.timers.show),delete o.origin,j&&!s(X+'[tracking="true"]:visible',d.solo).not(r).length&&(s(e).unbind("mousemove."+I),j=W),this.blur(i)),l=s.proxy(function(){t?(et.ie&&r[0].style.removeAttribute("filter"),r.css("overflow",""),"string"==typeof d.autofocus&&s(this.options.show.autofocus,r).focus(),this.options.show.target.trigger("qtip-"+this.id+"-inactive")):r.css({display:"",visibility:"",opacity:"",left:"",top:""}),this._trigger(t?"visible":"hidden")},this),d.effect===W||m===W?(r[c](),l()):s.isFunction(d.effect)?(r.stop(1,1),d.effect.call(r,this),r.queue("fx",function(t){l(),t()})):r.fadeTo(90,t?1:0,l),t&&d.target.trigger("qtip-"+this.id+"-inactive"),this))},C.show=function(t){return this.toggle(z,t)},C.hide=function(t){return this.toggle(W,t)},C.focus=function(t){if(!this.rendered||this.destroyed)return this;var e=s(X),i=this.tooltip,o=parseInt(i[0].style.zIndex,10),n=x.zindex+e.length;return i.hasClass(V)||this._trigger("focus",[n],t)&&(o!==n&&(e.each(function(){this.style.zIndex>o&&(this.style.zIndex=this.style.zIndex-1)}),e.filter("."+V).qtip("blur",t)),i.addClass(V)[0].style.zIndex=n),this},C.blur=function(t){return!this.rendered||this.destroyed?this:(this.tooltip.removeClass(V),this._trigger("blur",[this.tooltip.css("zIndex")],t),this)},C.disable=function(t){return this.destroyed?this:("toggle"===t?t=!(this.rendered?this.tooltip.hasClass(K):this.disabled):"boolean"!=typeof t&&(t=z),this.rendered&&this.tooltip.toggleClass(K,t).attr("aria-disabled",t),this.disabled=!!t,this)},C.enable=function(){return this.disable(W)},C._createButton=function(){var t=this,e=this.elements,i=e.tooltip,o=this.options.content.button,n="string"==typeof o?o:"Close tooltip";e.button&&e.button.remove(),o.jquery?e.button=o:e.button=s("<a />",{"class":"qtip-close "+(this.options.style.widget?"":I+"-icon"),title:n,"aria-label":n}).prepend(s("<span />",{"class":"ui-icon ui-icon-close",html:"&times;"})),e.button.appendTo(e.titlebar||i).attr("role","button").click(function(e){return i.hasClass(K)||t.hide(e),W})},C._updateButton=function(t){if(!this.rendered)return W;var e=this.elements.button;t?this._createButton():e.remove()},C._setWidget=function(){var t=this.options.style.widget,e=this.elements,i=e.tooltip,s=i.hasClass(K);i.removeClass(K),K=t?"ui-state-disabled":"qtip-disabled",i.toggleClass(K,s),i.toggleClass("ui-helper-reset "+c(),t).toggleClass(J,this.options.style.def&&!t),e.content&&e.content.toggleClass(c("content"),t),e.titlebar&&e.titlebar.toggleClass(c("header"),t),e.button&&e.button.toggleClass(I+"-icon",!t)},C._storeMouse=function(t){return(this.mouse=s.event.fix(t)).type="mousemove",this},C._bind=function(t,e,i,o,n){if(t&&i&&e.length){var r="."+this._id+(o?"-"+o:"");return s(t).bind((e.split?e:e.join(r+" "))+r,s.proxy(i,n||this)),this}},C._unbind=function(t,e){return t&&s(t).unbind("."+this._id+(e?"-"+e:"")),this},C._trigger=function(t,e,i){var o=s.Event("tooltip"+t);return o.originalEvent=i&&s.extend({},i)||this.cache.event||k,this.triggering=t,this.tooltip.trigger(o,[this].concat(e||[])),this.triggering=W,!o.isDefaultPrevented()},C._bindEvents=function(t,e,i,o,n,r){var a=i.filter(o).add(o.filter(i)),h=[];a.length&&(s.each(e,function(e,i){var o=s.inArray(i,t);o>-1&&h.push(t.splice(o,1)[0])}),h.length&&(this._bind(a,h,function(t){(!!this.rendered&&this.tooltip[0].offsetWidth>0?r:n).call(this,t)}),i=i.not(a),o=o.not(a))),this._bind(i,t,n),this._bind(o,e,r)},C._assignInitialEvents=function(t){function e(t){if(this.disabled||this.destroyed)return W;this.cache.event=t&&s.event.fix(t),this.cache.target=t&&s(t.target),clearTimeout(this.timers.show),this.timers.show=d.call(this,function(){this.render("object"==typeof t||i.show.ready)},i.prerender?0:i.show.delay)}var i=this.options,o=i.show.target,n=i.hide.target,r=i.show.event?s.trim(""+i.show.event).split(" "):[],a=i.hide.event?s.trim(""+i.hide.event).split(" "):[];this._bind(this.elements.target,["remove","removeqtip"],function(){this.destroy(!0)},"destroy"),/mouse(over|enter)/i.test(i.show.event)&&!/mouse(out|leave)/i.test(i.hide.event)&&a.push("mouseleave"),this._bind(o,"mousemove",function(t){this._storeMouse(t),this.cache.onTarget=z}),this._bindEvents(r,a,o,n,e,function(){if(!this.timers)return W;clearTimeout(this.timers.show)}),(i.show.ready||i.prerender)&&e.call(this,t)},C._assignEvents=function(){var i=this,o=this.options,n=o.position,r=this.tooltip,a=o.show.target,h=o.hide.target,l=n.container,c=n.viewport,d=s(e),m=(s(e.body),s(t)),v=o.show.event?s.trim(""+o.show.event).split(" "):[],y=o.hide.event?s.trim(""+o.hide.event).split(" "):[];s.each(o.events,function(t,e){i._bind(r,"toggle"===t?["tooltipshow","tooltiphide"]:["tooltip"+t],e,null,r)}),/mouse(out|leave)/i.test(o.hide.event)&&"window"===o.hide.leave&&this._bind(d,["mouseout","blur"],function(t){/select|option/.test(t.target.nodeName)||t.relatedTarget||this.hide(t)}),o.hide.fixed?h=h.add(r.addClass(Q)):/mouse(over|enter)/i.test(o.show.event)&&this._bind(h,"mouseleave",function(){clearTimeout(this.timers.show)}),(""+o.hide.event).indexOf("unfocus")>-1&&this._bind(l.closest("html"),["mousedown","touchstart"],function(t){var e=s(t.target),i=this.rendered&&!this.tooltip.hasClass(K)&&this.tooltip[0].offsetWidth>0,o=e.parents(X).filter(this.tooltip[0]).length>0;e[0]===this.target[0]||e[0]===this.tooltip[0]||o||this.target.has(e[0]).length||!i||this.hide(t)}),"number"==typeof o.hide.inactive&&(this._bind(a,"qtip-"+this.id+"-inactive",f,"inactive"),this._bind(h.add(r),x.inactiveEvents,f)),this._bindEvents(v,y,a,h,p,u),this._bind(a.add(r),"mousemove",function(t){if("number"==typeof o.hide.distance){var e=this.cache.origin||{},i=this.options.hide.distance,s=Math.abs;(s(t.pageX-e.pageX)>=i||s(t.pageY-e.pageY)>=i)&&this.hide(t)}this._storeMouse(t)}),"mouse"===n.target&&n.adjust.mouse&&(o.hide.event&&this._bind(a,["mouseenter","mouseleave"],function(t){if(!this.cache)return W;this.cache.onTarget="mouseenter"===t.type}),this._bind(d,"mousemove",function(t){this.rendered&&this.cache.onTarget&&!this.tooltip.hasClass(K)&&this.tooltip[0].offsetWidth>0&&this.reposition(t)})),(n.adjust.resize||c.length)&&this._bind(s.event.special.resize?c:m,"resize",g),n.adjust.scroll&&this._bind(m.add(n.container),"scroll",g)},C._unassignEvents=function(){var i=this.options,o=i.show.target,n=i.hide.target,r=s.grep([this.elements.target[0],this.rendered&&this.tooltip[0],i.position.container[0],i.position.viewport[0],i.position.container.closest("html")[0],t,e],function(t){return"object"==typeof t});o&&o.toArray&&(r=r.concat(o.toArray())),n&&n.toArray&&(r=r.concat(n.toArray())),this._unbind(r)._unbind(r,"destroy")._unbind(r,"inactive")},s(function(){m(X,["mouseenter","mouseleave"],function(t){var e="mouseenter"===t.type,i=s(t.currentTarget),o=s(t.relatedTarget||t.target),n=this.options;e?(this.focus(t),i.hasClass(Q)&&!i.hasClass(K)&&clearTimeout(this.timers.hide)):"mouse"===n.position.target&&n.position.adjust.mouse&&n.hide.event&&n.show.target&&!o.closest(n.show.target[0]).length&&this.hide(t),i.toggleClass(G,e)}),m("["+H+"]",U,f)}),x=s.fn.qtip=function(t,e,o){var n=(""+t).toLowerCase(),r=k,h=s.makeArray(arguments).slice(1),l=h[h.length-1],c=this[0]?s.data(this[0],I):k;return!arguments.length&&c||"api"===n?c:"string"==typeof t?(this.each(function(){var t=s.data(this,I);if(!t)return z;if(l&&l.timeStamp&&(t.cache.event=l),!e||"option"!==n&&"options"!==n)t[n]&&t[n].apply(t,h);else{if(o===i&&!s.isPlainObject(e))return r=t.get(e),W;t.set(e,o)}}),r!==k?r:this):"object"!=typeof t&&arguments.length?void 0:(c=a(s.extend(z,{},t)),this.each(function(t){var e,i;if(i=!(i=s.isArray(c.id)?c.id[t]:c.id)||i===W||i.length<1||x.api[i]?x.nextid++:i,(e=v(s(this),i,c))===W)return z;x.api[i]=e,s.each(R,function(){"initialize"===this.initialize&&this(e)}),e._assignInitialEvents(l)}))},s.qtip=o,x.api={},s.each({attr:function(t,e){if(this.length){var i=this[0],o="title",n=s.data(i,"qtip");if(t===o&&n&&"object"==typeof n&&n.options.suppress)return arguments.length<2?s.attr(i,tt):(n&&n.options.content.attr===o&&n.cache.attr&&n.set("content.text",e),this.attr(tt,e))}return s.fn["attr"+Z].apply(this,arguments)},clone:function(t){s([]);var e=s.fn["clone"+Z].apply(this,arguments);return t||e.filter("["+tt+"]").attr("title",function(){return s.attr(this,tt)}).removeAttr(tt),e}},function(t,e){if(!e||s.fn[t+Z])return z;var i=s.fn[t+Z]=s.fn[t];s.fn[t]=function(){return e.apply(this,arguments)||i.apply(this,arguments)}}),s.ui||(s["cleanData"+Z]=s.cleanData,s.cleanData=function(t){for(var e,i=0;(e=s(t[i])).length;i++)if(e.attr(N))try{e.triggerHandler("removeqtip")}catch(o){}s["cleanData"+Z].apply(this,arguments)}),x.version="2.2.1",x.nextid=0,x.inactiveEvents=U,x.zindex=15e3,x.defaults={prerender:W,id:W,overwrite:z,suppress:z,content:{text:z,attr:"title",title:W,button:W},position:{my:"top left",at:"bottom right",target:W,container:W,viewport:W,adjust:{x:0,y:0,mouse:z,scroll:z,resize:z,method:"flipinvert flipinvert"},effect:function(t,e){s(this).animate(e,{duration:200,queue:W})}},show:{target:W,event:"mouseenter",effect:z,delay:90,solo:W,ready:W,autofocus:W},hide:{target:W,event:"mouseleave",effect:z,delay:0,fixed:W,inactive:W,leave:"window",distance:W},style:{classes:"",widget:W,width:W,height:W,def:z},events:{render:k,move:k,show:k,hide:k,toggle:k,visible:k,hidden:k,focus:k,blur:k}};var nt,rt,at="margin",ht="border",lt="color",ct="background-color",dt="transparent",pt=" !important",ut=!!e.createElement("canvas").getContext,ft=/rgba?\(0, 0, 0(, 0)?\)|transparent|#123456/i,gt={},mt=["Webkit","O","Moz","ms"];if(ut)var vt=(t.devicePixelRatio||1)/((rt=e.createElement("canvas").getContext("2d")).backingStorePixelRatio||rt.webkitBackingStorePixelRatio||rt.mozBackingStorePixelRatio||rt.msBackingStorePixelRatio||rt.oBackingStorePixelRatio||1);else var yt=function(t,e,i){return"<qtipvml:"+t+' xmlns="urn:schemas-microsoft.com:vml" class="qtip-vml" '+(e||"")+' style="behavior: url(#default#VML); '+(i||"")+'" />'};s.extend(_.prototype,{init:function(t){var e,i;i=this.element=t.elements.tip=s("<div />",{"class":I+"-tip"}).prependTo(t.tooltip),ut?((e=s("<canvas />").appendTo(this.element)[0].getContext("2d")).lineJoin="miter",e.miterLimit=1e5,e.save()):(e=yt("shape",'coordorigin="0,0"',"position:absolute;"),this.element.html(e+e),t._bind(s("*",i).add(i),["click","mousedown"],function(t){t.stopPropagation()},this._ns)),t._bind(t.tooltip,"tooltipmove",this.reposition,this._ns,this),this.create()},_swapDimensions:function(){this.size[0]=this.options.height,this.size[1]=this.options.width},_resetDimensions:function(){this.size[0]=this.options.width,this.size[1]=this.options.height},_useTitle:function(t){var e=this.qtip.elements.titlebar;return e&&(t.y===L||t.y===O&&this.element.position().top+this.size[1]/2+this.options.offset<e.outerHeight(z))},_parseCorner:function(t){var e=this.qtip.options.position.my;return t===W||e===W?t=W:t===z?t=new T(e.string()):t.string||((t=new T(t)).fixed=z),t},_parseWidth:function(t,e,i){var s=this.qtip.elements,o=ht+y(e)+"Width";return(i?w(i,o):w(s.content,o)||w(this._useTitle(t)&&s.titlebar||s.content,o)||w(s.tooltip,o))||0},_parseRadius:function(t){var e=this.qtip.elements,i=ht+y(t.y)+y(t.x)+"Radius";return et.ie<9?0:w(this._useTitle(t)&&e.titlebar||e.content,i)||w(e.tooltip,i)||0},_invalidColour:function(t,e,i){var s=t.css(e);return!s||i&&s===t.css(i)||ft.test(s)?W:s},_parseColours:function(t){var e=this.qtip.elements,i=this.element.css("cssText",""),o=ht+y(t[t.precedance])+y(lt),n=this._useTitle(t)&&e.titlebar||e.content,r=this._invalidColour,a=[];return a[0]=r(i,ct)||r(n,ct)||r(e.content,ct)||r(e.tooltip,ct)||i.css(ct),a[1]=r(i,o,lt)||r(n,o,lt)||r(e.content,o,lt)||r(e.tooltip,o,lt)||e.tooltip.css(o),s("*",i).add(i).css("cssText",ct+":"+dt+pt+";"+ht+":0"+pt+";"),a},_calculateSize:function(t){var e,i,s=t.precedance===E,o=this.options.width,n=this.options.height,r="c"===t.abbrev(),a=(s?o:n)*(r?.5:1),h=Math.pow,l=Math.round,c=Math.sqrt(h(a,2)+h(n,2)),d=[this.border/a*c,this.border/n*c];return d[2]=Math.sqrt(h(d[0],2)-h(this.border,2)),d[3]=Math.sqrt(h(d[1],2)-h(this.border,2)),i=[l((e=(c+d[2]+d[3]+(r?0:d[0]))/c)*o),l(e*n)],s?i:i.reverse()},_calculateTip:function(t,e,i){i=i||1;var s=(e=e||this.size)[0]*i,o=e[1]*i,n=Math.ceil(s/2),r=Math.ceil(o/2),a={br:[0,0,s,o,s,0],bl:[0,0,s,0,0,o],tr:[0,o,s,0,s,o],tl:[0,0,0,o,s,o],tc:[0,o,n,0,s,o],bc:[0,0,s,0,n,o],rc:[0,0,s,r,0,o],lc:[s,0,s,o,0,r]};return a.lt=a.br,a.rt=a.bl,a.lb=a.tr,a.rb=a.tl,a[t.abbrev()]},_drawCoords:function(t,e){t.beginPath(),t.moveTo(e[0],e[1]),t.lineTo(e[2],e[3]),t.lineTo(e[4],e[5]),t.closePath()},create:function(){var t=this.corner=(ut||et.ie)&&this._parseCorner(this.options.corner);return(this.enabled=!!this.corner&&"c"!==this.corner.abbrev())&&(this.qtip.cache.corner=t.clone(),this.update()),this.element.toggle(this.enabled),this.corner},update:function(e,i){if(!this.enabled)return this;var o,n,r,a,h,l,c,d,p=this.qtip.elements,u=this.element,f=u.children(),g=this.options,m=this.size,v=g.mimic,y=Math.round;e||(e=this.qtip.cache.corner||this.corner),v===W?v=e:((v=new T(v)).precedance=e.precedance,"inherit"===v.x?v.x=e.x:"inherit"===v.y?v.y=e.y:v.x===v.y&&(v[e.precedance]=e[e.precedance])),n=v.precedance,e.precedance===A?this._swapDimensions():this._resetDimensions(),(o=this.color=this._parseColours(e))[1]!==dt?(d=this.border=this._parseWidth(e,e[e.precedance]),g.border&&d<1&&!ft.test(o[1])&&(o[0]=o[1]),this.border=d=g.border!==z?g.border:d):this.border=d=0,c=this.size=this._calculateSize(e),u.css({width:c[0],height:c[1],lineHeight:c[1]+"px"}),l=e.precedance===E?[y(v.x===F?d:v.x===D?c[0]-m[0]-d:(c[0]-m[0])/2),y(v.y===L?c[1]-m[1]:0)]:[y(v.x===F?c[0]-m[0]:0),y(v.y===L?d:v.y===P?c[1]-m[1]-d:(c[1]-m[1])/2)],ut?((r=f[0].getContext("2d")).restore(),r.save(),r.clearRect(0,0,6e3,6e3),a=this._calculateTip(v,m,vt),h=this._calculateTip(v,this.size,vt),f.attr(M,c[0]*vt).attr(S,c[1]*vt),f.css(M,c[0]).css(S,c[1]),this._drawCoords(r,h),r.fillStyle=o[1],r.fill(),r.translate(l[0]*vt,l[1]*vt),this._drawCoords(r,a),r.fillStyle=o[0],r.fill()):(a="m"+(a=this._calculateTip(v))[0]+","+a[1]+" l"+a[2]+","+a[3]+" "+a[4]+","+a[5]+" xe",l[2]=d&&/^(r|b)/i.test(e.string())?8===et.ie?2:1:0,f.css({coordsize:c[0]+d+" "+(c[1]+d),antialias:""+(v.string().indexOf(O)>-1),left:l[0]-l[2]*Number(n===A),top:l[1]-l[2]*Number(n===E),width:c[0]+d,height:c[1]+d}).each(function(t){var e=s(this);e[e.prop?"prop":"attr"]({coordsize:c[0]+d+" "+(c[1]+d),path:a,fillcolor:o[0],filled:!!t,stroked:!t}).toggle(!(!d&&!t)),!t&&e.html(yt("stroke",'weight="'+2*d+'px" color="'+o[1]+'" miterlimit="1000" joinstyle="miter"'))})),t.opera&&setTimeout(function(){p.tip.css({display:"inline-block",visibility:"visible"})},1),i!==W&&this.calculate(e,c)},calculate:function(t,e){if(!this.enabled)return W;var i,o,n=this,r=this.qtip.elements,a=this.element,h=this.options.offset,l=(r.tooltip.hasClass("ui-widget"),{});return t=t||this.corner,i=t.precedance,e=e||this._calculateSize(t),o=[t.x,t.y],i===A&&o.reverse(),s.each(o,function(s,o){var a,c,d;o===O?(l[a=i===E?F:L]="50%",l[at+"-"+a]=-Math.round(e[i===E?0:1]/2)+h):(a=n._parseWidth(t,o,r.tooltip),c=n._parseWidth(t,o,r.content),d=n._parseRadius(t),l[o]=Math.max(-n.border,s?c:h+(d>a?d:-a)))}),l[t[i]]-=e[i===A?0:1],a.css({margin:"",top:"",bottom:"",left:"",right:""}).css(l),l},reposition:function(t,e,s){function o(t,e,i,s,o){t===B&&l.precedance===e&&c[s]&&l[i]!==O?l.precedance=l.precedance===A?E:A:t!==B&&c[s]&&(l[e]=l[e]===O?c[s]>0?s:o:l[e]===s?o:s)}function n(t,e,o){l[t]===O?g[at+"-"+e]=f[t]=r[at+"-"+e]-c[e]:(a=r[o]!==i?[c[e],-r[e]]:[-c[e],r[e]],(f[t]=Math.max(a[0],a[1]))>a[0]&&(s[e]-=c[e],f[e]=W),g[r[o]!==i?o:e]=f[t])}if(this.enabled){var r,a,h=e.cache,l=this.corner.clone(),c=s.adjusted,d=e.options.position.adjust.method.split(" "),p=d[0],u=d[1]||d[0],f={left:W,top:W,x:0,y:0},g={};this.corner.fixed!==z&&(o(p,A,E,F,D),o(u,E,A,L,P),
37
+ l.string()===h.corner.string()&&h.cornerTop===c.top&&h.cornerLeft===c.left||this.update(l,W)),(r=this.calculate(l)).right!==i&&(r.left=-r.right),r.bottom!==i&&(r.top=-r.bottom),r.user=this.offset,(f.left=p===B&&!!c.left)&&n(A,F,D),(f.top=u===B&&!!c.top)&&n(E,L,P),this.element.css(g).toggle(!(f.x&&f.y||l.x===O&&f.y||l.y===O&&f.x)),s.left-=r.left.charAt?r.user:p!==B||f.top||!f.left&&!f.top?r.left+this.border:0,s.top-=r.top.charAt?r.user:u!==B||f.left||!f.left&&!f.top?r.top+this.border:0,h.cornerLeft=c.left,h.cornerTop=c.top,h.corner=l.clone()}},destroy:function(){this.qtip._unbind(this.qtip.tooltip,this._ns),this.qtip.elements.tip&&this.qtip.elements.tip.find("*").remove().end().remove()}}),(nt=R.tip=function(t){return new _(t,t.options.style.tip)}).initialize="render",nt.sanitize=function(t){if(t.style&&"tip"in t.style){var e=t.style.tip;"object"!=typeof e&&(e=t.style.tip={corner:e}),/string|boolean/i.test(typeof e.corner)||(e.corner=z)}},q.tip={"^position.my|style.tip.(corner|mimic|border)$":function(){this.create(),this.qtip.reposition()},"^style.tip.(height|width)$":function(t){this.size=[t.width,t.height],this.update(),this.qtip.reposition()},"^content.title|style.(classes|widget)$":function(){this.update()}},s.extend(z,x.defaults,{style:{tip:{corner:z,mimic:W,width:6,height:6,border:z,offset:0}}}),R.viewport=function(i,s,o,n,r,a,h){function l(t,e,i,o,n,r,a,h,l){var c=s[n],y=w[t],b=_[t],x=i===B,C=y===n?l:y===r?-l:-l/2,T=b===n?h:b===r?-h:-h/2,q=m[n]+v[n]-(u?0:p[n]),j=q-c,z=c+l-(a===M?f:g)-q,W=C-(w.precedance===t||y===w[e]?T:0)-(b===O?h/2:0);return x?(W=(y===n?1:-1)*C,s[n]+=j>0?j:z>0?-z:0,s[n]=Math.max(-p[n]+v[n],c-W,Math.min(Math.max(-p[n]+v[n]+(a===M?f:g),c+W),s[n],"center"===y?c-C:1e9))):(o*=i===$?2:0,j>0&&(y!==n||z>0)?(s[n]-=W+o,d.invert(t,n)):z>0&&(y!==r||j>0)&&(s[n]-=(y===O?-W:W)+o,d.invert(t,r)),s[n]<m&&-s[n]>z&&(s[n]=c,d=w.clone())),s[n]-c}var c,d,p,u,f,g,m,v,y=o.target,b=i.elements.tooltip,w=o.my,_=o.at,x=o.adjust,C=x.method.split(" "),T=C[0],q=C[1]||C[0],j=o.viewport,z=o.container,k=(i.cache,{left:0,top:0});return j.jquery&&y[0]!==t&&y[0]!==e.body&&"none"!==x.method?(p=z.offset()||k,u="static"===z.css("position"),c="fixed"===b.css("position"),f=j[0]===t?j.width():j.outerWidth(W),g=j[0]===t?j.height():j.outerHeight(W),m={left:c?0:j.scrollLeft(),top:c?0:j.scrollTop()},v=j.offset()||k,"shift"===T&&"shift"===q||(d=w.clone()),k={left:"none"!==T?l(A,E,T,x.x,F,D,M,n,a):0,top:"none"!==q?l(E,A,q,x.y,L,P,S,r,h):0,my:d}):k}})}(window,document);
38
+ /*!
39
+ * EventEmitter v4.2.6 - git.io/ee
40
+ * Oliver Caldwell
41
+ * MIT license
42
+ * @preserve
43
+ */
44
+ (function(){"use strict";function e(){}function t(e,t){for(var n=e.length;n--;)if(e[n].listener===t)return n;return-1}function n(e){return function(){return this[e].apply(this,arguments)}}var i=e.prototype,r=this,s=r.EventEmitter;i.getListeners=function(e){var t,n,i=this._getEvents();if("object"==typeof e)for(n in t={},i)i.hasOwnProperty(n)&&e.test(n)&&(t[n]=i[n]);else t=i[e]||(i[e]=[]);return t},i.flattenListeners=function(e){var t,n=[];for(t=0;t<e.length;t+=1)n.push(e[t].listener);return n},i.getListenersAsObject=function(e){var t,n=this.getListeners(e);return n instanceof Array&&((t={})[e]=n),t||n},i.addListener=function(e,n){var i,r=this.getListenersAsObject(e),s="object"==typeof n;for(i in r)r.hasOwnProperty(i)&&-1===t(r[i],n)&&r[i].push(s?n:{listener:n,once:!1});return this},i.on=n("addListener"),i.addOnceListener=function(e,t){return this.addListener(e,{listener:t,once:!0})},i.once=n("addOnceListener"),i.defineEvent=function(e){return this.getListeners(e),this},i.defineEvents=function(e){for(var t=0;t<e.length;t+=1)this.defineEvent(e[t]);return this},i.removeListener=function(e,n){var i,r,s=this.getListenersAsObject(e);for(r in s)s.hasOwnProperty(r)&&(-1!==(i=t(s[r],n))&&s[r].splice(i,1));return this},i.off=n("removeListener"),i.addListeners=function(e,t){return this.manipulateListeners(!1,e,t)},i.removeListeners=function(e,t){return this.manipulateListeners(!0,e,t)},i.manipulateListeners=function(e,t,n){var i,r,s=e?this.removeListener:this.addListener,o=e?this.removeListeners:this.addListeners;if("object"!=typeof t||t instanceof RegExp)for(i=n.length;i--;)s.call(this,t,n[i]);else for(i in t)t.hasOwnProperty(i)&&(r=t[i])&&("function"==typeof r?s.call(this,i,r):o.call(this,i,r));return this},i.removeEvent=function(e){var t,n=typeof e,i=this._getEvents();if("string"===n)delete i[e];else if("object"===n)for(t in i)i.hasOwnProperty(t)&&e.test(t)&&delete i[t];else delete this._events;return this},i.removeAllListeners=n("removeEvent"),i.emitEvent=function(e,t){var n,i,r,s=this.getListenersAsObject(e);for(r in s)if(s.hasOwnProperty(r))for(i=s[r].length;i--;)!0===(n=s[r][i]).once&&this.removeListener(e,n.listener),n.listener.apply(this,t||[])===this._getOnceReturnValue()&&this.removeListener(e,n.listener);return this},i.trigger=n("emitEvent"),i.emit=function(e){var t=Array.prototype.slice.call(arguments,1);return this.emitEvent(e,t)},i.setOnceReturnValue=function(e){return this._onceReturnValue=e,this},i._getOnceReturnValue=function(){return!this.hasOwnProperty("_onceReturnValue")||this._onceReturnValue},i._getEvents=function(){return this._events||(this._events={})},e.noConflict=function(){return r.EventEmitter=s,e},"function"==typeof define&&define.amd?define(function(){return e}):"object"==typeof module&&module.exports?module.exports=e:this.EventEmitter=e}).call(this),
45
+ /*!
46
+ * eventie v1.0.3
47
+ * event binding helper
48
+ * eventie.bind( elem, 'click', myFn )
49
+ * eventie.unbind( elem, 'click', myFn )
50
+ */
51
+ function(e){"use strict";var t=document.documentElement,n=function(){};t.addEventListener?n=function(e,t,n){e.addEventListener(t,n,!1)}:t.attachEvent&&(n=function(t,n,i){t[n+i]=i.handleEvent?function(){var t=e.event;t.target=t.target||t.srcElement,i.handleEvent.call(i,t)}:function(){var n=e.event;n.target=n.target||n.srcElement,i.call(t,n)},t.attachEvent("on"+n,t[n+i])});var i=function(){};t.removeEventListener?i=function(e,t,n){e.removeEventListener(t,n,!1)}:t.detachEvent&&(i=function(e,t,n){e.detachEvent("on"+t,e[t+n]);try{delete e[t+n]}catch(i){e[t+n]=void 0}});var r={bind:n,unbind:i};"function"==typeof define&&define.amd?define(r):e.eventie=r}(this),
52
+ /*!
53
+ * imagesLoaded v3.0.2
54
+ * JavaScript is all like "You images are done yet or what?"
55
+ */
56
+ function(e){"use strict";function t(e,t){for(var n in t)e[n]=t[n];return e}function n(e){return"[object Array]"===a.call(e)}function i(e){var t=[];if(n(e))t=e;else if("number"==typeof e.length)for(var i=0,r=e.length;r>i;i++)t.push(e[i]);else t.push(e);return t}function r(e,n){function r(e,n,o){if(!(this instanceof r))return new r(e,n);"string"==typeof e&&(e=document.querySelectorAll(e)),this.elements=i(e),this.options=t({},this.options),"function"==typeof n?o=n:t(this.options,n),o&&this.on("always",o),this.getImages(),s&&(this.jqDeferred=new s.Deferred);var h=this;setTimeout(function(){h.check()})}function a(e){this.img=e}r.prototype=new e,r.prototype.options={},r.prototype.getImages=function(){this.images=[];for(var e=0,t=this.elements.length;t>e;e++){var n=this.elements[e];"IMG"===n.nodeName&&this.addImage(n);for(var i=n.querySelectorAll("img"),r=0,s=i.length;s>r;r++){var o=i[r];this.addImage(o)}}},r.prototype.addImage=function(e){var t=new a(e);this.images.push(t)},r.prototype.check=function(){function e(e,r){return t.options.debug&&h&&o.log("confirm",e,r),t.progress(e),++n===i&&t.complete(),!0}var t=this,n=0,i=this.images.length;if(this.hasAnyBroken=!1,i)for(var r=0;i>r;r++){var s=this.images[r];s.on("confirm",e),s.check()}else this.complete()},r.prototype.progress=function(e){this.hasAnyBroken=this.hasAnyBroken||!e.isLoaded,this.emit("progress",this,e),this.jqDeferred&&this.jqDeferred.notify(this,e)},r.prototype.complete=function(){var e=this.hasAnyBroken?"fail":"done";if(this.isComplete=!0,this.emit(e,this),this.emit("always",this),this.jqDeferred){var t=this.hasAnyBroken?"reject":"resolve";this.jqDeferred[t](this)}},s&&(s.fn.imagesLoaded=function(e,t){return new r(this,e,t).jqDeferred.promise(s(this))});var c={};return a.prototype=new e,a.prototype.check=function(){var e=c[this.img.src];if(e)this.useCached(e);else if(c[this.img.src]=this,this.img.complete&&void 0!==this.img.naturalWidth)this.confirm(0!==this.img.naturalWidth,"naturalWidth");else{var t=this.proxyImage=new Image;n.bind(t,"load",this),n.bind(t,"error",this),t.src=this.img.src}},a.prototype.useCached=function(e){if(e.isConfirmed)this.confirm(e.isLoaded,"cached was confirmed");else{var t=this;e.on("confirm",function(e){return t.confirm(e.isLoaded,"cache emitted confirmed"),!0})}},a.prototype.confirm=function(e,t){this.isConfirmed=!0,this.isLoaded=e,this.emit("confirm",this,t)},a.prototype.handleEvent=function(e){var t="on"+e.type;this[t]&&this[t](e)},a.prototype.onload=function(){this.confirm(!0,"onload"),this.unbindProxyEvents()},a.prototype.onerror=function(){this.confirm(!1,"onerror"),this.unbindProxyEvents()},a.prototype.unbindProxyEvents=function(){n.unbind(this.proxyImage,"load",this),n.unbind(this.proxyImage,"error",this)},r}var s=e.jQuery,o=e.console,h=void 0!==o,a=Object.prototype.toString;"function"==typeof define&&define.amd?define(["eventEmitter","eventie"],r):e.imagesLoaded=r(e.EventEmitter,e.eventie)}(window);
57
+ /*!
58
+ * typeahead.js 0.11.1
59
+ * https://github.com/twitter/typeahead.js
60
+ * Copyright 2013-2015 Twitter, Inc. and other contributors; Licensed MIT
61
+ */
62
+ !function(t,e){"function"==typeof define&&define.amd?define("bloodhound",["jquery"],function(n){return t.Bloodhound=e(n)}):"object"==typeof exports?module.exports=e(require("jquery")):t.Bloodhound=e(jQuery)}(this,function(t){var e=function(){"use strict";return{isMsie:function(){return!!/(msie|trident)/i.test(navigator.userAgent)&&navigator.userAgent.match(/(msie |rv:)(\d+(.\d+)?)/i)[2]},isBlankString:function(t){return!t||/^\s*$/.test(t)},escapeRegExChars:function(t){return t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},isString:function(t){return"string"==typeof t},isNumber:function(t){return"number"==typeof t},isArray:t.isArray,isFunction:t.isFunction,isObject:t.isPlainObject,isUndefined:function(t){return void 0===t},isElement:function(t){return!(!t||1!==t.nodeType)},isJQuery:function(e){return e instanceof t},toStr:function(t){return e.isUndefined(t)||null===t?"":t+""},bind:t.proxy,each:function(e,n){function i(t,e){return n(e,t)}t.each(e,i)},map:t.map,filter:t.grep,every:function(e,n){var i=!0;return e?(t.each(e,function(t,r){if(!(i=n.call(null,r,t,e)))return!1}),!!i):i},some:function(e,n){var i=!1;return e?(t.each(e,function(t,r){if(i=n.call(null,r,t,e))return!1}),!!i):i},mixin:t.extend,identity:function(t){return t},clone:function(e){return t.extend(!0,{},e)},getIdGenerator:function(){var t=0;return function(){return t++}},templatify:function(e){function n(){return String(e)}return t.isFunction(e)?e:n},defer:function(t){setTimeout(t,0)},debounce:function(t,e,n){var i,r;return function(){var s,o,u=this,a=arguments;return s=function(){i=null,n||(r=t.apply(u,a))},o=n&&!i,clearTimeout(i),i=setTimeout(s,e),o&&(r=t.apply(u,a)),r}},throttle:function(t,e){var n,i,r,s,o,u;return o=0,u=function(){o=new Date,r=null,s=t.apply(n,i)},function(){var a=new Date,c=e-(a-o);return n=this,i=arguments,c<=0?(clearTimeout(r),r=null,o=a,s=t.apply(n,i)):r||(r=setTimeout(u,c)),s}},stringify:function(t){return e.isString(t)?t:JSON.stringify(t)},noop:function(){}}}(),n="0.11.1",i=function(){"use strict";function t(t){return(t=e.toStr(t))?t.split(/\s+/):[]}function n(t){return(t=e.toStr(t))?t.split(/\W+/):[]}function i(t){return function(n){return n=e.isArray(n)?n:[].slice.call(arguments,0),function(i){var r=[];return e.each(n,function(n){r=r.concat(t(e.toStr(i[n])))}),r}}}return{nonword:n,whitespace:t,obj:{nonword:i(n),whitespace:i(t)}}}(),r=function(){"use strict";function n(n){this.maxSize=e.isNumber(n)?n:100,this.reset(),this.maxSize<=0&&(this.set=this.get=t.noop)}function i(){this.head=this.tail=null}function r(t,e){this.key=t,this.val=e,this.prev=this.next=null}return e.mixin(n.prototype,{set:function(t,e){var n,i=this.list.tail;this.size>=this.maxSize&&(this.list.remove(i),delete this.hash[i.key],this.size--),(n=this.hash[t])?(n.val=e,this.list.moveToFront(n)):(n=new r(t,e),this.list.add(n),this.hash[t]=n,this.size++)},get:function(t){var e=this.hash[t];if(e)return this.list.moveToFront(e),e.val},reset:function(){this.size=0,this.hash={},this.list=new i}}),e.mixin(i.prototype,{add:function(t){this.head&&(t.next=this.head,this.head.prev=t),this.head=t,this.tail=this.tail||t},remove:function(t){t.prev?t.prev.next=t.next:this.head=t.next,t.next?t.next.prev=t.prev:this.tail=t.prev},moveToFront:function(t){this.remove(t),this.add(t)}}),n}(),s=function(){"use strict";function n(t,n){this.prefix=["__",t,"__"].join(""),this.ttlKey="__ttl__",this.keyMatcher=new RegExp("^"+e.escapeRegExChars(this.prefix)),this.ls=n||u,!this.ls&&this._noop()}function i(){return(new Date).getTime()}function r(t){return JSON.stringify(e.isUndefined(t)?null:t)}function s(e){return t.parseJSON(e)}function o(t){var e,n,i=[],r=u.length;for(e=0;e<r;e++)(n=u.key(e)).match(t)&&i.push(n.replace(t,""));return i}var u;try{(u=window.localStorage).setItem("~~~","!"),u.removeItem("~~~")}catch(a){u=null}return e.mixin(n.prototype,{_prefix:function(t){return this.prefix+t},_ttlKey:function(t){return this._prefix(t)+this.ttlKey},_noop:function(){this.get=this.set=this.remove=this.clear=this.isExpired=e.noop},_safeSet:function(t,e){try{this.ls.setItem(t,e)}catch(a){"QuotaExceededError"===a.name&&(this.clear(),this._noop())}},get:function(t){return this.isExpired(t)&&this.remove(t),s(this.ls.getItem(this._prefix(t)))},set:function(t,n,s){return e.isNumber(s)?this._safeSet(this._ttlKey(t),r(i()+s)):this.ls.removeItem(this._ttlKey(t)),this._safeSet(this._prefix(t),r(n))},remove:function(t){return this.ls.removeItem(this._ttlKey(t)),this.ls.removeItem(this._prefix(t)),this},clear:function(){var t,e=o(this.keyMatcher);for(t=e.length;t--;)this.remove(e[t]);return this},isExpired:function(t){var n=s(this.ls.getItem(this._ttlKey(t)));return!!(e.isNumber(n)&&i()>n)}}),n}(),o=function(){"use strict";function n(t){t=t||{},this.cancelled=!1,this.lastReq=null,this._send=t.transport,this._get=t.limiter?t.limiter(this._get):this._get,this._cache=!1===t.cache?new r(0):u}var i=0,s={},o=6,u=new r(10);return n.setMaxPendingRequests=function(t){o=t},n.resetCache=function(){u.reset()},e.mixin(n.prototype,{_fingerprint:function(e){return(e=e||{}).url+e.type+t.param(e.data||{})},_get:function(t,e){function n(t){e(null,t),h._cache.set(a,t)}function r(){e(!0)}function u(){i--,delete s[a],h.onDeckRequestArgs&&(h._get.apply(h,h.onDeckRequestArgs),h.onDeckRequestArgs=null)}var a,c,h=this;a=this._fingerprint(t),this.cancelled||a!==this.lastReq||((c=s[a])?c.done(n).fail(r):i<o?(i++,s[a]=this._send(t).done(n).fail(r).always(u)):this.onDeckRequestArgs=[].slice.call(arguments,0))},get:function(n,i){var r,s;i=i||t.noop,n=e.isString(n)?{url:n}:n||{},s=this._fingerprint(n),this.cancelled=!1,this.lastReq=s,(r=this._cache.get(s))?i(null,r):this._get(n,i)},cancel:function(){this.cancelled=!0}}),n}(),u=window.SearchIndex=function(){"use strict";function n(n){(n=n||{}).datumTokenizer&&n.queryTokenizer||t.error("datumTokenizer and queryTokenizer are both required"),this.identify=n.identify||e.stringify,this.datumTokenizer=n.datumTokenizer,this.queryTokenizer=n.queryTokenizer,this.reset()}function i(t){return t=e.filter(t,function(t){return!!t}),t=e.map(t,function(t){return t.toLowerCase()})}function r(){var t={};return t[a]=[],t[u]={},t}function s(t){for(var e={},n=[],i=0,r=t.length;i<r;i++)e[t[i]]||(e[t[i]]=!0,n.push(t[i]));return n}function o(t,e){var n=0,i=0,r=[];t=t.sort(),e=e.sort();for(var s=t.length,o=e.length;n<s&&i<o;)t[n]<e[i]?n++:t[n]>e[i]?i++:(r.push(t[n]),n++,i++);return r}var u="c",a="i";return e.mixin(n.prototype,{bootstrap:function(t){this.datums=t.datums,this.trie=t.trie},add:function(t){var n=this;t=e.isArray(t)?t:[t],e.each(t,function(t){var s,o;n.datums[s=n.identify(t)]=t,o=i(n.datumTokenizer(t)),e.each(o,function(t){var e,i,o;for(e=n.trie,i=t.split("");o=i.shift();)(e=e[u][o]||(e[u][o]=r()))[a].push(s)})})},get:function(t){var n=this;return e.map(t,function(t){return n.datums[t]})},search:function(t){var n,r,c=this;return n=i(this.queryTokenizer(t)),e.each(n,function(t){var e,n,i,s;if(r&&0===r.length)return!1;for(e=c.trie,n=t.split("");e&&(i=n.shift());)e=e[u][i];if(!e||0!==n.length)return r=[],!1;s=e[a].slice(0),r=r?o(r,s):s}),r?e.map(s(r),function(t){return c.datums[t]}):[]},all:function(){var t=[];for(var e in this.datums)t.push(this.datums[e]);return t},reset:function(){this.datums={},this.trie=r()},serialize:function(){return{datums:this.datums,trie:this.trie}}}),n}(),a=function(){"use strict";function t(t){this.url=t.url,this.ttl=t.ttl,this.cache=t.cache,this.prepare=t.prepare,this.transform=t.transform,this.transport=t.transport,this.thumbprint=t.thumbprint,this.storage=new s(t.cacheKey)}var n;return n={data:"data",protocol:"protocol",thumbprint:"thumbprint"},e.mixin(t.prototype,{_settings:function(){return{url:this.url,type:"GET",dataType:"json"}},store:function(t){this.cache&&(this.storage.set(n.data,t,this.ttl),this.storage.set(n.protocol,location.protocol,this.ttl),this.storage.set(n.thumbprint,this.thumbprint,this.ttl))},fromCache:function(){var t,e={};return this.cache?(e.data=this.storage.get(n.data),e.protocol=this.storage.get(n.protocol),e.thumbprint=this.storage.get(n.thumbprint),t=e.thumbprint!==this.thumbprint||e.protocol!==location.protocol,e.data&&!t?e.data:null):null},fromNetwork:function(t){function e(){t(!0)}function n(e){t(null,r.transform(e))}var i,r=this;t&&(i=this.prepare(this._settings()),this.transport(i).fail(e).done(n))},clear:function(){return this.storage.clear(),this}}),t}(),c=function(){"use strict";function t(t){this.url=t.url,this.prepare=t.prepare,this.transform=t.transform,this.transport=new o({cache:t.cache,limiter:t.limiter,transport:t.transport})}return e.mixin(t.prototype,{_settings:function(){return{url:this.url,type:"GET",dataType:"json"}},get:function(t,e){function n(t,n){e(t?[]:r.transform(n))}var i,r=this;if(e)return t=t||"",i=this.prepare(t,this._settings()),this.transport.get(i,n)},cancelLastRequest:function(){this.transport.cancel()}}),t}(),h=function(){"use strict";function i(i){var r;return i?(r={url:null,ttl:864e5,cache:!0,cacheKey:null,thumbprint:"",prepare:e.identity,transform:e.identity,transport:null},i=e.isString(i)?{url:i}:i,!(i=e.mixin(r,i)).url&&t.error("prefetch requires url to be set"),i.transform=i.filter||i.transform,i.cacheKey=i.cacheKey||i.url,i.thumbprint=n+i.thumbprint,i.transport=i.transport?u(i.transport):t.ajax,i):null}function r(n){var i;if(n)return i={url:null,cache:!0,prepare:null,replace:null,wildcard:null,limiter:null,rateLimitBy:"debounce",rateLimitWait:300,transform:e.identity,transport:null},n=e.isString(n)?{url:n}:n,!(n=e.mixin(i,n)).url&&t.error("remote requires url to be set"),n.transform=n.filter||n.transform,n.prepare=s(n),n.limiter=o(n),n.transport=n.transport?u(n.transport):t.ajax,delete n.replace,delete n.wildcard,delete n.rateLimitBy,delete n.rateLimitWait,n}function s(t){function e(t,e){return e.url=s(e.url,t),e}function n(t,e){return e.url=e.url.replace(o,encodeURIComponent(t)),e}function i(t,e){return e}var r,s,o;return r=t.prepare,s=t.replace,o=t.wildcard,r||(r=s?e:t.wildcard?n:i)}function o(t){function n(t){return function(n){return e.debounce(n,t)}}function i(t){return function(n){return e.throttle(n,t)}}var r,s,o;return r=t.limiter,s=t.rateLimitBy,o=t.rateLimitWait,r||(r=/^throttle$/i.test(s)?i(o):n(o)),r}function u(n){return function(i){function r(t){e.defer(function(){o.resolve(t)})}function s(t){e.defer(function(){o.reject(t)})}var o=t.Deferred();return n(i,r,s),o}}return function(n){var s,o;return s={initialize:!0,identify:e.stringify,datumTokenizer:null,queryTokenizer:null,sufficient:5,sorter:null,local:[],prefetch:null,remote:null},!(n=e.mixin(s,n||{})).datumTokenizer&&t.error("datumTokenizer is required"),!n.queryTokenizer&&t.error("queryTokenizer is required"),o=n.sorter,n.sorter=o?function(t){return t.sort(o)}:e.identity,n.local=e.isFunction(n.local)?n.local():n.local,n.prefetch=i(n.prefetch),n.remote=r(n.remote),n}}();return function(){"use strict";function n(t){t=h(t),this.sorter=t.sorter,this.identify=t.identify,this.sufficient=t.sufficient,this.local=t.local,this.remote=t.remote?new c(t.remote):null,this.prefetch=t.prefetch?new a(t.prefetch):null,this.index=new u({identify:this.identify,datumTokenizer:t.datumTokenizer,queryTokenizer:t.queryTokenizer}),!1!==t.initialize&&this.initialize()}var r;return r=window&&window.Bloodhound,n.noConflict=function(){return window&&(window.Bloodhound=r),n},n.tokenizers=i,e.mixin(n.prototype,{__ttAdapter:function(){function t(t,e,i){return n.search(t,e,i)}function e(t,e){return n.search(t,e)}var n=this;return this.remote?t:e},_loadPrefetch:function(){function e(t,e){if(t)return n.reject();r.add(e),r.prefetch.store(r.index.serialize()),n.resolve()}var n,i,r=this;return n=t.Deferred(),this.prefetch?(i=this.prefetch.fromCache())?(this.index.bootstrap(i),n.resolve()):this.prefetch.fromNetwork(e):n.resolve(),n.promise()},_initialize:function(){function t(){e.add(e.local)}var e=this;return this.clear(),(this.initPromise=this._loadPrefetch()).done(t),this.initPromise},initialize:function(t){return!this.initPromise||t?this._initialize():this.initPromise},add:function(t){return this.index.add(t),this},get:function(t){return t=e.isArray(t)?t:[].slice.call(arguments),this.index.get(t)},search:function(t,n,i){function r(t){var n=[];e.each(t,function(t){!e.some(s,function(e){return o.identify(t)===o.identify(e)})&&n.push(t)}),i&&i(n)}var s,o=this;return s=this.sorter(this.index.search(t)),n(this.remote?s.slice():s),this.remote&&s.length<this.sufficient?this.remote.get(t,r):this.remote&&this.remote.cancelLastRequest(),this},all:function(){return this.index.all()},clear:function(){return this.index.reset(),this},clearPrefetchCache:function(){return this.prefetch&&this.prefetch.clear(),this},clearRemoteCache:function(){return o.resetCache(),this},ttAdapter:function(){return this.__ttAdapter()}}),n}()}),function(t,e){"function"==typeof define&&define.amd?define("typeahead.js",["jquery"],function(t){return e(t)}):"object"==typeof exports?module.exports=e(require("jquery")):e(jQuery)}(0,function(t){var e=function(){"use strict";return{isMsie:function(){return!!/(msie|trident)/i.test(navigator.userAgent)&&navigator.userAgent.match(/(msie |rv:)(\d+(.\d+)?)/i)[2]},isBlankString:function(t){return!t||/^\s*$/.test(t)},escapeRegExChars:function(t){return t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},isString:function(t){return"string"==typeof t},isNumber:function(t){return"number"==typeof t},isArray:t.isArray,isFunction:t.isFunction,isObject:t.isPlainObject,isUndefined:function(t){return void 0===t},isElement:function(t){return!(!t||1!==t.nodeType)},isJQuery:function(e){return e instanceof t},toStr:function(t){return e.isUndefined(t)||null===t?"":t+""},bind:t.proxy,each:function(e,n){function i(t,e){return n(e,t)}t.each(e,i)},map:t.map,filter:t.grep,every:function(e,n){var i=!0;return e?(t.each(e,function(t,r){if(!(i=n.call(null,r,t,e)))return!1}),!!i):i},some:function(e,n){var i=!1;return e?(t.each(e,function(t,r){if(i=n.call(null,r,t,e))return!1}),!!i):i},mixin:t.extend,identity:function(t){return t},clone:function(e){return t.extend(!0,{},e)},getIdGenerator:function(){var t=0;return function(){return t++}},templatify:function(e){function n(){return String(e)}return t.isFunction(e)?e:n},defer:function(t){setTimeout(t,0)},debounce:function(t,e,n){var i,r;return function(){var s,o,u=this,a=arguments;return s=function(){i=null,n||(r=t.apply(u,a))},o=n&&!i,clearTimeout(i),i=setTimeout(s,e),o&&(r=t.apply(u,a)),r}},throttle:function(t,e){var n,i,r,s,o,u;return o=0,u=function(){o=new Date,r=null,s=t.apply(n,i)},function(){var a=new Date,c=e-(a-o);return n=this,i=arguments,c<=0?(clearTimeout(r),r=null,o=a,s=t.apply(n,i)):r||(r=setTimeout(u,c)),s}},stringify:function(t){return e.isString(t)?t:JSON.stringify(t)},noop:function(){}}}(),n=function(){"use strict";function t(t){var o,u;return u=e.mixin({},s,t),{css:(o={css:r(),classes:u,html:n(u),selectors:i(u)}).css,html:o.html,classes:o.classes,selectors:o.selectors,mixin:function(t){e.mixin(t,o)}}}function n(t){return{wrapper:'<span class="'+t.wrapper+'"></span>',menu:'<div class="'+t.menu+'"></div>'}}function i(t){var n={};return e.each(t,function(t,e){n[e]="."+t}),n}function r(){var t={wrapper:{position:"relative",display:"inline-block"},hint:{position:"absolute",top:"0",left:"0",borderColor:"transparent",boxShadow:"none",opacity:"1"},input:{position:"relative",verticalAlign:"top",backgroundColor:"transparent"},inputWithNoHint:{position:"relative",verticalAlign:"top"},menu:{position:"absolute",top:"100%",left:"0",zIndex:"100",display:"none"},ltr:{left:"0",right:"auto"},rtl:{left:"auto",right:" 0"}};return e.isMsie()&&e.mixin(t.input,{backgroundImage:"url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)"}),t}var s={wrapper:"twitter-typeahead",input:"tt-input",hint:"tt-hint",menu:"tt-menu",dataset:"tt-dataset",suggestion:"tt-suggestion",selectable:"tt-selectable",empty:"tt-empty",open:"tt-open",cursor:"tt-cursor",highlight:"tt-highlight"};return t}(),i=function(){"use strict";function n(e){e&&e.el||t.error("EventBus initialized without el"),this.$el=t(e.el)}var i,r;return i="typeahead:",r={render:"rendered",cursorchange:"cursorchanged",select:"selected",autocomplete:"autocompleted"},e.mixin(n.prototype,{_trigger:function(e,n){var r;return r=t.Event(i+e),(n=n||[]).unshift(r),this.$el.trigger.apply(this.$el,n),r},before:function(t){var e;return e=[].slice.call(arguments,1),this._trigger("before"+t,e).isDefaultPrevented()},trigger:function(t){var e;this._trigger(t,[].slice.call(arguments,1)),(e=r[t])&&this._trigger(e,[].slice.call(arguments,1))}}),n}(),r=function(){"use strict";function t(t,e,n,i){var r;if(!n)return this;for(e=e.split(a),n=i?u(n,i):n,this._callbacks=this._callbacks||{};r=e.shift();)this._callbacks[r]=this._callbacks[r]||{sync:[],async:[]},this._callbacks[r][t].push(n);return this}function e(e,n,i){return t.call(this,"async",e,n,i)}function n(e,n,i){return t.call(this,"sync",e,n,i)}function i(t){var e;if(!this._callbacks)return this;for(t=t.split(a);e=t.shift();)delete this._callbacks[e];return this}function r(t){var e,n,i,r,o;if(!this._callbacks)return this;for(t=t.split(a),i=[].slice.call(arguments,1);(e=t.shift())&&(n=this._callbacks[e]);)r=s(n.sync,this,[e].concat(i)),o=s(n.async,this,[e].concat(i)),r()&&c(o);return this}function s(t,e,n){function i(){for(var i,r=0,s=t.length;!i&&r<s;r+=1)i=!1===t[r].apply(e,n);return!i}return i}function o(){return window.setImmediate?function(t){setImmediate(function(){t()})}:function(t){setTimeout(function(){t()},0)}}function u(t,e){return t.bind?t.bind(e):function(){t.apply(e,[].slice.call(arguments,0))}}var a=/\s+/,c=o();return{onSync:n,onAsync:e,off:i,trigger:r}}(),s=function(t){"use strict";function n(t,n,i){for(var r,s=[],o=0,u=t.length;o<u;o++)s.push(e.escapeRegExChars(t[o]));return r=i?"\\b("+s.join("|")+")\\b":"("+s.join("|")+")",n?new RegExp(r):new RegExp(r,"i")}var i={node:null,pattern:null,tagName:"strong",className:null,wordsOnly:!1,caseSensitive:!1};return function(r){function s(e){var n,i,s;return(n=u.exec(e.data))&&(s=t.createElement(r.tagName),r.className&&(s.className=r.className),(i=e.splitText(n.index)).splitText(n[0].length),s.appendChild(i.cloneNode(!0)),e.parentNode.replaceChild(s,i)),!!n}function o(t,e){for(var n,i=3,r=0;r<t.childNodes.length;r++)(n=t.childNodes[r]).nodeType===i?r+=e(n)?1:0:o(n,e)}var u;(r=e.mixin({},i,r)).node&&r.pattern&&(r.pattern=e.isArray(r.pattern)?r.pattern:[r.pattern],u=n(r.pattern,r.caseSensitive,r.wordsOnly),o(r.node,s))}}(window.document),o=function(){"use strict";function n(n,r){(n=n||{}).input||t.error("input is missing"),r.mixin(this),this.$hint=t(n.hint),this.$input=t(n.input),this.query=this.$input.val(),this.queryWhenFocused=this.hasFocus()?this.query:null,this.$overflowHelper=i(this.$input),this._checkLanguageDirection(),0===this.$hint.length&&(this.setHint=this.getHint=this.clearHint=this.clearHintIfInvalid=e.noop)}function i(e){return t('<pre aria-hidden="true"></pre>').css({position:"absolute",visibility:"hidden",whiteSpace:"pre",fontFamily:e.css("font-family"),fontSize:e.css("font-size"),fontStyle:e.css("font-style"),fontVariant:e.css("font-variant"),fontWeight:e.css("font-weight"),wordSpacing:e.css("word-spacing"),letterSpacing:e.css("letter-spacing"),textIndent:e.css("text-indent"),textRendering:e.css("text-rendering"),textTransform:e.css("text-transform")}).insertAfter(e)}function s(t,e){return n.normalizeQuery(t)===n.normalizeQuery(e)}function o(t){return t.altKey||t.ctrlKey||t.metaKey||t.shiftKey}var u;return u={9:"tab",27:"esc",37:"left",39:"right",13:"enter",38:"up",40:"down"},n.normalizeQuery=function(t){return e.toStr(t).replace(/^\s*/g,"").replace(/\s{2,}/g," ")},e.mixin(n.prototype,r,{_onBlur:function(){this.resetInputValue(),this.trigger("blurred")},_onFocus:function(){this.queryWhenFocused=this.query,this.trigger("focused")},_onKeydown:function(t){var e=u[t.which||t.keyCode];this._managePreventDefault(e,t),e&&this._shouldTrigger(e,t)&&this.trigger(e+"Keyed",t)},_onInput:function(){this._setQuery(this.getInputValue()),this.clearHintIfInvalid(),this._checkLanguageDirection()},_managePreventDefault:function(t,e){var n;switch(t){case"up":case"down":n=!o(e);break;default:n=!1}n&&e.preventDefault()},_shouldTrigger:function(t,e){var n;switch(t){case"tab":n=!o(e);break;default:n=!0}return n},_checkLanguageDirection:function(){var t=(this.$input.css("direction")||"ltr").toLowerCase();this.dir!==t&&(this.dir=t,this.$hint.attr("dir",t),this.trigger("langDirChanged",t))},_setQuery:function(t,e){var n,i;i=!!(n=s(t,this.query))&&this.query.length!==t.length,this.query=t,e||n?!e&&i&&this.trigger("whitespaceChanged",this.query):this.trigger("queryChanged",this.query)},bind:function(){var t,n,i,r,s=this;return t=e.bind(this._onBlur,this),n=e.bind(this._onFocus,this),i=e.bind(this._onKeydown,this),r=e.bind(this._onInput,this),this.$input.on("blur.tt",t).on("focus.tt",n).on("keydown.tt",i),!e.isMsie()||e.isMsie()>9?this.$input.on("input.tt",r):this.$input.on("keydown.tt keypress.tt cut.tt paste.tt",function(t){u[t.which||t.keyCode]||e.defer(e.bind(s._onInput,s,t))}),this},focus:function(){this.$input.focus()},blur:function(){this.$input.blur()},getLangDir:function(){return this.dir},getQuery:function(){return this.query||""},setQuery:function(t,e){this.setInputValue(t),this._setQuery(t,e)},hasQueryChangedSinceLastFocus:function(){return this.query!==this.queryWhenFocused},getInputValue:function(){return this.$input.val()},setInputValue:function(t){this.$input.val(t),this.clearHintIfInvalid(),this._checkLanguageDirection()},resetInputValue:function(){this.setInputValue(this.query)},getHint:function(){return this.$hint.val()},setHint:function(t){this.$hint.val(t)},clearHint:function(){this.setHint("")},clearHintIfInvalid:function(){var t,e,n;n=(t=this.getInputValue())!==(e=this.getHint())&&0===e.indexOf(t),!(""!==t&&n&&!this.hasOverflow())&&this.clearHint()},hasFocus:function(){return this.$input.is(":focus")},hasOverflow:function(){var t=this.$input.width()-2;return this.$overflowHelper.text(this.getInputValue()),this.$overflowHelper.width()>=t},isCursorAtEnd:function(){var t,n,i;return t=this.$input.val().length,n=this.$input[0].selectionStart,e.isNumber(n)?n===t:!document.selection||((i=document.selection.createRange()).moveStart("character",-t),t===i.text.length)},destroy:function(){this.$hint.off(".tt"),this.$input.off(".tt"),this.$overflowHelper.remove(),this.$hint=this.$input=this.$overflowHelper=t("<div>")}}),n}(),u=function(){"use strict";function n(n,r){(n=n||{}).templates=n.templates||{},n.templates.notFound=n.templates.notFound||n.templates.empty,n.source||t.error("missing source"),n.node||t.error("missing node"),n.name&&!u(n.name)&&t.error("invalid dataset name: "+n.name),r.mixin(this),this.highlight=!!n.highlight,this.name=n.name||c(),this.limit=n.limit||5,this.displayFn=i(n.display||n.displayKey),this.templates=o(n.templates,this.displayFn),this.source=n.source.__ttAdapter?n.source.__ttAdapter():n.source,this.async=e.isUndefined(n.async)?this.source.length>2:!!n.async,this._resetLastSuggestion(),this.$el=t(n.node).addClass(this.classes.dataset).addClass(this.classes.dataset+"-"+this.name)}function i(t){function n(e){return e[t]}return t=t||e.stringify,e.isFunction(t)?t:n}function o(n,i){function r(e){return t("<div>").text(i(e))}return{notFound:n.notFound&&e.templatify(n.notFound),pending:n.pending&&e.templatify(n.pending),header:n.header&&e.templatify(n.header),footer:n.footer&&e.templatify(n.footer),suggestion:n.suggestion||r}}function u(t){return/^[_a-zA-Z0-9-]+$/.test(t)}var a,c;return a={val:"tt-selectable-display",obj:"tt-selectable-object"},c=e.getIdGenerator(),n.extractData=function(e){var n=t(e);return n.data(a.obj)?{val:n.data(a.val)||"",obj:n.data(a.obj)||null}:null},e.mixin(n.prototype,r,{_overwrite:function(t,e){(e=e||[]).length?this._renderSuggestions(t,e):this.async&&this.templates.pending?this._renderPending(t):!this.async&&this.templates.notFound?this._renderNotFound(t):this._empty(),this.trigger("rendered",this.name,e,!1)},_append:function(t,e){(e=e||[]).length&&this.$lastSuggestion.length?this._appendSuggestions(t,e):e.length?this._renderSuggestions(t,e):!this.$lastSuggestion.length&&this.templates.notFound&&this._renderNotFound(t),this.trigger("rendered",this.name,e,!0)},_renderSuggestions:function(t,e){var n;n=this._getSuggestionsFragment(t,e),this.$lastSuggestion=n.children().last(),this.$el.html(n).prepend(this._getHeader(t,e)).append(this._getFooter(t,e))},_appendSuggestions:function(t,e){var n,i;i=(n=this._getSuggestionsFragment(t,e)).children().last(),this.$lastSuggestion.after(n),this.$lastSuggestion=i},_renderPending:function(t){var e=this.templates.pending;this._resetLastSuggestion(),e&&this.$el.html(e({query:t,dataset:this.name}))},_renderNotFound:function(t){var e=this.templates.notFound;this._resetLastSuggestion(),e&&this.$el.html(e({query:t,dataset:this.name}))},_empty:function(){this.$el.empty(),this._resetLastSuggestion()},_getSuggestionsFragment:function(n,i){var r,o=this;return r=document.createDocumentFragment(),e.each(i,function(e){var i,s;s=o._injectQuery(n,e),i=t(o.templates.suggestion(s)).data(a.obj,e).data(a.val,o.displayFn(e)).addClass(o.classes.suggestion+" "+o.classes.selectable),r.appendChild(i[0])}),this.highlight&&s({className:this.classes.highlight,node:r,pattern:n}),t(r)},_getFooter:function(t,e){return this.templates.footer?this.templates.footer({query:t,suggestions:e,dataset:this.name}):null},_getHeader:function(t,e){return this.templates.header?this.templates.header({query:t,suggestions:e,dataset:this.name}):null},_resetLastSuggestion:function(){this.$lastSuggestion=t()},_injectQuery:function(t,n){return e.isObject(n)?e.mixin({_query:t},n):n},update:function(e){function n(t){o||(o=!0,t=(t||[]).slice(0,r.limit),u=t.length,r._overwrite(e,t),u<r.limit&&r.async&&r.trigger("asyncRequested",e))}function i(n){n=n||[],!s&&u<r.limit&&(r.cancel=t.noop,u+=n.length,r._append(e,n.slice(0,r.limit-u)),r.async&&r.trigger("asyncReceived",e))}var r=this,s=!1,o=!1,u=0;this.cancel(),this.cancel=function(){s=!0,r.cancel=t.noop,r.async&&r.trigger("asyncCanceled",e)},this.source(e,n,i),!o&&n([])},cancel:t.noop,clear:function(){this._empty(),this.cancel(),this.trigger("cleared")},isEmpty:function(){return this.$el.is(":empty")},destroy:function(){this.$el=t("<div>")}}),n}(),a=function(){"use strict";function n(n,i){function r(e){var n=s.$node.find(e.node).first();return e.node=n.length?n:t("<div>").appendTo(s.$node),new u(e,i)}var s=this;(n=n||{}).node||t.error("node is required"),i.mixin(this),this.$node=t(n.node),this.query=null,this.datasets=e.map(n.datasets,r)}return e.mixin(n.prototype,r,{_onSelectableClick:function(e){this.trigger("selectableClicked",t(e.currentTarget))},_onRendered:function(t,e,n,i){this.$node.toggleClass(this.classes.empty,this._allDatasetsEmpty()),this.trigger("datasetRendered",e,n,i)},_onCleared:function(){this.$node.toggleClass(this.classes.empty,this._allDatasetsEmpty()),this.trigger("datasetCleared")},_propagate:function(){this.trigger.apply(this,arguments)},_allDatasetsEmpty:function(){function t(t){return t.isEmpty()}return e.every(this.datasets,t)},_getSelectables:function(){return this.$node.find(this.selectors.selectable)},_removeCursor:function(){var t=this.getActiveSelectable();t&&t.removeClass(this.classes.cursor)},_ensureVisible:function(t){var e,n,i,r;n=(e=t.position().top)+t.outerHeight(!0),i=this.$node.scrollTop(),r=this.$node.height()+parseInt(this.$node.css("paddingTop"),10)+parseInt(this.$node.css("paddingBottom"),10),e<0?this.$node.scrollTop(i+e):r<n&&this.$node.scrollTop(i+(n-r))},bind:function(){var t,n=this;return t=e.bind(this._onSelectableClick,this),this.$node.on("click.tt",this.selectors.selectable,t),e.each(this.datasets,function(t){t.onSync("asyncRequested",n._propagate,n).onSync("asyncCanceled",n._propagate,n).onSync("asyncReceived",n._propagate,n).onSync("rendered",n._onRendered,n).onSync("cleared",n._onCleared,n)}),this},isOpen:function(){return this.$node.hasClass(this.classes.open)},open:function(){this.$node.addClass(this.classes.open)},close:function(){this.$node.removeClass(this.classes.open),this._removeCursor()},setLanguageDirection:function(t){this.$node.attr("dir",t)},selectableRelativeToCursor:function(t){var e,n,i;return n=this.getActiveSelectable(),e=this._getSelectables(),-1===(i=(i=((i=(n?e.index(n):-1)+t)+1)%(e.length+1)-1)<-1?e.length-1:i)?null:e.eq(i)},setCursor:function(t){this._removeCursor(),(t=t&&t.first())&&(t.addClass(this.classes.cursor),this._ensureVisible(t))},getSelectableData:function(t){return t&&t.length?u.extractData(t):null},getActiveSelectable:function(){var t=this._getSelectables().filter(this.selectors.cursor).first();return t.length?t:null},getTopSelectable:function(){var t=this._getSelectables().first();return t.length?t:null},update:function(t){function n(e){e.update(t)}var i=t!==this.query;return i&&(this.query=t,e.each(this.datasets,n)),i},empty:function(){function t(t){t.clear()}e.each(this.datasets,t),this.query=null,this.$node.addClass(this.classes.empty)},destroy:function(){function n(t){t.destroy()}this.$node.off(".tt"),this.$node=t("<div>"),e.each(this.datasets,n)}}),n}(),c=function(){"use strict";function t(){a.apply(this,[].slice.call(arguments,0))}var n=a.prototype;return e.mixin(t.prototype,a.prototype,{open:function(){return!this._allDatasetsEmpty()&&this._show(),n.open.apply(this,[].slice.call(arguments,0))},close:function(){return this._hide(),n.close.apply(this,[].slice.call(arguments,0))},_onRendered:function(){return this._allDatasetsEmpty()?this._hide():this.isOpen()&&this._show(),n._onRendered.apply(this,[].slice.call(arguments,0))},_onCleared:function(){return this._allDatasetsEmpty()?this._hide():this.isOpen()&&this._show(),n._onCleared.apply(this,[].slice.call(arguments,0))},setLanguageDirection:function(t){return this.$node.css("ltr"===t?this.css.ltr:this.css.rtl),n.setLanguageDirection.apply(this,[].slice.call(arguments,0))},_hide:function(){this.$node.hide()},_show:function(){this.$node.css("display","block")}}),t}(),h=function(){"use strict";function n(n,r){var s,o,u,a,c,h,l,f,d,p,g;(n=n||{}).input||t.error("missing input"),n.menu||t.error("missing menu"),n.eventBus||t.error("missing event bus"),r.mixin(this),this.eventBus=n.eventBus,this.minLength=e.isNumber(n.minLength)?n.minLength:1,this.input=n.input,this.menu=n.menu,this.enabled=!0,this.active=!1,this.input.hasFocus()&&this.activate(),this.dir=this.input.getLangDir(),this._hacks(),this.menu.bind().onSync("selectableClicked",this._onSelectableClicked,this).onSync("asyncRequested",this._onAsyncRequested,this).onSync("asyncCanceled",this._onAsyncCanceled,this).onSync("asyncReceived",this._onAsyncReceived,this).onSync("datasetRendered",this._onDatasetRendered,this).onSync("datasetCleared",this._onDatasetCleared,this),s=i(this,"activate","open","_onFocused"),o=i(this,"deactivate","_onBlurred"),u=i(this,"isActive","isOpen","_onEnterKeyed"),a=i(this,"isActive","isOpen","_onTabKeyed"),c=i(this,"isActive","_onEscKeyed"),h=i(this,"isActive","open","_onUpKeyed"),l=i(this,"isActive","open","_onDownKeyed"),f=i(this,"isActive","isOpen","_onLeftKeyed"),d=i(this,"isActive","isOpen","_onRightKeyed"),p=i(this,"_openIfActive","_onQueryChanged"),g=i(this,"_openIfActive","_onWhitespaceChanged"),this.input.bind().onSync("focused",s,this).onSync("blurred",o,this).onSync("enterKeyed",u,this).onSync("tabKeyed",a,this).onSync("escKeyed",c,this).onSync("upKeyed",h,this).onSync("downKeyed",l,this).onSync("leftKeyed",f,this).onSync("rightKeyed",d,this).onSync("queryChanged",p,this).onSync("whitespaceChanged",g,this).onSync("langDirChanged",this._onLangDirChanged,this)}function i(t){var n=[].slice.call(arguments,1);return function(){var i=[].slice.call(arguments);e.each(n,function(e){return t[e].apply(t,i)})}}return e.mixin(n.prototype,{_hacks:function(){var n,i;n=this.input.$input||t("<div>"),i=this.menu.$node||t("<div>"),n.on("blur.tt",function(t){var r,s,o;r=document.activeElement,s=i.is(r),o=i.has(r).length>0,e.isMsie()&&(s||o)&&(t.preventDefault(),t.stopImmediatePropagation(),e.defer(function(){n.focus()}))}),i.on("mousedown.tt",function(t){t.preventDefault()})},_onSelectableClicked:function(t,e){this.select(e)},_onDatasetCleared:function(){this._updateHint()},_onDatasetRendered:function(t,e,n,i){this._updateHint(),this.eventBus.trigger("render",n,i,e)},_onAsyncRequested:function(t,e,n){this.eventBus.trigger("asyncrequest",n,e)},_onAsyncCanceled:function(t,e,n){this.eventBus.trigger("asynccancel",n,e)},_onAsyncReceived:function(t,e,n){this.eventBus.trigger("asyncreceive",n,e)},_onFocused:function(){this._minLengthMet()&&this.menu.update(this.input.getQuery())},_onBlurred:function(){
63
+ this.input.hasQueryChangedSinceLastFocus()&&this.eventBus.trigger("change",this.input.getQuery())},_onEnterKeyed:function(t,e){var n;(n=this.menu.getActiveSelectable())&&this.select(n)&&e.preventDefault()},_onTabKeyed:function(t,e){var n;(n=this.menu.getActiveSelectable())?this.select(n)&&e.preventDefault():(n=this.menu.getTopSelectable())&&this.autocomplete(n)&&e.preventDefault()},_onEscKeyed:function(){this.close()},_onUpKeyed:function(){this.moveCursor(-1)},_onDownKeyed:function(){this.moveCursor(1)},_onLeftKeyed:function(){"rtl"===this.dir&&this.input.isCursorAtEnd()&&this.autocomplete(this.menu.getTopSelectable())},_onRightKeyed:function(){"ltr"===this.dir&&this.input.isCursorAtEnd()&&this.autocomplete(this.menu.getTopSelectable())},_onQueryChanged:function(t,e){this._minLengthMet(e)?this.menu.update(e):this.menu.empty()},_onWhitespaceChanged:function(){this._updateHint()},_onLangDirChanged:function(t,e){this.dir!==e&&(this.dir=e,this.menu.setLanguageDirection(e))},_openIfActive:function(){this.isActive()&&this.open()},_minLengthMet:function(t){return(t=e.isString(t)?t:this.input.getQuery()||"").length>=this.minLength},_updateHint:function(){var t,n,i,r,s,u;t=this.menu.getTopSelectable(),n=this.menu.getSelectableData(t),i=this.input.getInputValue(),!n||e.isBlankString(i)||this.input.hasOverflow()?this.input.clearHint():(r=o.normalizeQuery(i),s=e.escapeRegExChars(r),(u=new RegExp("^(?:"+s+")(.+$)","i").exec(n.val))&&this.input.setHint(i+u[1]))},isEnabled:function(){return this.enabled},enable:function(){this.enabled=!0},disable:function(){this.enabled=!1},isActive:function(){return this.active},activate:function(){return!!this.isActive()||!(!this.isEnabled()||this.eventBus.before("active"))&&(this.active=!0,this.eventBus.trigger("active"),!0)},deactivate:function(){return!this.isActive()||!this.eventBus.before("idle")&&(this.active=!1,this.close(),this.eventBus.trigger("idle"),!0)},isOpen:function(){return this.menu.isOpen()},open:function(){return this.isOpen()||this.eventBus.before("open")||(this.menu.open(),this._updateHint(),this.eventBus.trigger("open")),this.isOpen()},close:function(){return this.isOpen()&&!this.eventBus.before("close")&&(this.menu.close(),this.input.clearHint(),this.input.resetInputValue(),this.eventBus.trigger("close")),!this.isOpen()},setVal:function(t){this.input.setQuery(e.toStr(t))},getVal:function(){return this.input.getQuery()},select:function(t){var e=this.menu.getSelectableData(t);return!(!e||this.eventBus.before("select",e.obj))&&(this.input.setQuery(e.val,!0),this.eventBus.trigger("select",e.obj),this.close(),!0)},autocomplete:function(t){var e,n;return e=this.input.getQuery(),!(!((n=this.menu.getSelectableData(t))&&e!==n.val)||this.eventBus.before("autocomplete",n.obj))&&(this.input.setQuery(n.val),this.eventBus.trigger("autocomplete",n.obj),!0)},moveCursor:function(t){var e,n,i,r;return e=this.input.getQuery(),n=this.menu.selectableRelativeToCursor(t),r=(i=this.menu.getSelectableData(n))?i.obj:null,!(this._minLengthMet()&&this.menu.update(e))&&!this.eventBus.before("cursorchange",r)&&(this.menu.setCursor(n),i?this.input.setInputValue(i.val):(this.input.resetInputValue(),this._updateHint()),this.eventBus.trigger("cursorchange",r),!0)},destroy:function(){this.input.destroy(),this.menu.destroy()}}),n}();!function(){"use strict";function r(e,n){e.each(function(){var e,i=t(this);(e=i.data(g.typeahead))&&n(e,i)})}function s(t,e){return t.clone().addClass(e.classes.hint).removeData().css(e.css.hint).css(l(t)).prop("readonly",!0).removeAttr("id name placeholder required").attr({autocomplete:"off",spellcheck:"false",tabindex:-1})}function u(t,e){t.data(g.attrs,{dir:t.attr("dir"),autocomplete:t.attr("autocomplete"),spellcheck:t.attr("spellcheck"),style:t.attr("style")}),t.addClass(e.classes.input).attr({autocomplete:"off",spellcheck:!1});try{!t.attr("dir")&&t.attr("dir","auto")}catch(n){}return t}function l(t){return{backgroundAttachment:t.css("background-attachment"),backgroundClip:t.css("background-clip"),backgroundColor:t.css("background-color"),backgroundImage:t.css("background-image"),backgroundOrigin:t.css("background-origin"),backgroundPosition:t.css("background-position"),backgroundRepeat:t.css("background-repeat"),backgroundSize:t.css("background-size")}}function f(t){var n,i;n=t.data(g.www),i=t.parent().filter(n.selectors.wrapper),e.each(t.data(g.attrs),function(n,i){e.isUndefined(n)?t.removeAttr(i):t.attr(i,n)}),t.removeData(g.typeahead).removeData(g.www).removeData(g.attr).removeClass(n.classes.input),i.length&&(t.detach().insertAfter(i),i.remove())}function d(n){var i;return(i=e.isJQuery(n)||e.isElement(n)?t(n).first():[]).length?i:null}var p,g,m;p=t.fn.typeahead,g={www:"tt-www",attrs:"tt-attrs",typeahead:"tt-typeahead"},m={initialize:function(r,l){function f(){var n,f,m,y,v,_,b,w,S,x,A;e.each(l,function(t){t.highlight=!!r.highlight}),n=t(this),f=t(p.html.wrapper),m=d(r.hint),y=d(r.menu),v=!1!==r.hint&&!m,_=!1!==r.menu&&!y,v&&(m=s(n,p)),_&&(y=t(p.html.menu).css(p.css.menu)),m&&m.val(""),n=u(n,p),(v||_)&&(f.css(p.css.wrapper),n.css(v?p.css.input:p.css.inputWithNoHint),n.wrap(f).parent().prepend(v?m:null).append(_?y:null)),A=_?c:a,b=new i({el:n}),w=new o({hint:m,input:n},p),S=new A({node:y,datasets:l},p),x=new h({input:w,menu:S,eventBus:b,minLength:r.minLength},p),n.data(g.www,p),n.data(g.typeahead,x)}var p;return l=e.isArray(l)?l:[].slice.call(arguments,1),p=n((r=r||{}).classNames),this.each(f)},isEnabled:function(){var t;return r(this.first(),function(e){t=e.isEnabled()}),t},enable:function(){return r(this,function(t){t.enable()}),this},disable:function(){return r(this,function(t){t.disable()}),this},isActive:function(){var t;return r(this.first(),function(e){t=e.isActive()}),t},activate:function(){return r(this,function(t){t.activate()}),this},deactivate:function(){return r(this,function(t){t.deactivate()}),this},isOpen:function(){var t;return r(this.first(),function(e){t=e.isOpen()}),t},open:function(){return r(this,function(t){t.open()}),this},close:function(){return r(this,function(t){t.close()}),this},select:function(e){var n=!1,i=t(e);return r(this.first(),function(t){n=t.select(i)}),n},autocomplete:function(e){var n=!1,i=t(e);return r(this.first(),function(t){n=t.autocomplete(i)}),n},moveCursor:function(t){var e=!1;return r(this.first(),function(n){e=n.moveCursor(t)}),e},val:function(t){var e;return arguments.length?(r(this,function(e){e.setVal(t)}),this):(r(this.first(),function(t){e=t.getVal()}),e)},destroy:function(){return r(this,function(t,e){f(e),t.destroy()}),this}},t.fn.typeahead=function(t){return m[t]?m[t].apply(this,[].slice.call(arguments,1)):m.initialize.apply(this,arguments)},t.fn.typeahead.noConflict=function(){return t.fn.typeahead=p,this}}()});
64
+ /**
65
+ * Sixfish Javascript
66
+ * $Id$
67
+ *
68
+ * @author Michael Granger <ged@FaerieMUD.org>
69
+ *
70
+ * Copyright © 2012-2015, Michael Granger
71
+ * All rights reserved.
72
+ *
73
+ * Redistribution and use in source and binary forms, with or without
74
+ * modification, are permitted provided that the following conditions are met:
75
+ *
76
+ * * Redistributions of source code must retain the above copyright notice,
77
+ * this list of conditions and the following disclaimer.
78
+ *
79
+ * * Redistributions in binary form must reproduce the above copyright notice,
80
+ * this list of conditions and the following disclaimer in the documentation
81
+ * and/or other materials provided with the distribution.
82
+ *
83
+ * * Neither the name of the author/s, nor the names of the project's
84
+ * contributors may be used to endorse or promote products derived from this
85
+ * software without specific prior written permission.
86
+ *
87
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
88
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
89
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
90
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
91
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
92
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
93
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
94
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
95
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
96
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
97
+ *
98
+ */
99
+ function initSixfish(){console.debug("Loaded. Waiting for DOM to be ready."),$(document).ready(onReady)}function hookTooltips(){$('h1[data-tooltip!=""]').qtip({content:{attr:"data-tooltip",title:function(){return console.debug("Tooltip context is: %o",this),$(this).attr("title")}},position:{my:"left center",at:"right center",target:$("h1 span.name")},style:{classes:"qtip-youtube",tip:{corner:!0}}})}function hookSourceToggles(){$("div.method header i").click(function(e){var n=e.target,t=$(n).parents("div").get(0),a=$(t).find("div.method-source-code");console.debug("Toggling: %o",a),a.fadeToggle()})}function makeRankingTerm(e){return e.name.replace(/.*::/,"").toLowerCase()}function matchIndexItem(e){var n=this.query;return makeRankingTerm(e).score(n,RankFuzziness)>=MatchThreshold}function sortIndexItems(e){var n=this.query;return e.sort(function(e,t){var a=makeRankingTerm(e),o=makeRankingTerm(t),i=a.score(n,RankFuzziness),s=o.score(n,RankFuzziness);return i>s?-1:i<s?1:0})}function pickItemIcon(e){var n;switch(e.type){case"anymethod":case"metamethod":n="plus-sign";break;case"normalmodule":n="gift";break;case"normalclass":n="briefcase";break;case"toplevel":n="file";break;default:n="question-sign"}return n}function highlightMatchingItem(e){var n=e.snippet.replace(/<\/?p>/g,"").replace(/\.(.|\n)*/,"."),t=pickItemIcon(e),a=makeRankingTerm(e).score(this.query,RankFuzziness),o='<span class="search-item"><i class="icon-'+t+'"></i><span class="search-item-name">'+e.name+'</span><span class="search-item-rank">'+(10*a).toFixed()+'</span><br /><span class="search-item-snippet">'+n+"</span></span>",i=$(o);return i.data("searchitem",e),i}function updateSearchInput(e){var n=this.$menu.find(".active .search-item").data("searchitem");return console.debug("Updating search element for item %s",e),$("#navbar-search-target").val(n.link),n.name}function hookSearchForm(){$("#search-input").typeahead({minlength:3,highlight:!0},{name:"rdoc-index",source:searchEngine})}function onSearchKey(){console.debug("Search key: would focus the search blank.")}function onReady(){console.debug("Ready!"),hookTooltips(),hookSourceToggles(),$(document).bind("keydown","ctrl+/",onSearchKey)}const MatchThreshold=.5,RankFuzziness=.5;