+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.tooltip"),f="object"==typeof b&&b;!e&&/destroy|hide/.test(b)||(e||d.data("bs.tooltip",e=new c(this,f)),"string"==typeof b&&e[b]())})}var c=function(a,b){this.type=null,this.options=null,this.enabled=null,this.timeout=null,this.hoverstate=null,this.$element=null,this.instate=null,this.init("tooltip",a,b)};c.version="3.3.5",c.transition_duration=150,c.defaults={animation:!0,placement:"top",selector:!1,template:'',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0}},c.prototype.init=function(b,c,d){if(this.enabled=!0,this.type=b,this.$element=a(c),this.options=this.getoptions(d),this.$viewport=this.options.viewport&&a(a.isfunction(this.options.viewport)?this.options.viewport.call(this,this.$element):this.options.viewport.selector||this.options.viewport),this.instate={click:!1,hover:!1,focus:!1},this.$element[0]instanceof document.constructor&&!this.options.selector)throw new error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");for(var e=this.options.trigger.split(" "),f=e.length;f--;){var g=e[f];if("click"==g)this.$element.on("click."+this.type,this.options.selector,a.proxy(this.toggle,this));else if("manual"!=g){var h="hover"==g?"mouseenter":"focusin",i="hover"==g?"mouseleave":"focusout";this.$element.on(h+"."+this.type,this.options.selector,a.proxy(this.enter,this)),this.$element.on(i+"."+this.type,this.options.selector,a.proxy(this.leave,this))}}this.options.selector?this._options=a.extend({},this.options,{trigger:"manual",selector:""}):this.fixtitle()},c.prototype.getdefaults=function(){return c.defaults},c.prototype.getoptions=function(b){return b=a.extend({},this.getdefaults(),this.$element.data(),b),b.delay&&"number"==typeof b.delay&&(b.delay={show:b.delay,hide:b.delay}),b},c.prototype.getdelegateoptions=function(){var b={},c=this.getdefaults();return this._options&&a.each(this._options,function(a,d){c[a]!=d&&(b[a]=d)}),b},c.prototype.enter=function(b){var c=b instanceof this.constructor?b:a(b.currenttarget).data("bs."+this.type);return c||(c=new this.constructor(b.currenttarget,this.getdelegateoptions()),a(b.currenttarget).data("bs."+this.type,c)),b instanceof a.event&&(c.instate["focusin"==b.type?"focus":"hover"]=!0),c.tip().hasclass("in")||"in"==c.hoverstate?void(c.hoverstate="in"):(cleartimeout(c.timeout),c.hoverstate="in",c.options.delay&&c.options.delay.show?void(c.timeout=settimeout(function(){"in"==c.hoverstate&&c.show()},c.options.delay.show)):c.show())},c.prototype.isinstatetrue=function(){for(var a in this.instate)if(this.instate[a])return!0;return!1},c.prototype.leave=function(b){var c=b instanceof this.constructor?b:a(b.currenttarget).data("bs."+this.type);if(c||(c=new this.constructor(b.currenttarget,this.getdelegateoptions()),a(b.currenttarget).data("bs."+this.type,c)),b instanceof a.event&&(c.instate["focusout"==b.type?"focus":"hover"]=!1),!c.isinstatetrue()){if(cleartimeout(c.timeout),c.hoverstate="out",!c.options.delay||!c.options.delay.hide)return c.hide();c.timeout=settimeout(function(){"out"==c.hoverstate&&c.hide()},c.options.delay.hide)}},c.prototype.show=function(){var b=a.event("show.bs."+this.type);if(this.hascontent()&&this.enabled){this.$element.trigger(b);var d=a.contains(this.$element[0].ownerdocument.documentelement,this.$element[0]);if(b.isdefaultprevented()||!d)return;var e=this,f=this.tip(),g=this.getuid(this.type);this.setcontent(),f.attr("id",g),this.$element.attr("aria-describedby",g),this.options.animation&&f.addclass("fade");var h="function"==typeof this.options.placement?this.options.placement.call(this,f[0],this.$element[0]):this.options.placement,i=/\s?auto?\s?/i,j=i.test(h);j&&(h=h.replace(i,"")||"top"),f.detach().css({top:0,left:0,display:"block"}).addclass(h).data("bs."+this.type,this).addclass(this.$element.data("class")),this.options.container?f.appendto(this.options.container):f.insertafter(this.$element),this.$element.trigger("inserted.bs."+this.type);var k=this.getposition(),l=f[0].offsetwidth,m=f[0].offsetheight;if(j){var n=h,o=this.getposition(this.$viewport);h="bottom"==h&&k.bottom+m>o.bottom?"top":"top"==h&&k.top-mo.width?"left":"left"==h&&k.left-lg.top+g.height&&(e.top=g.top+g.height-i)}else{var j=b.left-f,k=b.left+f+c;jg.right&&(e.left=g.left+g.width-k)}return e},c.prototype.gettitle=function(){var a=this.$element,b=this.options;return a.attr("data-original-title")||("function"==typeof b.title?b.title.call(a[0]):b.title)},c.prototype.getuid=function(a){do{a+=~~(1e6*math.random())}while(document.getelementbyid(a));return a},c.prototype.tip=function(){if(!this.$tip&&(this.$tip=a(this.options.template),1!=this.$tip.length))throw new error(this.type+" `template` option must consist of exactly 1 top-level element!");return this.$tip},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},c.prototype.enable=function(){this.enabled=!0},c.prototype.disable=function(){this.enabled=!1},c.prototype.toggleenabled=function(){this.enabled=!this.enabled},c.prototype.toggle=function(b){var c=this;b&&((c=a(b.currenttarget).data("bs."+this.type))||(c=new this.constructor(b.currenttarget,this.getdelegateoptions()),a(b.currenttarget).data("bs."+this.type,c))),b?(c.instate.click=!c.instate.click,c.isinstatetrue()?c.enter(c):c.leave(c)):c.tip().hasclass("in")?c.leave(c):c.enter(c)},c.prototype.destroy=function(){var a=this;cleartimeout(this.timeout),this.hide(function(){a.$element.off("."+a.type).removedata("bs."+a.type),a.$tip&&a.$tip.detach(),a.$tip=null,a.$arrow=null,a.$viewport=null})};var d=a.fn.tooltip;a.fn.tooltip=b,a.fn.tooltip.constructor=c,a.fn.tooltip.noconflict=function(){return a.fn.tooltip=d,this}}(jquery);