/*! jquery-textcomplete - v0.4.0 - 2015-03-10 */if("undefined"==typeofjQuery)thrownewError("jQuery.textcomplete requires jQuery");+function(a){"use strict";varb=function(a){console.warn&&console.warn(a)};a.fn.textcomplete=function(c,d){vare=Array.prototype.slice.call(arguments);returnthis.each(function(){varf=a(this),g=f.data("textComplete");if(g||(g=newa.fn.textcomplete.Completer(this,d||{}),f.data("textComplete",g)),"string"==typeofc){if(!g)return;e.shift(),g[c].apply(g,e),"destroy"===c&&f.removeData("textComplete")}elsea.each(c,function(c){a.each(["header","footer","placement","maxCount"],function(a){c[a]&&(g.option[a]=c[a],b(a+"as a strategy param is deprecated. Use option."),deletec[a])})}),g.register(a.fn.textcomplete.Strategy.parse(c))})}}(jQuery),+function(a){"use strict";functionb(c,d){if(this.$el=a(c),this.id="textcomplete"+f++,this.strategies=[],this.views=[],this.option=a.extend({},b._getDefaults(),d),!this.$el.is("input[type=text]")&&!this.$el.is("textarea")&&!c.isContentEditable&&"true"!=c.contentEditable)thrownewError("textcomplete must be called on a Textarea or a ContentEditable.");if(c===document.activeElement)this.initialize();else{vare=this;this.$el.one("focus."+this.id,function(){e.initialize()})}}varc=function(a){varb,c;returnfunction(){vard=Array.prototype.slice.call(arguments);if(b)returnc=d,void0;b=!0;vare=this;d.unshift(functionf(){if(c){vard=c;c=void0,d.unshift(f),a.apply(e,d)}elseb=!1}),a.apply(this,d)}},d=function(a){return"[object String]"===Object.prototype.toString.call(a)},e=function(a){return"[object Function]"===Object.prototype.toString.call(a)},f=0;b._getDefaults=function(){returnb.DEFAULTS||(b.DEFAULTS={appendTo:a("body"),zIndex:"100"}),b.DEFAULTS},a.extend(b.prototype,{id:null,option:null,strategies:null,adapter:null,dropdown:null,$el:null,initialize:function(){varb=this.$el.get(0);this.dropdown=newa.fn.textcomplete.Dropdown(b,this,this.option);varc,d;this.option.adapter?c=this.option.adapter:(d=this.$el.is("textarea")||this.$el.is("input[type=text]")?"number"==typeofb.selectionEnd?"Textarea":"IETextarea":"ContentEditable",c=a.fn.textcomplete[d]),this.adapter=newc(b,this,this.option)},destroy:function(){this.$el.off("."+this.id),this.adapter&&this.adapter.destroy(),this.dropdown&&this.dropdown.destroy(),this.$el=this.adapter=this.dropdown=null},trigger:function(a,b){this.dropdown||this.initialize(),null!=a||(a=this.adapter.getTextFromHeadToCaret());varc=this._extractSearchQuery(a);if(c.length){vard=c[1];if(b&&this._term===d)return;this._term=d,this._search.apply(this,c)}elsethis._term=null,this.dropdown.deactivate()},fire:function(a){varb=Array.prototype.slice.call(arguments,1);returnthis.$el.trigger(a,b),this},register:function(a){Array.prototype.push.apply(this.strategies,a)},select:function(a,b){this.adapter.select(a,b),this.fire("change").fire("textComplete:select",a,b),this.adapter.focus()},_clearAtNext:!0,_term:null,_extractSearchQuery:function(a){for(varb=0;b<this.strategies.length;b++){varc=this.strategies[b],f=c.context(a);if(f||""===f){varg=e(c.match)?c.match(a):c.match;d(f)&&(a=f);varh=a.match(g);if(h)return[c,h[c.index],h]}}return[]},_search:c(function(a,b,c,d){vare=this;b.search(c,function(c,d){e.dropdown.shown||(e.dropdown.activate(),e.dropdown.setPosition(e.adapter.getCaretPosition())),e._clearAtNext&&(e.dropdown.clear(),e._clearAtNext=!1),e.dropdown.render(e._zip(c,b)),d||(a(),e._clearAtNext=!0)},d)}),_zip:function(b,c){returna.map(b,function(a){return{value:a,strategy:c}})}}),a.fn.textcomplete.Completer=b}(jQuery),+function(a){"use strict";functionb(c,e,f){this.$el=b.findOrCreateElement(f),this.completer=e,this.id=e.id+"dropdown",this._data=[],this.$inputEl=a(c),this.option=f,f.listPosition&&(this.setPosition=f.listPosition),f.height&&this.$el.height(f.height);varg=this;a.each(["maxCount","placement","footer","header","className"],function(a,b){null!=f[b]&&(g[b]=f[b])}),this._bindEvents(c),d[this.id]=this}varc=function(a,b){varc,d,e=b.strategy.idProperty;for(c=0;c<a.length;c++)if(d=a[c],d.strategy===b.strategy)if(e){if