if("undefined"==typeof jquery)throw new error("bootstrap's javascript requires jquery");+function(a){"use strict";var b=a.fn.jquery.split(" ")[0].split(".");}(jquery),+function(a){"use strict";function b(){var a=document.createelement("bootstrap"),b={webkittransition:"webkittransitionend",moztransition:"transitionend",otransition:"otransitionend otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]};return!1}a.fn.emulatetransitionend=function(b){var c=!1,d=this;a(this).one("bstransitionend",function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return settimeout(e,b),this},a(function(){a.support.transition=b(),a.support.transition&&(a.event.special.bstransitionend={bindtype:a.support.transition.end,delegatetype:a.support.transition.end,handle:function(b){if(a(b.target).is(this))return b.handleobj.handler.apply(this,arguments)}})})}(jquery),+function(a){"use strict";function b(b){return this.each(function(){var c=a(this),e=c.data("bs.alert");e||c.data("bs.alert",e=new d(this)),"string"==typeof b&&e[b].call(c)})}var c='[data-dismiss="alert"]',d=function(b){a(b).on("click",c,this.close)};d.version="3.3.7",d.transition_duration=150,d.prototype.close=function(b){function c(){g.detach().trigger("closed.bs.alert").remove()}var e=a(this),f=e.attr("data-target");f||(f=e.attr("href"),f=f&&f.replace(/.*(?=#[^\s]*$)/,""));var g=a("#"===f?[]:f);b&&b.preventdefault(),g.length||(g=e.closest(".alert")),g.trigger(b=a.event("close.bs.alert")),b.isdefaultprevented()||(g.removeclass("in"),a.support.transition&&g.hasclass("fade")?g.one("bstransitionend",c).emulatetransitionend(d.transition_duration):c())};var e=a.fn.alert;a.fn.alert=b,a.fn.alert.constructor=d,a.fn.alert.noconflict=function(){return a.fn.alert=e,this},a(document).on("click.bs.alert.data-api",c,d.prototype.close)}(jquery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.button"),f="object"==typeof b&&b;e||d.data("bs.button",e=new c(this,f)),"toggle"==b?e.toggle():b&&e.setstate(b)})}var c=function(b,d){this.$element=a(b),this.options=a.extend({},c.defaults,d),this.isloading=!1};c.version="3.3.7",c.defaults={loadingtext:"loading..."},c.prototype.setstate=function(b){var c="disabled",d=this.$element,e=d.is("input")?"val":"html",f=d.data();b+="text",null==f.resettext&&d.data("resettext",d[e]()),settimeout(a.proxy(function(){d[e](null==f[b]?this.options[b]:f[b]),"loadingtext"==b?(this.isloading=!0,d.addclass(c).attr(c,c).prop(c,!0)):this.isloading&&(this.isloading=!1,d.removeclass(c).removeattr(c).prop(c,!1))},this),0)},c.prototype.toggle=function(){var a=!0,b=this.$element.closest('[data-toggle="buttons"]');if(b.length){var c=this.$element.find("input");"radio"==c.prop("type")?(c.prop("checked")&&(a=!1),b.find(".active").removeclass("active"),this.$element.addclass("active")):"checkbox"==c.prop("type")&&(c.prop("checked")!==this.$element.hasclass("active")&&(a=!1),this.$element.toggleclass("active")),c.prop("checked",this.$element.hasclass("active")),a&&c.trigger("change")}else this.$element.attr("aria-pressed",!this.$element.hasclass("active")),this.$element.toggleclass("active")};var d=a.fn.button;a.fn.button=b,a.fn.button.constructor=c,a.fn.button.noconflict=function(){return a.fn.button=d,this},a(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(c){var d=a(c.target).closest(".btn");b.call(d,"toggle"),a(c.target).is('input[type="radio"], input[type="checkbox"]')||(c.preventdefault(),d.is("input,button")?d.trigger("focus"):d.find("input:visible,button:visible").first().trigger("focus"))}).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',function(b){a(b.target).closest(".btn").toggleclass("focus",/^focus(in)?$/.test(b.type))})}(jquery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.carousel"),f=a.extend({},c.defaults,d.data(),"object"==typeof b&&b),g="string"==typeof b?b:f.slide;e||d.data("bs.carousel",e=new c(this,f)),"number"==typeof b?e.to(b):g?e[g]():f.interval&&e.pause().cycle()})}var c=function(b,c){this.$element=a(b),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,this.paused=null,this.sliding=null,this.interval=null,this.$active=null,this.$items=null,this.options.keyboard&&this.$element.on("keydown.bs.carousel",a.proxy(this.keydown,this)),"hover"==this.options.pause&&!("ontouchstart"in document.documentelement)&&this.$element.on("mouseenter.bs.carousel",a.proxy(this.pause,this)).on("mouseleave.bs.carousel",a.proxy(this.cycle,this))};c.version="3.3.7",c.transition_duration=600,c.defaults={interval:5e3,pause:"hover",wrap:!0,keyboard:!0},c.prototype.keydown=function(a){if(!/input|textarea/i.test(a.target.tagname)){switch(a.which){case 37:this.prev();break;case 39:this.next();break;default:return}a.preventdefault()}},c.prototype.cycle=function(b){return b||(this.paused=!1),this.interval&&clearinterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setinterval(a.proxy(this.next,this),this.options.interval)),this},c.prototype.getitemindex=function(a){return this.$items=a.parent().children(".item"),this.$items.index(a||this.$active)},c.prototype.getitemfordirection=function(a,b){var c=this.getitemindex(b),d="prev"==a&&0===c||"next"==a&&c==this.$items.length-1;if(d&&!this.options.wrap)return b;var e="prev"==a?-1:1,f=(c+e)%this.$items.length;return this.$items.eq(f)},c.prototype.to=function(a){var b=this,c=this.getitemindex(this.$active=this.$element.find(".item.active"));if(!(a>this.$items.length-1||a<0))return this.sliding?this.$element.one("slid.bs.carousel",function(){b.to(a)}):c==a?this.pause().cycle():this.slide(a>c?"next":"prev",this.$items.eq(a))},c.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearinterval(this.interval),this},c.prototype.next=function(){if(!this.sliding)return this.slide("next")},c.prototype.prev=function(){if(!this.sliding)return this.slide("prev")},c.prototype.slide=function(b,d){var e=this.$element.find(".item.active"),f=d||this.getitemfordirection(b,e),g=this.interval,h="next"==b?"left":"right",i=this;if(f.hasclass("active"))return this.sliding=!1;var j=f[0],k=a.event("slide.bs.carousel",{relatedtarget:j,direction:h});if(this.$element.trigger(k),!k.isdefaultprevented()){if(this.sliding=!0,g&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeclass("active");var l=a(this.$indicators.children()[this.getitemindex(f)]);l&&l.addclass("active")}var m=a.event("slid.bs.carousel",{relatedtarget:j,direction:h});return a.support.transition&&this.$element.hasclass("slide")?(f.addclass(b),f[0].offsetwidth,e.addclass(h),f.addclass(h),e.one("bstransitionend",function(){f.removeclass([b,h].join(" ")).addclass("active"),e.removeclass(["active",h].join(" ")),i.sliding=!1,settimeout(function(){i.$element.trigger(m)},0)}).emulatetransitionend(c.transition_duration)):(e.removeclass("active"),f.addclass("active"),this.sliding=!1,this.$element.trigger(m)),g&&this.cycle(),this}};var d=a.fn.carousel;a.fn.carousel=b,a.fn.carousel.constructor=c,a.fn.carousel.noconflict=function(){return a.fn.carousel=d,this};var e=function(c){var d,e=a(this),f=a(e.attr("data-target")||(d=e.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,""));if(f.hasclass("carousel")){var g=a.extend({},f.data(),e.data()),h=e.attr("data-slide-to");h&&(g.interval=!1),b.call(f,g),h&&f.data("bs.carousel").to(h),c.preventdefault()}};a(document).on("click.bs.carousel.data-api","[data-slide]",e).on("click.bs.carousel.data-api","[data-slide-to]",e),a(window).on("load",function(){a('[data-ride="carousel"]').each(function(){var c=a(this);b.call(c,c.data())})})}(jquery),+function(a){"use strict";function b(b){var c,d=b.attr("data-target")||(c=b.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,"");return a(d)}function c(b){return this.each(function(){var c=a(this),e=c.data("bs.collapse"),f=a.extend({},d.defaults,c.data(),"object"==typeof b&&b);!e&&f.toggle&&/show|hide/.test(b)&&(f.toggle=!1),e||c.data("bs.collapse",e=new d(this,f)),"string"==typeof b&&e[b]()})}var d=function(b,c){this.$element=a(b),this.options=a.extend({},d.defaults,c),this.$trigger=a('[data-toggle="collapse"][href="#'+b.id+'"],[data-toggle="collapse"][data-target="#'+b.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getparent():this.addariaandcollapsedclass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};d.version="3.3.7",d.transition_duration=350,d.defaults={toggle:!0},d.prototype.dimension=function(){var a=this.$element.hasclass("width");return a?"width":"height"},d.prototype.show=function(){if(!this.transitioning&&!this.$element.hasclass("in")){var b,e=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(!(e&&e.length&&(b=e.data("bs.collapse"),b&&b.transitioning))){var f=a.event("show.bs.collapse");if(this.$element.trigger(f),!f.isdefaultprevented()){e&&e.length&&(c.call(e,"hide"),b||e.data("bs.collapse",null));var g=this.dimension();this.$element.removeclass("collapse").addclass("collapsing")[g](0).attr("aria-expanded",!0),this.$trigger.removeclass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var h=function(){this.$element.removeclass("collapsing").addclass("collapse in")[g](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return h.call(this);var i=a.camelcase(["scroll",g].join("-"));this.$element.one("bstransitionend",a.proxy(h,this)).emulatetransitionend(d.transition_duration)[g](this.$element[0][i])}}}},d.prototype.hide=function(){if(!this.transitioning&&this.$element.hasclass("in")){var b=a.event("hide.bs.collapse");if(this.$element.trigger(b),!b.isdefaultprevented()){var c=this.dimension();this.$element[c](this.$element[c]())[0].offsetheight,this.$element.addclass("collapsing").removeclass("collapse in").attr("aria-expanded",!1),this.$trigger.addclass("collapsed").attr("aria-expanded",!1),this.transitioning=1;var e=function(){this.transitioning=0,this.$element.removeclass("collapsing").addclass("collapse").trigger("hidden.bs.collapse")};return a.support.transition?void this.$element[c](0).one("bstransitionend",a.proxy(e,this)).emulatetransitionend(d.transition_duration):e.call(this)}}},d.prototype.toggle=function(){this[this.$element.hasclass("in")?"hide":"show"]()},d.prototype.getparent=function(){return a(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(a.proxy(function(c,d){var e=a(d);this.addariaandcollapsedclass(b(e),e)},this)).end()},d.prototype.addariaandcollapsedclass=function(a,b){var c=a.hasclass("in");a.attr("aria-expanded",c),b.toggleclass("collapsed",!c).attr("aria-expanded",c)};var e=a.fn.collapse;a.fn.collapse=c,a.fn.collapse.constructor=d,a.fn.collapse.noconflict=function(){return a.fn.collapse=e,this},a(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(d){var e=a(this);e.attr("data-target")||d.preventdefault();var f=b(e),g=f.data("bs.collapse"),h=g?"toggle":e.data();c.call(f,h)})}(jquery),+function(a){"use strict";function b(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#[a-za-z]/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}function c(c){c&&3===c.which||(a(e).remove(),a(f).each(function(){var d=a(this),e=b(d),f={relatedtarget:this};e.hasclass("open")&&(c&&"click"==c.type&&/input|textarea/i.test(c.target.tagname)&&a.contains(e[0],c.target)||(e.trigger(c=a.event("hide.bs.dropdown",f)),c.isdefaultprevented()||(d.attr("aria-expanded","false"),e.removeclass("open").trigger(a.event("hidden.bs.dropdown",f)))))}))}function d(b){return this.each(function(){var c=a(this),d=c.data("bs.dropdown");d||c.data("bs.dropdown",d=new g(this)),"string"==typeof b&&d[b].call(c)})}var e=".dropdown-backdrop",f='[data-toggle="dropdown"]',g=function(b){a(b).on("click.bs.dropdown",this.toggle)};g.version="3.3.7",g.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=b(e),g=f.hasclass("open");if(c(),!g){"ontouchstart"in document.documentelement&&!f.closest(".navbar-nav").length&&a(document.createelement("div")).addclass("dropdown-backdrop").insertafter(a(this)).on("click",c);var h={relatedtarget:this};if(f.trigger(d=a.event("show.bs.dropdown",h)),d.isdefaultprevented())return;e.trigger("focus").attr("aria-expanded","true"),f.toggleclass("open").trigger(a.event("shown.bs.dropdown",h))}return!1}},g.prototype.keydown=function(c){if(/(38|40|27|32)/.test(c.which)&&!/input|textarea/i.test(c.target.tagname)){var d=a(this);if(c.preventdefault(),c.stoppropagation(),!d.is(".disabled, :disabled")){var e=b(d),g=e.hasclass("open");if(!g&&27!=c.which||g&&27==c.which)return 27==c.which&&e.find(f).trigger("focus"),d.trigger("click");var h=" li:not(.disabled):visible a",i=e.find(".dropdown-menu"+h);if(i.length){var j=i.index(c.target);38==c.which&&j>0&&j--,40==c.which&&jdocument.documentelement.clientheight;this.$element.css({paddingleft:!this.bodyisoverflowing&&a?this.scrollbarwidth:"",paddingright:this.bodyisoverflowing&&!a?this.scrollbarwidth:""})},c.prototype.resetadjustments=function(){this.$element.css({paddingleft:"",paddingright:""})},c.prototype.checkscrollbar=function(){var a=window.innerwidth;if(!a){var b=document.documentelement.getboundingclientrect();a=b.right-math.abs(b.left)}this.bodyisoverflowing=document.body.clientwidth
',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())return cleartimeout(c.timeout),c.hoverstate="out",c.options.delay&&c.options.delay.hide?void(c.timeout=settimeout(function(){"out"==c.hoverstate&&c.hide()},c.options.delay.hide)):c.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),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,b=this.$element,c=this.options;return a=b.attr("data-original-title")||("function"==typeof c.title?c.title.call(b[0]):c.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||(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,a.$element=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),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.popover"),f="object"==typeof b&&b;!e&&/destroy|hide/.test(b)||(e||d.data("bs.popover",e=new c(this,f)),"string"==typeof b&&e[b]())})}var c=function(a,b){this.init("popover",a,b)};if(!a.fn.tooltip)throw new error("popover requires tooltip.js");c.version="3.3.7",c.defaults=a.extend({},a.fn.tooltip.constructor.defaults,{placement:"right",trigger:"click",content:"",template:''}),c.prototype=a.extend({},a.fn.tooltip.constructor.prototype),c.prototype.constructor=c,c.prototype.getdefaults=function(){return c.defaults},c.prototype.setcontent=function(){var a=this.tip(),b=this.gettitle(),c=this.getcontent();a.find(".popover-title")[this.options.html?"html":"text"](b),a.find(".popover-content").children().detach().end()[this.options.html?"string"==typeof c?"html":"append":"text"](c),a.removeclass("fade top bottom left right in"),a.find(".popover-title").html()||a.find(".popover-title").hide()},c.prototype.hascontent=function(){return this.gettitle()||this.getcontent()},c.prototype.getcontent=function(){var a=this.$element,b=this.options;return a.attr("data-content")||("function"==typeof b.content?b.content.call(a[0]):b.content)},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};var d=a.fn.popover;a.fn.popover=b,a.fn.popover.constructor=c,a.fn.popover.noconflict=function(){return a.fn.popover=d,this}}(jquery),+function(a){"use strict";function b(c,d){this.$body=a(document.body),this.$scrollelement=a(a(c).is(document.body)?window:c),this.options=a.extend({},b.defaults,d),this.selector=(this.options.target||"")+" .nav li > a",this.offsets=[],this.targets=[],this.activetarget=null,this.scrollheight=0,this.$scrollelement.on("scroll.bs.scrollspy",a.proxy(this.process,this)),this.refresh(),this.process()}function c(c){return this.each(function(){var d=a(this),e=d.data("bs.scrollspy"),f="object"==typeof c&&c;e||d.data("bs.scrollspy",e=new b(this,f)),"string"==typeof c&&e[c]()})}b.version="3.3.7",b.defaults={offset:10},b.prototype.getscrollheight=function(){return this.$scrollelement[0].scrollheight||math.max(this.$body[0].scrollheight,document.documentelement.scrollheight)},b.prototype.refresh=function(){var b=this,c="offset",d=0;this.offsets=[],this.targets=[],this.scrollheight=this.getscrollheight(),a.iswindow(this.$scrollelement[0])||(c="position",d=this.$scrollelement.scrolltop()),this.$body.find(this.selector).map(function(){var b=a(this),e=b.data("target")||b.attr("href"),f=/^#./.test(e)&&a(e);return f&&f.length&&f.is(":visible")&&[[f[c]().top+d,e]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){b.offsets.push(this[0]),b.targets.push(this[1])})},b.prototype.process=function(){var a,b=this.$scrollelement.scrolltop()+this.options.offset,c=this.getscrollheight(),d=this.options.offset+c-this.$scrollelement.height(),e=this.offsets,f=this.targets,g=this.activetarget;if(this.scrollheight!=c&&this.refresh(),b>=d)return g!=(a=f[f.length-1])&&this.activate(a);if(g&&b=e[a]&&(void 0===e[a+1]||b .dropdown-menu > .active").removeclass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1),b.addclass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0),h?(b[0].offsetwidth,b.addclass("in")):b.removeclass("fade"),b.parent(".dropdown-menu").length&&b.closest("li.dropdown").addclass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0),e&&e()}var g=d.find("> .active"),h=e&&a.support.transition&&(g.length&&g.hasclass("fade")||!!d.find("> .fade").length);g.length&&h?g.one("bstransitionend",f).emulatetransitionend(c.transition_duration):f(),g.removeclass("in")};var d=a.fn.tab;a.fn.tab=b,a.fn.tab.constructor=c,a.fn.tab.noconflict=function(){return a.fn.tab=d,this};var e=function(c){c.preventdefault(),b.call(a(this),"show")};a(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',e).on("click.bs.tab.data-api",'[data-toggle="pill"]',e)}(jquery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.affix"),f="object"==typeof b&&b;e||d.data("bs.affix",e=new c(this,f)),"string"==typeof b&&e[b]()})}var c=function(b,d){this.options=a.extend({},c.defaults,d),this.$target=a(this.options.target).on("scroll.bs.affix.data-api",a.proxy(this.checkposition,this)).on("click.bs.affix.data-api",a.proxy(this.checkpositionwitheventloop,this)),this.$element=a(b),this.affixed=null,this.unpin=null,this.pinnedoffset=null,this.checkposition()};c.version="3.3.7",c.reset="affix affix-top affix-bottom",c.defaults={offset:0,target:window},c.prototype.getstate=function(a,b,c,d){var e=this.$target.scrolltop(),f=this.$element.offset(),g=this.$target.height();if(null!=c&&"top"==this.affixed)return e=a-d&&"bottom"},c.prototype.getpinnedoffset=function(){if(this.pinnedoffset)return this.pinnedoffset;this.$element.removeclass(c.reset).addclass("affix");var a=this.$target.scrolltop(),b=this.$element.offset();return this.pinnedoffset=b.top-a},c.prototype.checkpositionwitheventloop=function(){settimeout(a.proxy(this.checkposition,this),1)},c.prototype.checkposition=function(){if(this.$element.is(":visible")){var b=this.$element.height(),d=this.options.offset,e=d.top,f=d.bottom,g=math.max(a(document).height(),a(document.body).height());"object"!=typeof d&&(f=e=d),"function"==typeof e&&(e=d.top(this.$element)),"function"==typeof f&&(f=d.bottom(this.$element));var h=this.getstate(g,b,e,f);if(this.affixed!=h){null!=this.unpin&&this.$element.css("top","");var i="affix"+(h?"-"+h:""),j=a.event(i+".bs.affix");if(this.$element.trigger(j),j.isdefaultprevented())return;this.affixed=h,this.unpin="bottom"==h?this.getpinnedoffset():null,this.$element.removeclass(c.reset).addclass(i).trigger(i.replace("affix","affixed")+".bs.affix")}"bottom"==h&&this.$element.offset({top:g-b-f})}};var d=a.fn.affix;a.fn.affix=b,a.fn.affix.constructor=c,a.fn.affix.noconflict=function(){return a.fn.affix=d,this},a(window).on("load",function(){a('[data-spy="affix"]').each(function(){var c=a(this),d=c.data();d.offset=d.offset||{},null!=d.offsetbottom&&(d.offset.bottom=d.offsetbottom),null!=d.offsettop&&(d.offset.top=d.offsettop),b.call(c,d)})})}(jquery); /* bootstrap-tagsinput */ (function($){"use strict";var defaultoptions={tagclass:function(item){return'label label-default'},itemvalue:function(item){return item?item.tostring():item},itemtext:function(item){return this.itemvalue(item)},freeinput:true,addonblur:true,maxtags:undefined,maxchars:undefined,confirmkeys:[13,44],ontagexists:function(item,$tag){$tag.hide().fadein()},trimvalue:false,allowduplicates:false};function tagsinput(element,options){this.itemsarray=[];this.$element=$(element);var style=this.$element.attr("style");this.$element.hide();this.isselect=(element.tagname==='select');this.multiple=(this.isselect&&element.hasattribute('multiple'));this.objectitems=options&&options.itemvalue;this.placeholdertext=element.hasattribute('placeholder')?this.$element.attr('placeholder'):'';this.inputsize=math.max(1,this.placeholdertext.length);this.$container=$('
');this.$input=$('').appendto(this.$container);this.$element.after(this.$container);var inputwidth=(this.inputsize<3?3:this.inputsize)+"em";this.build(options)}tagsinput.prototype={constructor:tagsinput,add:function(item,dontpushval){var self=this;if(self.options.maxtags&&self.itemsarray.length>=self.options.maxtags)return;if(item!==false&&!item)return;if(typeof item==="string"&&self.options.trimvalue){item=$.trim(item)}if(typeof item==="object"&&!self.objectitems)throw("can't add objects when itemvalue option is not set");if(item.tostring().match(/^\s*$/))return;if(self.isselect&&!self.multiple&&self.itemsarray.length>0)self.remove(self.itemsarray[0]);if(typeof item==="string"&&this.$element[0].tagname==='input'){var items=item.split(',');if(items.length>1){for(var i=0;iself.options.maxinputlength)return;var beforeitemaddevent=$.event('beforeitemadd',{item:item,cancel:false});self.$element.trigger(beforeitemaddevent);if(beforeitemaddevent.cancel)return;self.itemsarray.push(item);var $tag=$(''+htmlencode(itemtext)+'');$tag.data('item',item);self.findinputwrapper().before($tag);$tag.after(' ');if(self.isselect&&!$('option[value="'+encodeuricomponent(itemvalue)+'"]',self.$element)[0]){var $option=$('');$option.data('item',item);$option.attr('value',itemvalue);self.$element.append($option)}if(!dontpushval)self.pushval();if(self.options.maxtags===self.itemsarray.length||self.items().tostring().length===self.options.maxinputlength)self.$container.addclass('bootstrap-tagsinput-max');self.$element.trigger($.event('itemadded',{item:item}))},remove:function(item,dontpushval){var self=this;if(self.objectitems){if(typeof item==="object")item=$.grep(self.itemsarray,function(other){return self.options.itemvalue(other)==self.options.itemvalue(item)});else item=$.grep(self.itemsarray,function(other){return self.options.itemvalue(other)==item});item=item[item.length-1]}if(item){var beforeitemremoveevent=$.event('beforeitemremove',{item:item,cancel:false});self.$element.trigger(beforeitemremoveevent);if(beforeitemremoveevent.cancel)return;$('.tag',self.$container).filter(function(){return $(this).data('item')===item}).remove();$('option',self.$element).filter(function(){return $(this).data('item')===item}).remove();if($.inarray(item,self.itemsarray)!==-1)self.itemsarray.splice($.inarray(item,self.itemsarray),1)}if(!dontpushval)self.pushval();if(self.options.maxtags>self.itemsarray.length)self.$container.removeclass('bootstrap-tagsinput-max');self.$element.trigger($.event('itemremoved',{item:item}))},removeall:function(){var self=this;$('.tag',self.$container).remove();$('option',self.$element).remove();while(self.itemsarray.length>0)self.itemsarray.pop();self.pushval()},refresh:function(){var self=this;$('.tag',self.$container).each(function(){var $tag=$(this),item=$tag.data('item'),itemvalue=self.options.itemvalue(item),itemtext=self.options.itemtext(item),tagclass=self.options.tagclass(item);$tag.attr('class',null);$tag.addclass('tag '+htmlencode(tagclass));$tag.contents().filter(function(){return this.nodetype==3})[0].nodevalue=htmlencode(itemtext);if(self.isselect){var option=$('option',self.$element).filter(function(){return $(this).data('item')===item});option.attr('value',itemvalue)}})},items:function(){return this.itemsarray},pushval:function(){var self=this,val=$.map(self.items(),function(item){return self.options.itemvalue(item).tostring()});self.$element.val(val,true).trigger('change')},build:function(options){var self=this;self.options=$.extend({},defaultoptions,options);if(self.objectitems)self.options.freeinput=false;makeoptionitemfunction(self.options,'itemvalue');makeoptionitemfunction(self.options,'itemtext');makeoptionfunction(self.options,'tagclass');if(self.options.typeahead){var typeahead=self.options.typeahead||{};makeoptionfunction(typeahead,'source');self.$input.typeahead($.extend({},typeahead,{source:function(query,process){function processitems(items){var texts=[];for(var i=0;i$1")}}))}if(self.options.typeaheadjs){var typeaheadjs=self.options.typeaheadjs||{};self.$input.typeahead(null,typeaheadjs).on('typeahead:selected',$.proxy(function(obj,datum){if(typeaheadjs.valuekey)self.add(datum[typeaheadjs.valuekey]);else self.add(datum);self.$input.typeahead('val','')},self))}self.$container.on('click',$.proxy(function(event){if(!self.$element.attr('disabled')){self.$input.removeattr('disabled')}self.$input.focus()},self));if(self.options.addonblur&&self.options.freeinput){self.$input.on('focusout',$.proxy(function(event){if($('.typeahead, .twitter-typeahead',self.$container).length===0){self.add(self.$input.val());self.$input.val('')}},self))}self.$container.on('keydown','input',$.proxy(function(event){var $input=$(event.target),$inputwrapper=self.findinputwrapper();if(self.$element.attr('disabled')){self.$input.attr('disabled','disabled');return}switch(event.which){case 8:if(dogetcaretposition($input[0])===0){var prev=$inputwrapper.prev();if(prev){self.remove(prev.data('item'))}}break;case 46:if(dogetcaretposition($input[0])===0){var next=$inputwrapper.next();if(next){self.remove(next.data('item'))}}break;case 37:var $prevtag=$inputwrapper.prev();if($input.val().length===0&&$prevtag[0]){$prevtag.before($inputwrapper);$input.focus()}break;case 39:var $nexttag=$inputwrapper.next();if($input.val().length===0&&$nexttag[0]){$nexttag.after($inputwrapper);$input.focus()}break;default:}var textlength=$input.val().length,wordspace=math.ceil(textlength/5),size=textlength+wordspace+1;$input.attr('size',math.max(this.inputsize,$input.val().length))},self));self.$container.on('keypress','input',$.proxy(function(event){var $input=$(event.target);if(self.$element.attr('disabled')){self.$input.attr('disabled','disabled');return}var text=$input.val(),maxlengthreached=self.options.maxchars&&text.length>=self.options.maxchars;if(self.options.freeinput&&(keycombinationinlist(event,self.options.confirmkeys)||maxlengthreached)){self.add(maxlengthreached?text.substr(0,self.options.maxchars):text);$input.val('');event.preventdefault()}var textlength=$input.val().length,wordspace=math.ceil(textlength/5),size=textlength+wordspace+1;$input.attr('size',math.max(this.inputsize,$input.val().length))},self));self.$container.on('click','[data-role=remove]',$.proxy(function(event){if(self.$element.attr('disabled')){return}self.remove($(event.target).closest('.tag').data('item'))},self));if(self.options.itemvalue===defaultoptions.itemvalue){if(self.$element[0].tagname==='input'){self.add(self.$element.val())}else{$('option',self.$element).each(function(){self.add($(this).attr('value'),true)})}}},destroy:function(){var self=this;self.$container.off('keypress','input');self.$container.off('click','[role=remove]');self.$container.remove();self.$element.removedata('tagsinput');self.$element.show()},focus:function(){this.$input.focus()},input:function(){return this.$input},findinputwrapper:function(){var elt=this.$input[0],container=this.$container[0];while(elt&&elt.parentnode!==container)elt=elt.parentnode;return $(elt)}};$.fn.tagsinput=function(arg1,arg2){var results=[];this.each(function(){var tagsinput=$(this).data('tagsinput');if(!tagsinput){tagsinput=new tagsinput(this,arg1);$(this).data('tagsinput',tagsinput);results.push(tagsinput);if(this.tagname==='select'){$('option',$(this)).attr('selected','selected')}$(this).val($(this).val())}else if(!arg1&&!arg2){results.push(tagsinput)}else if(tagsinput[arg1]!==undefined){var retval=tagsinput[arg1](arg2);if(retval!==undefined)results.push(retval)}});if(typeof arg1=='string'){return results.length>1?results:results[0]}else{return results}};$.fn.tagsinput.constructor=tagsinput;function makeoptionitemfunction(options,key){if(typeof options[key]!=='function'){var propertyname=options[key];options[key]=function(item){return item[propertyname]}}}function makeoptionfunction(options,key){if(typeof options[key]!=='function'){var value=options[key];options[key]=function(){return value}}}var htmlencodecontainer=$('
');function htmlencode(value){if(value){return htmlencodecontainer.text(value).html()}else{return''}}function dogetcaretposition(ofield){var icaretpos=0;if(document.selection){ofield.focus();var osel=document.selection.createrange();osel.movestart('character',-ofield.value.length);icaretpos=osel.text.length}else if(ofield.selectionstart||ofield.selectionstart=='0'){icaretpos=ofield.selectionstart}return(icaretpos)}function keycombinationinlist(keypressevent,lookuplist){var found=false;$.each(lookuplist,function(index,keycombination){if(typeof(keycombination)==='number'&&keypressevent.which===keycombination){found=true;return false}if(keypressevent.which===keycombination.which){var alt=!keycombination.hasownproperty('altkey')||keypressevent.altkey===keycombination.altkey,shift=!keycombination.hasownproperty('shiftkey')||keypressevent.shiftkey===keycombination.shiftkey,ctrl=!keycombination.hasownproperty('ctrlkey')||keypressevent.ctrlkey===keycombination.ctrlkey;if(alt&&shift&&ctrl){found=true;return false}}});return found}$(function(){$("input[data-role=tagsinput], select[multiple][data-role=tagsinput]").tagsinput()})})(window.jquery); /** * project: bootstrap hover dropdown */(function(b,a,c){var d=b();b.fn.dropdownhover=function(e){if("ontouchstart" in document){return this}d=d.add(this.parent());return this.each(function(){var m=b(this),l=m.parent(),k={delay:500,instantlycloseothers:true},i={delay:b(this).data("delay"),instantlycloseothers:b(this).data("close-others")},f="show.bs.dropdown",j="hide.bs.dropdown",g=b.extend(true,{},k,e,i),h;l.hover(function(n){if(!l.hasclass("open")&&!m.is(n.target)){return true}d.find(":focus").blur();if(g.instantlycloseothers===true){d.removeclass("open")}a.cleartimeout(h);l.addclass("open");m.trigger(f)},function(){h=a.settimeout(function(){l.removeclass("open");m.trigger(j)},g.delay)});m.hover(function(){d.find(":focus").blur();if(g.instantlycloseothers===true){d.removeclass("open")}a.cleartimeout(h);l.addclass("open");m.trigger(f)});l.find(".dropdown-submenu").each(function(){var o=b(this);var n;o.hover(function(){a.cleartimeout(n);o.children(".dropdown-menu").show();o.siblings().children(".dropdown-menu").hide()},function(){var p=o.children(".dropdown-menu");n=a.settimeout(function(){p.hide()},g.delay)})})})};b(document).ready(function(){b('[data-hover="dropdown"]').dropdownhover()})})(jquery,this); /* * bootstrap-switch - v3.3.2 */ (function(){var t=[].slice;!function(e,i){"use strict";var n;return n=function(){function t(t,i){null==i&&(i={}),this.$element=e(t),this.options=e.extend({},e.fn.bootstrapswitch.defaults,{state:this.$element.is(":checked"),size:this.$element.data("size"),animate:this.$element.data("animate"),disabled:this.$element.is(":disabled"),readonly:this.$element.is("[readonly]"),indeterminate:this.$element.data("indeterminate"),inverse:this.$element.data("inverse"),radioalloff:this.$element.data("radio-all-off"),oncolor:this.$element.data("on-color"),offcolor:this.$element.data("off-color"),ontext:this.$element.data("on-text"),offtext:this.$element.data("off-text"),labeltext:this.$element.data("label-text"),handlewidth:this.$element.data("handle-width"),labelwidth:this.$element.data("label-width"),baseclass:this.$element.data("base-class"),wrapperclass:this.$element.data("wrapper-class")},i),this.$wrapper=e("
",{"class":function(t){return function(){var e;return e=[""+t.options.baseclass].concat(t._getclasses(t.options.wrapperclass)),e.push(t.options.state?""+t.options.baseclass+"-on":""+t.options.baseclass+"-off"),null!=t.options.size&&e.push(""+t.options.baseclass+"-"+t.options.size),t.options.disabled&&e.push(""+t.options.baseclass+"-disabled"),t.options.readonly&&e.push(""+t.options.baseclass+"-readonly"),t.options.indeterminate&&e.push(""+t.options.baseclass+"-indeterminate"),t.options.inverse&&e.push(""+t.options.baseclass+"-inverse"),t.$element.attr("id")&&e.push(""+t.options.baseclass+"-id-"+t.$element.attr("id")),e.join(" ")}}(this)()}),this.$container=e("
",{"class":""+this.options.baseclass+"-container"}),this.$on=e("",{html:this.options.ontext,"class":""+this.options.baseclass+"-handle-on "+this.options.baseclass+"-"+this.options.oncolor}),this.$off=e("",{html:this.options.offtext,"class":""+this.options.baseclass+"-handle-off "+this.options.baseclass+"-"+this.options.offcolor}),this.$label=e("",{html:this.options.labeltext,"class":""+this.options.baseclass+"-label"}),this.$element.on("init.bootstrapswitch",function(e){return function(){return e.options.oninit.apply(t,arguments)}}(this)),this.$element.on("switchchange.bootstrapswitch",function(e){return function(){return e.options.onswitchchange.apply(t,arguments)}}(this)),this.$container=this.$element.wrap(this.$container).parent(),this.$wrapper=this.$container.wrap(this.$wrapper).parent(),this.$element.before(this.options.inverse?this.$off:this.$on).before(this.$label).before(this.options.inverse?this.$on:this.$off),this.options.indeterminate&&this.$element.prop("indeterminate",!0),this._init(),this._elementhandlers(),this._handlehandlers(),this._labelhandlers(),this._formhandler(),this._externallabelhandler(),this.$element.trigger("init.bootstrapswitch")}return t.prototype._constructor=t,t.prototype.state=function(t,e){return"undefined"==typeof t?this.options.state:this.options.disabled||this.options.readonly?this.$element:this.options.state&&!this.options.radioalloff&&this.$element.is(":radio")?this.$element:(this.options.indeterminate&&this.indeterminate(!1),t=!!t,this.$element.prop("checked",t).trigger("change.bootstrapswitch",e),this.$element)},t.prototype.togglestate=function(t){return this.options.disabled||this.options.readonly?this.$element:this.options.indeterminate?(this.indeterminate(!1),this.state(!0)):this.$element.prop("checked",!this.options.state).trigger("change.bootstrapswitch",t)},t.prototype.size=function(t){return"undefined"==typeof t?this.options.size:(null!=this.options.size&&this.$wrapper.removeclass(""+this.options.baseclass+"-"+this.options.size),t&&this.$wrapper.addclass(""+this.options.baseclass+"-"+t),this._width(),this._containerposition(),this.options.size=t,this.$element)},t.prototype.animate=function(t){return"undefined"==typeof t?this.options.animate:(t=!!t,t===this.options.animate?this.$element:this.toggleanimate())},t.prototype.toggleanimate=function(){return this.options.animate=!this.options.animate,this.$wrapper.toggleclass(""+this.options.baseclass+"-animate"),this.$element},t.prototype.disabled=function(t){return"undefined"==typeof t?this.options.disabled:(t=!!t,t===this.options.disabled?this.$element:this.toggledisabled())},t.prototype.toggledisabled=function(){return this.options.disabled=!this.options.disabled,this.$element.prop("disabled",this.options.disabled),this.$wrapper.toggleclass(""+this.options.baseclass+"-disabled"),this.$element},t.prototype.readonly=function(t){return"undefined"==typeof t?this.options.readonly:(t=!!t,t===this.options.readonly?this.$element:this.togglereadonly())},t.prototype.togglereadonly=function(){return this.options.readonly=!this.options.readonly,this.$element.prop("readonly",this.options.readonly),this.$wrapper.toggleclass(""+this.options.baseclass+"-readonly"),this.$element},t.prototype.indeterminate=function(t){return"undefined"==typeof t?this.options.indeterminate:(t=!!t,t===this.options.indeterminate?this.$element:this.toggleindeterminate())},t.prototype.toggleindeterminate=function(){return this.options.indeterminate=!this.options.indeterminate,this.$element.prop("indeterminate",this.options.indeterminate),this.$wrapper.toggleclass(""+this.options.baseclass+"-indeterminate"),this._containerposition(),this.$element},t.prototype.inverse=function(t){return"undefined"==typeof t?this.options.inverse:(t=!!t,t===this.options.inverse?this.$element:this.toggleinverse())},t.prototype.toggleinverse=function(){var t,e;return this.$wrapper.toggleclass(""+this.options.baseclass+"-inverse"),e=this.$on.clone(!0),t=this.$off.clone(!0),this.$on.replacewith(t),this.$off.replacewith(e),this.$on=t,this.$off=e,this.options.inverse=!this.options.inverse,this.$element},t.prototype.oncolor=function(t){var e;return e=this.options.oncolor,"undefined"==typeof t?e:(null!=e&&this.$on.removeclass(""+this.options.baseclass+"-"+e),this.$on.addclass(""+this.options.baseclass+"-"+t),this.options.oncolor=t,this.$element)},t.prototype.offcolor=function(t){var e;return e=this.options.offcolor,"undefined"==typeof t?e:(null!=e&&this.$off.removeclass(""+this.options.baseclass+"-"+e),this.$off.addclass(""+this.options.baseclass+"-"+t),this.options.offcolor=t,this.$element)},t.prototype.ontext=function(t){return"undefined"==typeof t?this.options.ontext:(this.$on.html(t),this._width(),this._containerposition(),this.options.ontext=t,this.$element)},t.prototype.offtext=function(t){return"undefined"==typeof t?this.options.offtext:(this.$off.html(t),this._width(),this._containerposition(),this.options.offtext=t,this.$element)},t.prototype.labeltext=function(t){return"undefined"==typeof t?this.options.labeltext:(this.$label.html(t),this._width(),this.options.labeltext=t,this.$element)},t.prototype.handlewidth=function(t){return"undefined"==typeof t?this.options.handlewidth:(this.options.handlewidth=t,this._width(),this._containerposition(),this.$element)},t.prototype.labelwidth=function(t){return"undefined"==typeof t?this.options.labelwidth:(this.options.labelwidth=t,this._width(),this._containerposition(),this.$element)},t.prototype.baseclass=function(){return this.options.baseclass},t.prototype.wrapperclass=function(t){return"undefined"==typeof t?this.options.wrapperclass:(t||(t=e.fn.bootstrapswitch.defaults.wrapperclass),this.$wrapper.removeclass(this._getclasses(this.options.wrapperclass).join(" ")),this.$wrapper.addclass(this._getclasses(t).join(" ")),this.options.wrapperclass=t,this.$element)},t.prototype.radioalloff=function(t){return"undefined"==typeof t?this.options.radioalloff:(t=!!t,t===this.options.radioalloff?this.$element:(this.options.radioalloff=t,this.$element))},t.prototype.oninit=function(t){return"undefined"==typeof t?this.options.oninit:(t||(t=e.fn.bootstrapswitch.defaults.oninit),this.options.oninit=t,this.$element)},t.prototype.onswitchchange=function(t){return"undefined"==typeof t?this.options.onswitchchange:(t||(t=e.fn.bootstrapswitch.defaults.onswitchchange),this.options.onswitchchange=t,this.$element)},t.prototype.destroy=function(){var t;return t=this.$element.closest("form"),t.length&&t.off("reset.bootstrapswitch").removedata("bootstrap-switch"),this.$container.children().not(this.$element).remove(),this.$element.unwrap().unwrap().off(".bootstrapswitch").removedata("bootstrap-switch"),this.$element},t.prototype._width=function(){var t,e;return t=this.$on.add(this.$off),t.add(this.$label).css("width",""),e="auto"===this.options.handlewidth?math.max(this.$on.width(),this.$off.width()):this.options.handlewidth,t.width(e),this.$label.width(function(t){return function(i,n){return"auto"!==t.options.labelwidth?t.options.labelwidth:e>n?e:n}}(this)),this._handlewidth=this.$on.outerwidth(),this._labelwidth=this.$label.outerwidth(),this.$container.width(2*this._handlewidth+this._labelwidth),this.$wrapper.width(this._handlewidth+this._labelwidth)},t.prototype._containerposition=function(t,e){return null==t&&(t=this.options.state),this.$container.css("margin-left",function(e){return function(){var i;return i=[0,"-"+e._handlewidth+"px"],e.options.indeterminate?"-"+e._handlewidth/2+"px":t?e.options.inverse?i[1]:i[0]:e.options.inverse?i[0]:i[1]}}(this)),e?settimeout(function(){return e()},50):void 0},t.prototype._init=function(){var t,e;return t=function(t){return function(){return t._width(),t._containerposition(null,function(){return t.options.animate?t.$wrapper.addclass(""+t.options.baseclass+"-animate"):void 0})}}(this),this.$wrapper.is(":visible")?t():e=i.setinterval(function(n){return function(){return n.$wrapper.is(":visible")?(t(),i.clearinterval(e)):void 0}}(this),50)},t.prototype._elementhandlers=function(){return this.$element.on({"change.bootstrapswitch":function(t){return function(i,n){var o;return i.preventdefault(),i.stopimmediatepropagation(),o=t.$element.is(":checked"),t._containerposition(o),o!==t.options.state?(t.options.state=o,t.$wrapper.toggleclass(""+t.options.baseclass+"-off").toggleclass(""+t.options.baseclass+"-on"),n?void 0:(t.$element.is(":radio")&&e("[name='"+t.$element.attr("name")+"']").not(t.$element).prop("checked",!1).trigger("change.bootstrapswitch",!0),t.$element.trigger("switchchange.bootstrapswitch",[o]))):void 0}}(this),"focus.bootstrapswitch":function(t){return function(e){return e.preventdefault(),t.$wrapper.addclass(""+t.options.baseclass+"-focused")}}(this),"blur.bootstrapswitch":function(t){return function(e){return e.preventdefault(),t.$wrapper.removeclass(""+t.options.baseclass+"-focused")}}(this),"keydown.bootstrapswitch":function(t){return function(e){if(e.which&&!t.options.disabled&&!t.options.readonly)switch(e.which){case 37:return e.preventdefault(),e.stopimmediatepropagation(),t.state(!1);case 39:return e.preventdefault(),e.stopimmediatepropagation(),t.state(!0)}}}(this)})},t.prototype._handlehandlers=function(){return this.$on.on("click.bootstrapswitch",function(t){return function(e){return e.preventdefault(),e.stoppropagation(),t.state(!1),t.$element.trigger("focus.bootstrapswitch")}}(this)),this.$off.on("click.bootstrapswitch",function(t){return function(e){return e.preventdefault(),e.stoppropagation(),t.state(!0),t.$element.trigger("focus.bootstrapswitch")}}(this))},t.prototype._labelhandlers=function(){return this.$label.on({"mousedown.bootstrapswitch touchstart.bootstrapswitch":function(t){return function(e){return t._dragstart||t.options.disabled||t.options.readonly?void 0:(e.preventdefault(),e.stoppropagation(),t._dragstart=(e.pagex||e.originalevent.touches[0].pagex)-parseint(t.$container.css("margin-left"),10),t.options.animate&&t.$wrapper.removeclass(""+t.options.baseclass+"-animate"),t.$element.trigger("focus.bootstrapswitch"))}}(this),"mousemove.bootstrapswitch touchmove.bootstrapswitch":function(t){return function(e){var i;if(null!=t._dragstart&&(e.preventdefault(),i=(e.pagex||e.originalevent.touches[0].pagex)-t._dragstart,!(i<-t._handlewidth||i>0)))return t._dragend=i,t.$container.css("margin-left",""+t._dragend+"px")}}(this),"mouseup.bootstrapswitch touchend.bootstrapswitch":function(t){return function(e){var i;if(t._dragstart)return e.preventdefault(),t.options.animate&&t.$wrapper.addclass(""+t.options.baseclass+"-animate"),t._dragend?(i=t._dragend>-(t._handlewidth/2),t._dragend=!1,t.state(t.options.inverse?!i:i)):t.state(!t.options.state),t._dragstart=!1}}(this),"mouseleave.bootstrapswitch":function(t){return function(){return t.$label.trigger("mouseup.bootstrapswitch")}}(this)})},t.prototype._externallabelhandler=function(){var t;return t=this.$element.closest("label"),t.on("click",function(e){return function(i){return i.preventdefault(),i.stopimmediatepropagation(),i.target===t[0]?e.togglestate():void 0}}(this))},t.prototype._formhandler=function(){var t;return t=this.$element.closest("form"),t.data("bootstrap-switch")?void 0:t.on("reset.bootstrapswitch",function(){return i.settimeout(function(){return t.find("input").filter(function(){return e(this).data("bootstrap-switch")}).each(function(){return e(this).bootstrapswitch("state",this.checked)})},1)}).data("bootstrap-switch",!0)},t.prototype._getclasses=function(t){var i,n,o,s;if(!e.isarray(t))return[""+this.options.baseclass+"-"+t];for(n=[],o=0,s=t.length;s>o;o++)i=t[o],n.push(""+this.options.baseclass+"-"+i);return n},t}(),e.fn.bootstrapswitch=function(){var i,o,s;return o=arguments[0],i=2<=arguments.length?t.call(arguments,1):[],s=this,this.each(function(){var t,a;return t=e(this),a=t.data("bootstrap-switch"),a||t.data("bootstrap-switch",a=new n(this,o)),"string"==typeof o?s=a[o].apply(a,i):void 0}),s},e.fn.bootstrapswitch.constructor=n,e.fn.bootstrapswitch.defaults={state:!0,size:null,animate:!0,disabled:!1,readonly:!1,indeterminate:!1,inverse:!1,radioalloff:!1,oncolor:"primary",offcolor:"default",ontext:"on",offtext:"off",labeltext:" ",handlewidth:"auto",labelwidth:"auto",baseclass:"bootstrap-switch",wrapperclass:"wrapper",oninit:function(){},onswitchchange:function(){}}}(window.jquery,window)}).call(this);