!function(o){function n(t,e){if(this.element=o(t),this.format=u.parseFormat(e.format||this.element.data("date-format")||"mm/dd/yyyy"),this.picker=o(u.template).appendTo("body").on({click:o.proxy(this.click,this)}),this.isInput=this.element.is("input"),this.component=!!this.element.is(".date")&&this.element.find(".add-on"),this.isInput?this.element.on({focus:o.proxy(this.show,this),keyup:o.proxy(this.update,this)}):(this.component||this.element).on("click",o.proxy(this.show,this)),this.minViewMode=e.minViewMode||this.element.data("date-minviewmode")||0,"string"==typeof this.minViewMode)switch(this.minViewMode){case"months":this.minViewMode=1;break;case"years":this.minViewMode=2;break;default:this.minViewMode=0}if(this.viewMode=e.viewMode||this.element.data("date-viewmode")||0,"string"==typeof this.viewMode)switch(this.viewMode){case"months":this.viewMode=1;break;case"years":this.viewMode=2;break;default:this.viewMode=0}this.startViewMode=this.viewMode,this.weekStart=e.weekStart||this.element.data("date-weekstart")||0,this.weekEnd=0===this.weekStart?6:this.weekStart-1,this.onRender=e.onRender,this.fillDow(),this.fillMonths(),this.update(),this.showMode()}n.prototype={constructor:n,show:function(t){this.picker.show(),this.height=(this.component||this.element).outerHeight(),this.place(),o(window).on("resize",o.proxy(this.place,this)),t&&(t.stopPropagation(),t.preventDefault()),this.isInput;var e=this;o(document).on("mousedown",function(t){0==o(t.target).closest(".datepicker").length&&e.hide()}),this.element.trigger({type:"show",date:this.date})},hide:function(){this.picker.hide(),o(window).off("resize",this.place),this.viewMode=this.startViewMode,this.showMode(),this.isInput||o(document).off("mousedown",this.hide),this.element.trigger({type:"hide",date:this.date})},set:function(){var t=u.formatDate(this.date,this.format);this.isInput?this.element.prop("value",t):(this.component&&this.element.find("input").prop("value",t),this.element.data("date",t))},setValue:function(t){this.date="string"==typeof t?u.parseDate(t,this.format):new Date(t),this.set(),this.viewDate=new Date(this.date.getFullYear(),this.date.getMonth(),1,0,0,0,0),this.fill()},place:function(){var t=(this.component||this.element).offset();this.picker.css({top:t.top+this.height,left:t.left})},update:function(t){this.date=u.parseDate("string"==typeof t?t:this.isInput?this.element.prop("value"):this.element.data("date"),this.format),this.viewDate=new Date(this.date.getFullYear(),this.date.getMonth(),1,0,0,0,0),this.fill()},fillDow:function(){for(var t=this.weekStart,e="<tr>";t<this.weekStart+7;)e+='<th class="dow">'+u.dates.daysMin[t++%7]+"</th>";e+="</tr>",this.picker.find(".datepicker-days thead").append(e)},fillMonths:function(){for(var t="",e=0;e<12;)t+='<span class="month">'+u.dates.monthsShort[e++]+"</span>";this.picker.find(".datepicker-months td").append(t)},fill:function(){for(var t,e,i,s=new Date(this.viewDate),n=s.getFullYear(),o=s.getMonth(),a=this.date.valueOf(),r=(this.picker.find(".datepicker-days th:eq(1)").text(u.dates.months[o]+" "+n),new Date(n,o-1,28,0,0,0,0)),s=u.getDaysInMonth(r.getFullYear(),r.getMonth()),h=(r.setDate(s),r.setDate(s-(r.getDay()-this.weekStart+7)%7),new Date(r)),c=(h.setDate(h.getDate()+42),h=h.valueOf(),[]);r.valueOf()<h;)r.getDay()===this.weekStart&&c.push("<tr>"),t=this.onRender(r),e=r.getFullYear(),(i=r.getMonth())<o&&e===n||e<n?t+=" old":(o<i&&e===n||n<e)&&(t+=" new"),r.valueOf()===a&&(t+=" active"),c.push('<td class="day '+t+'">'+r.getDate()+"</td>"),r.getDay()===this.weekEnd&&c.push("</tr>"),r.setDate(r.getDate()+1);this.picker.find(".datepicker-days tbody").empty().append(c.join(""));var l=this.date.getFullYear(),s=this.picker.find(".datepicker-months").find("th:eq(1)").text(n).end().find("span").removeClass("active"),s=(l===n&&s.eq(this.date.getMonth()).addClass("active"),c="",n=10*parseInt(n/10,10),this.picker.find(".datepicker-years").find("th:eq(1)").text(n+"-"+(n+9)).end().find("td"));--n;for(var d=-1;d<11;d++)c+='<span class="year'+(-1===d||10===d?" old":"")+(l===n?" active":"")+'">'+n+"</span>",n+=1;s.html(c)},click:function(t){t.stopPropagation(),t.preventDefault();var e,i,s,n=o(t.target).closest("span, td, th");if(1===n.length)switch(n[0].nodeName.toLowerCase()){case"th":switch(n[0].className){case"switch":this.showMode(1);break;case"prev":case"next":this.viewDate["set"+u.modes[this.viewMode].navFnc].call(this.viewDate,this.viewDate["get"+u.modes[this.viewMode].navFnc].call(this.viewDate)+u.modes[this.viewMode].navStep*("prev"===n[0].className?-1:1)),this.fill(),this.set()}break;case"span":n.is(".month")?(i=n.parent().find("span").index(n),this.viewDate.setMonth(i)):(s=parseInt(n.text(),10)||0,this.viewDate.setFullYear(s)),0!==this.viewMode&&(this.date=new Date(this.viewDate),this.element.trigger({type:"changeDate",date:this.date,viewMode:u.modes[this.viewMode].clsName})),this.showMode(-1),this.fill(),this.set();break;case"td":n.is(".day")&&!n.is(".disabled")&&(e=parseInt(n.text(),10)||1,i=this.viewDate.getMonth(),n.is(".old")?--i:n.is(".new")&&(i+=1),s=this.viewDate.getFullYear(),this.date=new Date(s,i,e,0,0,0,0),this.viewDate=new Date(s,i,Math.min(28,e),0,0,0,0),this.fill(),this.set(),this.element.trigger({type:"changeDate",date:this.date,viewMode:u.modes[this.viewMode].clsName}))}},mousedown:function(t){t.stopPropagation(),t.preventDefault()},showMode:function(t){t&&(this.viewMode=Math.max(this.minViewMode,Math.min(2,this.viewMode+t))),this.picker.find(">div").hide().filter(".datepicker-"+u.modes[this.viewMode].clsName).show()}},o.fn.datepicker=function(i,s){return this.each(function(){var t=o(this),e=t.data("datepicker");e||t.data("datepicker",e=new n(this,o.extend({},o.fn.datepicker.defaults,"object"==typeof i&&i))),"string"==typeof i&&e[i](s)})},o.fn.datepicker.defaults={onRender:function(t){return""}},o.fn.datepicker.Constructor=n;var u={modes:[{clsName:"days",navFnc:"Month",navStep:1},{clsName:"months",navFnc:"FullYear",navStep:1},{clsName:"years",navFnc:"FullYear",navStep:10}],dates:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],daysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sun"],daysMin:["Su","Mo","Tu","We","Th","Fr","Sa","Su"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]},isLeapYear:function(t){return t%4==0&&t%100!=0||t%400==0},getDaysInMonth:function(t,e){return[31,u.isLeapYear(t)?29:28,31,30,31,30,31,31,30,31,30,31][e]},parseFormat:function(t){var e=t.match(/[.\/\-\s].*?/),t=t.split(/\W+/);if(e&&t&&0!==t.length)return{separator:e,parts:t};throw new Error("Invalid date format.")},parseDate:function(t,e){var i,s=t.split(e.separator);if((t=new Date).setHours(0),t.setMinutes(0),t.setSeconds(0),t.setMilliseconds(0),s.length===e.parts.length){for(var n=t.getFullYear(),o=t.getDate(),a=t.getMonth(),r=0,h=e.parts.length;r<h;r++)switch(i=parseInt(s[r],10)||1,e.parts[r]){case"dd":case"d":t.setDate(o=i);break;case"mm":case"m":t.setMonth(a=i-1);break;case"yy":t.setFullYear(n=2e3+i);break;case"yyyy":t.setFullYear(n=i)}t=new Date(n,a,o,0,0,0)}return t},formatDate:function(t,e){for(var i={d:t.getDate(),m:t.getMonth()+1,yy:t.getFullYear().toString().substring(2),yyyy:t.getFullYear()},t=(i.dd=(i.d<10?"0":"")+i.d,i.mm=(i.m<10?"0":"")+i.m,[]),s=0,n=e.parts.length;s<n;s++)t.push(i[e.parts[s]]);return t.join(e.separator)},headTemplate:'<thead><tr><th class="prev">&lsaquo;</th><th colspan="5" class="switch"></th><th class="next">&rsaquo;</th></tr></thead>',contTemplate:'<tbody><tr><td colspan="7"></td></tr></tbody>'};u.template='<div class="datepicker dropdown-menu"><div class="datepicker-days"><table class=" table-condensed">'+u.headTemplate+'<tbody></tbody></table></div><div class="datepicker-months"><table class="table-condensed">'+u.headTemplate+u.contTemplate+'</table></div><div class="datepicker-years"><table class="table-condensed">'+u.headTemplate+u.contTemplate+"</table></div></div>"}(window.jQuery),function(s){"use strict";function n(t,e){this.$element=s(t),this.options=s.extend({},s.fn.timepicker.defaults,e,this.$element.data()),this.minuteStep=this.options.minuteStep||this.minuteStep,this.secondStep=this.options.secondStep||this.secondStep,this.showMeridian=this.options.showMeridian||this.showMeridian,this.showSeconds=this.options.showSeconds||this.showSeconds,this.showInputs=this.options.showInputs||this.showInputs,this.disableFocus=this.options.disableFocus||this.disableFocus,this.template=this.options.template||this.template,this.modalBackdrop=this.options.modalBackdrop||this.modalBackdrop,this.defaultTime=this.options.defaultTime||this.defaultTime,this.open=!1,this.init()}n.prototype={constructor:n,init:function(){this.$element.parent().hasClass("input-append")?(this.$element.parent(".input-append").find(".add-on").on("click",s.proxy(this.showWidget,this)),this.$element.on({focus:s.proxy(this.highlightUnit,this),click:s.proxy(this.highlightUnit,this),keypress:s.proxy(this.elementKeypress,this),blur:s.proxy(this.blurElement,this)})):this.template?this.$element.on({focus:s.proxy(this.showWidget,this),click:s.proxy(this.showWidget,this),blur:s.proxy(this.blurElement,this)}):this.$element.on({focus:s.proxy(this.highlightUnit,this),click:s.proxy(this.highlightUnit,this),keypress:s.proxy(this.elementKeypress,this),blur:s.proxy(this.blurElement,this)}),this.$widget=s(this.getTemplate()).appendTo("body"),this.$widget.on("click",s.proxy(this.widgetClick,this)),this.showInputs&&this.$widget.find("input").on({click:function(){this.select()},keypress:s.proxy(this.widgetKeypress,this),change:s.proxy(this.updateFromWidgetInputs,this)}),this.setDefaultTime(this.defaultTime)},showWidget:function(t){t.stopPropagation(),t.preventDefault(),this.open||(this.$element.trigger("show"),this.disableFocus&&this.$element.trigger("blur"),t=s.extend({},this.$element.offset(),{height:this.$element[0].offsetHeight}),this.updateFromElementVal(),s("html").trigger("click.timepicker.data-api").one("click.timepicker.data-api",s.proxy(this.hideWidget,this)),"modal"===this.template?this.$widget.modal("show").on("hidden",s.proxy(this.hideWidget,this)):(this.$widget.css({top:t.top+t.height,left:t.left}),this.open||this.$widget.addClass("open")),this.open=!0,this.$element.trigger("shown"))},hideWidget:function(){this.$element.trigger("hide"),"modal"===this.template?this.$widget.modal("hide"):this.$widget.removeClass("open"),this.open=!1,this.$element.trigger("hidden")},widgetClick:function(t){t.stopPropagation(),t.preventDefault();t=s(t.target).closest("a").data("action");t&&(this[t](),this.update())},widgetKeypress:function(t){var e=s(t.target).closest("input").attr("name");switch(t.keyCode){case 9:this.showMeridian?"meridian"==e&&this.hideWidget():this.showSeconds?"second"==e&&this.hideWidget():"minute"==e&&this.hideWidget();break;case 27:this.hideWidget();break;case 38:switch(e){case"hour":this.incrementHour();break;case"minute":this.incrementMinute();break;case"second":this.incrementSecond();break;case"meridian":this.toggleMeridian()}this.update();break;case 40:switch(e){case"hour":this.decrementHour();break;case"minute":this.decrementMinute();break;case"second":this.decrementSecond();break;case"meridian":this.toggleMeridian()}this.update()}},elementKeypress:function(t){this.$element.get(0);switch(t.keyCode){case 0:break;case 9:this.updateFromElementVal(),this.showMeridian?"meridian"!=this.highlightedUnit&&(t.preventDefault(),this.highlightNextUnit()):this.showSeconds?"second"!=this.highlightedUnit&&(t.preventDefault(),this.highlightNextUnit()):"minute"!=this.highlightedUnit&&(t.preventDefault(),this.highlightNextUnit());break;case 27:this.updateFromElementVal();break;case 37:this.updateFromElementVal(),this.highlightPrevUnit();break;case 38:switch(this.highlightedUnit){case"hour":this.incrementHour();break;case"minute":this.incrementMinute();break;case"second":this.incrementSecond();break;case"meridian":this.toggleMeridian()}this.updateElement();break;case 39:this.updateFromElementVal(),this.highlightNextUnit();break;case 40:switch(this.highlightedUnit){case"hour":this.decrementHour();break;case"minute":this.decrementMinute();break;case"second":this.decrementSecond();break;case"meridian":this.toggleMeridian()}this.updateElement()}0!==t.keyCode&&8!==t.keyCode&&9!==t.keyCode&&46!==t.keyCode&&t.preventDefault()},setValues:function(t){var e,i;this.showMeridian?(i=(e=t.split(" "))[0].split(":"),this.meridian=e[1]):i=t.split(":"),this.hour=parseInt(i[0],10),this.minute=parseInt(i[1],10),this.second=parseInt(i[2],10),isNaN(this.hour)&&(this.hour=0),isNaN(this.minute)&&(this.minute=0),this.showMeridian?(12<this.hour?this.hour=12:this.hour<1&&(this.hour=1),"am"==this.meridian||"a"==this.meridian?this.meridian="AM":"pm"!=this.meridian&&"p"!=this.meridian||(this.meridian="PM"),"AM"!=this.meridian&&"PM"!=this.meridian&&(this.meridian="AM")):24<=this.hour?this.hour=23:this.hour<0&&(this.hour=0),this.minute<0?this.minute=0:60<=this.minute&&(this.minute=59),this.showSeconds&&(isNaN(this.second)||this.second<0?this.second=0:60<=this.second&&(this.second=59)),""!=this.$element.val()&&this.updateElement(),this.updateWidget()},setMeridian:function(t){"a"==t||"am"==t||"AM"==t?this.meridian="AM":"p"==t||"pm"==t||"PM"==t?this.meridian="PM":this.updateWidget(),this.updateElement()},setDefaultTime:function(t){var e,i,s,n;t?("current"===t?(e=(s=new Date).getHours(),i=Math.floor(s.getMinutes()/this.minuteStep)*this.minuteStep,s=Math.floor(s.getSeconds()/this.secondStep)*this.secondStep,n="AM",this.showMeridian&&(0===e?e=12:n=12<=e?(12<e&&(e-=12),"PM"):"AM"),this.hour=e,this.minute=i,this.second=s,this.meridian=n):"value"===t?this.setValues(this.$element.val()):this.setValues(t),""!=this.$element.val()&&this.updateElement(),this.updateWidget()):(this.hour=0,this.minute=0,this.second=0)},formatTime:function(t,e,i,s){return i=i<10?"0"+i:i,(t=t<10?"0"+t:t)+":"+(e=e<10?"0"+e:e)+(this.showSeconds?":"+i:"")+(this.showMeridian?" "+s:"")},getTime:function(){return this.formatTime(this.hour,this.minute,this.second,this.meridian)},setTime:function(t){this.setValues(t),this.update()},update:function(){this.updateElement(),this.updateWidget()},blurElement:function(){this.highlightedUnit=void 0,this.updateFromElementVal()},updateElement:function(){var t=this.getTime();switch(this.$element.val(t).trigger("change"),this.highlightedUnit){case"hour":this.highlightHour();break;case"minute":this.highlightMinute();break;case"second":this.highlightSecond();break;case"meridian":this.highlightMeridian()}},updateWidget:function(){this.showInputs?(this.$widget.find("input.bootstrap-timepicker-hour").val(this.hour<10?"0"+this.hour:this.hour),this.$widget.find("input.bootstrap-timepicker-minute").val(this.minute<10?"0"+this.minute:this.minute),this.showSeconds&&this.$widget.find("input.bootstrap-timepicker-second").val(this.second<10?"0"+this.second:this.second),this.showMeridian&&this.$widget.find("input.bootstrap-timepicker-meridian").val(this.meridian)):(this.$widget.find("span.bootstrap-timepicker-hour").text(this.hour),this.$widget.find("span.bootstrap-timepicker-minute").text(this.minute<10?"0"+this.minute:this.minute),this.showSeconds&&this.$widget.find("span.bootstrap-timepicker-second").text(this.second<10?"0"+this.second:this.second),this.showMeridian&&this.$widget.find("span.bootstrap-timepicker-meridian").text(this.meridian))},updateFromElementVal:function(t){var e=this.$element.val();e&&(this.setValues(e),this.updateWidget())},updateFromWidgetInputs:function(){var t=s("input.bootstrap-timepicker-hour",this.$widget).val()+":"+s("input.bootstrap-timepicker-minute",this.$widget).val()+(this.showSeconds?":"+s("input.bootstrap-timepicker-second",this.$widget).val():"")+(this.showMeridian?" "+s("input.bootstrap-timepicker-meridian",this.$widget).val():"");this.setValues(t)},getCursorPosition:function(){var t,e,i=this.$element.get(0);return"selectionStart"in i?i.selectionStart:document.selection?(i.focus(),t=document.selection.createRange(),e=document.selection.createRange().text.length,t.moveStart("character",-i.value.length),t.text.length-e):void 0},highlightUnit:function(){this.$element.get(0);this.position=this.getCursorPosition(),0<=this.position&&this.position<=2?this.highlightHour():3<=this.position&&this.position<=5?this.highlightMinute():6<=this.position&&this.position<=8?this.showSeconds?this.highlightSecond():this.highlightMeridian():9<=this.position&&this.position<=11&&this.highlightMeridian()},highlightNextUnit:function(){switch(this.highlightedUnit){case"hour":this.highlightMinute();break;case"minute":this.showSeconds?this.highlightSecond():this.highlightMeridian();break;case"second":this.highlightMeridian();break;case"meridian":this.highlightHour()}},highlightPrevUnit:function(){switch(this.highlightedUnit){case"hour":this.highlightMeridian();break;case"minute":this.highlightHour();break;case"second":this.highlightMinute();break;case"meridian":this.showSeconds?this.highlightSecond():this.highlightMinute()}},highlightHour:function(){this.highlightedUnit="hour",this.$element.get(0).setSelectionRange(0,2)},highlightMinute:function(){this.highlightedUnit="minute",this.$element.get(0).setSelectionRange(3,5)},highlightSecond:function(){this.highlightedUnit="second",this.$element.get(0).setSelectionRange(6,8)},highlightMeridian:function(){this.highlightedUnit="meridian",this.showSeconds?this.$element.get(0).setSelectionRange(9,11):this.$element.get(0).setSelectionRange(6,8)},incrementHour:function(){if(this.showMeridian)if(11===this.hour)this.toggleMeridian();else if(12===this.hour)return this.hour=1;if(23===this.hour)return this.hour=0;this.hour=this.hour+1},decrementHour:function(){if(this.showMeridian){if(1===this.hour)return this.hour=12;12===this.hour&&this.toggleMeridian()}if(0===this.hour)return this.hour=23;this.hour=this.hour-1},incrementMinute:function(){var t=this.minute+this.minuteStep-this.minute%this.minuteStep;59<t?(this.incrementHour(),this.minute=t-60):this.minute=t},decrementMinute:function(){var t=this.minute-this.minuteStep;t<0?(this.decrementHour(),this.minute=60+t):this.minute=t},incrementSecond:function(){var t=this.second+this.secondStep-this.second%this.secondStep;59<t?(this.incrementMinute(),this.second=t-60):this.second=t},decrementSecond:function(){var t=this.second-this.secondStep;t<0?(this.decrementMinute(),this.second=60+t):this.second=t},toggleMeridian:function(){this.meridian="AM"===this.meridian?"PM":"AM",this.update()},getTemplate:function(){if(this.options.templates[this.options.template])return this.options.templates[this.options.template];s=this.showInputs?(t='<input type="text" name="hour" class="bootstrap-timepicker-hour" maxlength="2"/>',e='<input type="text" name="minute" class="bootstrap-timepicker-minute" maxlength="2"/>',i='<input type="text" name="second" class="bootstrap-timepicker-second" maxlength="2"/>','<input type="text" name="meridian" class="bootstrap-timepicker-meridian" maxlength="2"/>'):(t='<span class="bootstrap-timepicker-hour"></span>',e='<span class="bootstrap-timepicker-minute"></span>',i='<span class="bootstrap-timepicker-second"></span>','<span class="bootstrap-timepicker-meridian"></span>');var t,e,i,s,n,o='<table class="'+(this.showSeconds?"show-seconds":"")+" "+(this.showMeridian?"show-meridian":"")+'"><tr><td><a href="#" data-action="incrementHour"><i class="icon-chevron-up"></i></a></td><td class="separator">&nbsp;</td><td><a href="#" data-action="incrementMinute"><i class="icon-chevron-up"></i></a></td>'+(this.showSeconds?'<td class="separator">&nbsp;</td><td><a href="#" data-action="incrementSecond"><i class="icon-chevron-up"></i></a></td>':"")+(this.showMeridian?'<td class="separator">&nbsp;</td><td class="meridian-column"><a href="#" data-action="toggleMeridian"><i class="icon-chevron-up"></i></a></td>':"")+"</tr><tr><td>"+t+'</td> <td class="separator">:</td><td>'+e+"</td> "+(this.showSeconds?'<td class="separator">:</td><td>'+i+"</td>":"")+(this.showMeridian?'<td class="separator">&nbsp;</td><td>'+s+"</td>":"")+'</tr><tr><td><a href="#" data-action="decrementHour"><i class="icon-chevron-down"></i></a></td><td class="separator"></td><td><a href="#" data-action="decrementMinute"><i class="icon-chevron-down"></i></a></td>'+(this.showSeconds?'<td class="separator">&nbsp;</td><td><a href="#" data-action="decrementSecond"><i class="icon-chevron-down"></i></a></td>':"")+(this.showMeridian?'<td class="separator">&nbsp;</td><td><a href="#" data-action="toggleMeridian"><i class="icon-chevron-down"></i></a></td>':"")+"</tr></table>";switch(this.options.template){case"modal":n='<div class="bootstrap-timepicker modal hide fade in" style="top: 30%; margin-top: 0; width: 200px; margin-left: -100px;" data-backdrop="'+(this.modalBackdrop?"true":"false")+'"><div class="modal-header"><a href="#" class="close" data-dismiss="modal">×</a><h3>Pick a Time</h3></div><div class="modal-content">'+o+'</div><div class="modal-footer"><a href="#" class="btn btn-primary" data-dismiss="modal">Ok</a></div></div>';break;case"dropdown":n='<div class="bootstrap-timepicker dropdown-menu">'+o+"</div>"}return n}},s.fn.timepicker=function(i){return this.each(function(){var t=s(this),e=t.data("timepicker");e||t.data("timepicker",e=new n(this,"object"==typeof i&&i)),"string"==typeof i&&e[i]()})},s.fn.timepicker.defaults={minuteStep:15,secondStep:15,disableFocus:!1,defaultTime:"current",showSeconds:!1,showInputs:!0,showMeridian:!0,template:"dropdown",modalBackdrop:!1,templates:{}},s.fn.timepicker.Constructor=n}(window.jQuery),function(e){e(function(){"use strict";var t;e.support.transition=(t=function(){var t,e=document.createElement("bootstrap"),i={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(t in i)if(void 0!==e.style[t])return i[t]}())&&{end:t}})}(window.jQuery),function(o){"use strict";function s(t){o(t).on("click",e,this.close)}var e='[data-dismiss="alert"]';s.prototype.close=function(t){var e,i=o(this),s=i.attr("data-target");function n(){e.trigger("closed").remove()}s=s||(s=i.attr("href"))&&s.replace(/.*(?=#[^\s]*$)/,""),e=o(s),t&&t.preventDefault(),(e=e.length?e:i.hasClass("alert")?i:i.parent()).trigger(t=o.Event("close")),t.isDefaultPrevented()||(e.removeClass("in"),o.support.transition&&e.hasClass("fade")?e.on(o.support.transition.end,n):n())},o.fn.alert=function(i){return this.each(function(){var t=o(this),e=t.data("alert");e||t.data("alert",e=new s(this)),"string"==typeof i&&e[i].call(t)})},o.fn.alert.Constructor=s,o(function(){o("body").on("click.alert.data-api",e,s.prototype.close)})}(window.jQuery),function(s){"use strict";function n(t,e){this.$element=s(t),this.options=s.extend({},s.fn.button.defaults,e)}n.prototype.setState=function(t){var e="disabled",i=this.$element,s=i.data(),n=i.is("input")?"val":"html";t+="Text",s.resetText||i.data("resetText",i[n]()),i[n](s[t]||this.options[t]),setTimeout(function(){"loadingText"==t?i.addClass(e).attr(e,e):i.removeClass(e).removeAttr(e)},0)},n.prototype.toggle=function(){var t=this.$element.closest('[data-toggle="buttons-radio"]');t&&t.find(".active").removeClass("active"),this.$element.toggleClass("active")},s.fn.button=function(i){return this.each(function(){var t=s(this),e=t.data("button");e||t.data("button",e=new n(this,"object"==typeof i&&i)),"toggle"==i?e.toggle():i&&e.setState(i)})},s.fn.button.defaults={loadingText:"loading..."},s.fn.button.Constructor=n,s(function(){s("body").on("click.button.data-api","[data-toggle^=button]",function(t){t=s(t.target);(t=t.hasClass("btn")?t:t.closest(".btn")).button("toggle")})})}(window.jQuery),function(h){"use strict";function o(t,e){this.$element=h(t),this.options=e,this.options.slide&&this.slide(this.options.slide),"hover"==this.options.pause&&this.$element.on("mouseenter",h.proxy(this.pause,this)).on("mouseleave",h.proxy(this.cycle,this))}o.prototype={cycle:function(t){return t||(this.paused=!1),this.options.interval&&!this.paused&&(this.interval=setInterval(h.proxy(this.next,this),this.options.interval)),this},to:function(t){var e=this.$element.find(".item.active"),i=e.parent().children(),e=i.index(e),s=this;if(!(t>i.length-1||t<0))return this.sliding?this.$element.one("slid",function(){s.to(t)}):e==t?this.pause().cycle():this.slide(e<t?"next":"prev",h(i[t]))},pause:function(t){return t||(this.paused=!0),this.$element.find(".next, .prev").length&&h.support.transition.end&&(this.$element.trigger(h.support.transition.end),this.cycle()),clearInterval(this.interval),this.interval=null,this},next:function(){if(!this.sliding)return this.slide("next")},prev:function(){if(!this.sliding)return this.slide("prev")},slide:function(t,e){var i=this.$element.find(".item.active"),s=e||i[t](),e=this.interval,n="next"==t?"left":"right",o="next"==t?"first":"last",a=this,r=h.Event("slide",{relatedTarget:s[0]});if(this.sliding=!0,e&&this.pause(),!(s=s.length?s:this.$element.find(".item")[o]()).hasClass("active")){if(h.support.transition&&this.$element.hasClass("slide")){if(this.$element.trigger(r),r.isDefaultPrevented())return;s.addClass(t),s[0].offsetWidth,i.addClass(n),s.addClass(n),this.$element.one(h.support.transition.end,function(){s.removeClass([t,n].join(" ")).addClass("active"),i.removeClass(["active",n].join(" ")),a.sliding=!1,setTimeout(function(){a.$element.trigger("slid")},0)})}else{if(this.$element.trigger(r),r.isDefaultPrevented())return;i.removeClass("active"),s.addClass("active"),this.sliding=!1,this.$element.trigger("slid")}return e&&this.cycle(),this}}},h.fn.carousel=function(n){return this.each(function(){var t=h(this),e=t.data("carousel"),i=h.extend({},h.fn.carousel.defaults,"object"==typeof n&&n),s="string"==typeof n?n:i.slide;e||t.data("carousel",e=new o(this,i)),"number"==typeof n?e.to(n):s?e[s]():i.interval&&e.cycle()})},h.fn.carousel.defaults={interval:5e3,pause:"hover"},h.fn.carousel.Constructor=o,h(function(){h("body").on("click.carousel.data-api","[data-slide]",function(t){var e=h(this),i=h(e.attr("data-target")||(i=e.attr("href"))&&i.replace(/.*(?=#[^\s]+$)/,"")),e=!i.data("modal")&&h.extend({},i.data(),e.data());i.carousel(e),t.preventDefault()})})}(window.jQuery),function(o){"use strict";function s(t,e){this.$element=o(t),this.options=o.extend({},o.fn.collapse.defaults,e),this.options.parent&&(this.$parent=o(this.options.parent)),this.options.toggle&&this.toggle()}s.prototype={constructor:s,dimension:function(){return this.$element.hasClass("width")?"width":"height"},show:function(){var t,e,i,s;if(!this.transitioning){if(t=this.dimension(),e=o.camelCase(["scroll",t].join("-")),(i=this.$parent&&this.$parent.find("> .accordion-group > .in"))&&i.length){if((s=i.data("collapse"))&&s.transitioning)return;i.collapse("hide"),s||i.data("collapse",null)}this.$element[t](0),this.transition("addClass",o.Event("show"),"shown"),o.support.transition&&this.$element[t](this.$element[0][e])}},hide:function(){var t;this.transitioning||(t=this.dimension(),this.reset(this.$element[t]()),this.transition("removeClass",o.Event("hide"),"hidden"),this.$element[t](0))},reset:function(t){var e=this.dimension();return this.$element.removeClass("collapse")[e](t||"auto")[0].offsetWidth,this.$element[null!==t?"addClass":"removeClass"]("collapse"),this},transition:function(t,e,i){function s(){"show"==e.type&&n.reset(),n.transitioning=0,n.$element.trigger(i)}var n=this;this.$element.trigger(e),e.isDefaultPrevented()||(this.transitioning=1,this.$element[t]("in"),o.support.transition&&this.$element.hasClass("collapse")?this.$element.one(o.support.transition.end,s):s())},toggle:function(){this[this.$element.hasClass("in")?"hide":"show"]()}},o.fn.collapse=function(i){return this.each(function(){var t=o(this),e=t.data("collapse");e||t.data("collapse",e=new s(this,"object"==typeof i&&i)),"string"==typeof i&&e[i]()})},o.fn.collapse.defaults={toggle:!0},o.fn.collapse.Constructor=s,o(function(){o("body").on("click.collapse.data-api","[data-toggle=collapse]",function(t){var e=o(this),t=e.attr("data-target")||t.preventDefault()||(t=e.attr("href"))&&t.replace(/.*(?=#[^\s]+$)/,""),i=o(t).data("collapse")?"toggle":e.data();e[o(t).hasClass("in")?"addClass":"removeClass"]("collapsed"),o(t).collapse(i)})})}(window.jQuery),function(n){"use strict";function s(t){var e=n(t).on("click.dropdown.data-api",this.toggle);n("html").on("click.dropdown.data-api",function(){e.parent().removeClass("open")})}var t="[data-toggle=dropdown]";function o(){a(n(t)).removeClass("open")}function a(t){var e=(e=t.attr("data-target"))||(e=t.attr("href"))&&/#/.test(e)&&e.replace(/.*(?=#[^\s]*$)/,""),e=n(e);return e=e.length?e:t.parent()}s.prototype={constructor:s,toggle:function(t){var e,i,s=n(this);if(!s.is(".disabled, :disabled"))return i=(e=a(s)).hasClass("open"),o(),i||(e.toggleClass("open"),s.focus()),!1},keydown:function(t){var e,i;if(/(38|40|27)/.test(t.keyCode)&&(e=n(this),t.preventDefault(),t.stopPropagation(),!e.is(".disabled, :disabled"))){if(!(i=a(e)).hasClass("open")||27==t.keyCode)return e.trigger("click");(e=n("[role=menu] li:not(.divider) a",i)).length&&(i=e.index(e.filter(":focus")),38==t.keyCode&&0<i&&i--,40==t.keyCode&&i<e.length-1&&i++,e.eq(i=~i?i:0).focus())}}},n.fn.dropdown=function(i){return this.each(function(){var t=n(this),e=t.data("dropdown");e||t.data("dropdown",e=new s(this)),"string"==typeof i&&e[i].call(t)})},n.fn.dropdown.Constructor=s,n(function(){n("html").on("click.dropdown.data-api touchstart.dropdown.data-api",o),n("body").on("click.dropdown touchstart.dropdown.data-api",".dropdown form",function(t){t.stopPropagation()}).on("click.dropdown.data-api touchstart.dropdown.data-api",t,s.prototype.toggle).on("keydown.dropdown.data-api touchstart.dropdown.data-api",t+", [role=menu]",s.prototype.keydown)})}(window.jQuery),function(n){"use strict";function o(t,e){this.options=e,this.$element=n(t).delegate('[data-dismiss="modal"]',"click.dismiss.modal",n.proxy(this.hide,this)),this.options.remote&&this.$element.find(".modal-body").load(this.options.remote)}o.prototype={constructor:o,toggle:function(){return this[this.isShown?"hide":"show"]()},show:function(){var e=this,t=n.Event("show");this.$element.trigger(t),this.isShown||t.isDefaultPrevented()||(n("body").addClass("modal-open"),this.isShown=!0,this.escape(),this.backdrop(function(){var t=n.support.transition&&e.$element.hasClass("fade");e.$element.parent().length||e.$element.appendTo(document.body),e.$element.show(),t&&e.$element[0].offsetWidth,e.$element.addClass("in").attr("aria-hidden",!1).focus(),e.enforceFocus(),t?e.$element.one(n.support.transition.end,function(){e.$element.trigger("shown")}):e.$element.trigger("shown")}))},hide:function(t){t&&t.preventDefault();t=n.Event("hide"),this.$element.trigger(t),this.isShown&&!t.isDefaultPrevented()&&(this.isShown=!1,n("body").removeClass("modal-open"),this.escape(),n(document).off("focusin.modal"),this.$element.removeClass("in").attr("aria-hidden",!0),n.support.transition&&this.$element.hasClass("fade")?this.hideWithTransition():this.hideModal())},enforceFocus:function(){var e=this;n(document).on("focusin.modal",function(t){e.$element[0]===t.target||e.$element.has(t.target).length||e.$element.focus()})},escape:function(){var e=this;this.isShown&&this.options.keyboard?this.$element.on("keyup.dismiss.modal",function(t){27==t.which&&e.hide()}):this.isShown||this.$element.off("keyup.dismiss.modal")},hideWithTransition:function(){var t=this,e=setTimeout(function(){t.$element.off(n.support.transition.end),t.hideModal()},500);this.$element.one(n.support.transition.end,function(){clearTimeout(e),t.hideModal()})},hideModal:function(t){this.$element.hide().trigger("hidden"),this.backdrop()},removeBackdrop:function(){this.$backdrop.remove(),this.$backdrop=null},backdrop:function(t){var e,i=this.$element.hasClass("fade")?"fade":"";this.isShown&&this.options.backdrop?(e=n.support.transition&&i,this.$backdrop=n('<div class="modal-backdrop '+i+'" />').appendTo(document.body),"static"!=this.options.backdrop&&this.$backdrop.on("click",n.proxy(this.hide,this)),e&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),e?this.$backdrop.one(n.support.transition.end,t):t()):!this.isShown&&this.$backdrop?(this.$backdrop.removeClass("in"),n.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one(n.support.transition.end,n.proxy(this.removeBackdrop,this)):this.removeBackdrop()):t&&t()}},n.fn.modal=function(s){return this.each(function(){var t=n(this),e=t.data("modal"),i=n.extend({},n.fn.modal.defaults,t.data(),"object"==typeof s&&s);e||t.data("modal",e=new o(this,i)),"string"==typeof s?e[s]():i.show&&e.show()})},n.fn.modal.defaults={backdrop:!0,keyboard:!0,show:!0},n.fn.modal.Constructor=o,n(function(){n("body").on("click.modal.data-api",'[data-toggle="modal"]',function(t){var e=n(this),i=e.attr("href"),s=n(e.attr("data-target")||i&&i.replace(/.*(?=#[^\s]+$)/,"")),i=s.data("modal")?"toggle":n.extend({remote:!/#/.test(i)&&i},s.data(),e.data());t.preventDefault(),s.modal(i).one("hide",function(){e.focus()})})})}(window.jQuery),function(s){"use strict";function n(t,e){this.init("tooltip",t,e)}n.prototype={constructor:n,init:function(t,e,i){this.type=t,this.$element=s(e),this.options=this.getOptions(i),this.enabled=!0,"click"==this.options.trigger?this.$element.on("click."+this.type,this.options.selector,s.proxy(this.toggle,this)):"manual"!=this.options.trigger&&(t="hover"==this.options.trigger?"mouseenter":"focus",e="hover"==this.options.trigger?"mouseleave":"blur",this.$element.on(t+"."+this.type,this.options.selector,s.proxy(this.enter,this)),this.$element.on(e+"."+this.type,this.options.selector,s.proxy(this.leave,this))),this.options.selector?this._options=s.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},getOptions:function(t){return(t=s.extend({},s.fn[this.type].defaults,t,this.$element.data())).delay&&"number"==typeof t.delay&&(t.delay={show:t.delay,hide:t.delay}),t},enter:function(t){var e=s(t.currentTarget)[this.type](this._options).data(this.type);if(!e.options.delay||!e.options.delay.show)return e.show();clearTimeout(this.timeout),e.hoverState="in",this.timeout=setTimeout(function(){"in"==e.hoverState&&e.show()},e.options.delay.show)},leave:function(t){var e=s(t.currentTarget)[this.type](this._options).data(this.type);if(this.timeout&&clearTimeout(this.timeout),!e.options.delay||!e.options.delay.hide)return e.hide();e.hoverState="out",this.timeout=setTimeout(function(){"out"==e.hoverState&&e.hide()},e.options.delay.hide)},show:function(){var t,e,i,s,n,o,a;if(this.hasContent()&&this.enabled){switch(t=this.tip(),this.setContent(),this.options.animation&&t.addClass("fade"),o="function"==typeof this.options.placement?this.options.placement.call(this,t[0],this.$element[0]):this.options.placement,e=/in/.test(o),t.remove().css({top:0,left:0,display:"block"}).appendTo(e?this.$element:document.body),i=this.getPosition(e),s=t[0].offsetWidth,n=t[0].offsetHeight,e?o.split(" ")[1]:o){case"bottom":a={top:i.top+i.height,left:i.left+i.width/2-s/2};break;case"top":a={top:i.top-n,left:i.left+i.width/2-s/2};break;case"left":a={top:i.top+i.height/4-n/4,left:i.left-s};break;case"right":a={top:i.top+i.height/2-n/2,left:i.left+i.width}}t.css(a).addClass(o).addClass("in")}},setContent:function(){var t=this.tip(),e=this.getTitle();t.find(".tooltip-inner")[this.options.html?"html":"text"](e),t.removeClass("fade in top bottom left right")},hide:function(){var t,e=this.tip();return e.removeClass("in"),s.support.transition&&this.$tip.hasClass("fade")?(t=setTimeout(function(){e.off(s.support.transition.end).remove()},500),e.one(s.support.transition.end,function(){clearTimeout(t),e.remove()})):e.remove(),this},fixTitle:function(){var t=this.$element;!t.attr("title")&&"string"==typeof t.attr("data-original-title")||t.attr("data-original-title",t.attr("title")||"").removeAttr("title")},hasContent:function(){return this.getTitle()},getPosition:function(t){return s.extend({},t?{top:0,left:0}:this.$element.offset(),{width:this.$element[0].offsetWidth,height:this.$element[0].offsetHeight})},getTitle:function(){var t=this.$element,e=this.options;return t.attr("data-original-title")||("function"==typeof e.title?e.title.call(t[0]):e.title)},tip:function(){return this.$tip=this.$tip||s(this.options.template)},validate:function(){this.$element[0].parentNode||(this.hide(),this.$element=null,this.options=null)},enable:function(){this.enabled=!0},disable:function(){this.enabled=!1},toggleEnabled:function(){this.enabled=!this.enabled},toggle:function(){this[this.tip().hasClass("in")?"hide":"show"]()},destroy:function(){this.hide().$element.off("."+this.type).removeData(this.type)}},s.fn.tooltip=function(i){return this.each(function(){var t=s(this),e=t.data("tooltip");e||t.data("tooltip",e=new n(this,"object"==typeof i&&i)),"string"==typeof i&&e[i]()})},s.fn.tooltip.Constructor=n,s.fn.tooltip.defaults={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover",title:"",delay:0,html:!0}}(window.jQuery),function(s){"use strict";function n(t,e){this.init("popover",t,e)}n.prototype=s.extend({},s.fn.tooltip.Constructor.prototype,{constructor:n,setContent:function(){var t=this.tip(),e=this.getTitle(),i=this.getContent();t.find(".popover-title")[this.options.html?"html":"text"](e),t.find(".popover-content > *")[this.options.html?"html":"text"](i),t.removeClass("fade top bottom left right in")},hasContent:function(){return this.getTitle()||this.getContent()},getContent:function(){var t=this.$element,e=this.options;return t.attr("data-content")||("function"==typeof e.content?e.content.call(t[0]):e.content)},tip:function(){return this.$tip||(this.$tip=s(this.options.template)),this.$tip},destroy:function(){this.hide().$element.off("."+this.type).removeData(this.type)}}),s.fn.popover=function(i){return this.each(function(){var t=s(this),e=t.data("popover");e||t.data("popover",e=new n(this,"object"==typeof i&&i)),"string"==typeof i&&e[i]()})},s.fn.popover.Constructor=n,s.fn.popover.defaults=s.extend({},s.fn.tooltip.defaults,{placement:"right",trigger:"click",content:"",template:'<div class="popover"><div class="arrow"></div><div class="popover-inner"><h3 class="popover-title"></h3><div class="popover-content"><p></p></div></div></div>'})}(window.jQuery),function(n){"use strict";function s(t,e){var i=n.proxy(this.process,this),s=n(t).is("body")?n(window):n(t);this.options=n.extend({},n.fn.scrollspy.defaults,e),this.$scrollElement=s.on("scroll.scroll-spy.data-api",i),this.selector=(this.options.target||(e=n(t).attr("href"))&&e.replace(/.*(?=#[^\s]+$)/,"")||"")+" .nav li > a",this.$body=n("body"),this.refresh(),this.process()}s.prototype={constructor:s,refresh:function(){var t=this;this.offsets=n([]),this.targets=n([]),this.$body.find(this.selector).map(function(){var t=n(this),t=t.data("target")||t.attr("href"),e=/^#\w/.test(t)&&n(t);return e&&e.length?[[e.position().top,t]]:null}).sort(function(t,e){return t[0]-e[0]}).each(function(){t.offsets.push(this[0]),t.targets.push(this[1])})},process:function(){var t,e=this.$scrollElement.scrollTop()+this.options.offset,i=(this.$scrollElement[0].scrollHeight||this.$body[0].scrollHeight)-this.$scrollElement.height(),s=this.offsets,n=this.targets,o=this.activeTarget;if(i<=e)return o!=(t=n.last()[0])&&this.activate(t);for(t=s.length;t--;)o!=n[t]&&e>=s[t]&&(!s[t+1]||e<=s[t+1])&&this.activate(n[t])},activate:function(t){this.activeTarget=t,n(this.selector).parent(".active").removeClass("active"),t=this.selector+'[data-target="'+t+'"],'+this.selector+'[href="'+t+'"]',(t=(t=n(t).parent("li").addClass("active")).parent(".dropdown-menu").length?t.closest("li.dropdown").addClass("active"):t).trigger("activate")}},n.fn.scrollspy=function(i){return this.each(function(){var t=n(this),e=t.data("scrollspy");e||t.data("scrollspy",e=new s(this,"object"==typeof i&&i)),"string"==typeof i&&e[i]()})},n.fn.scrollspy.Constructor=s,n.fn.scrollspy.defaults={offset:10},n(window).on("load",function(){n('[data-spy="scroll"]').each(function(){var t=n(this);t.scrollspy(t.data())})})}(window.jQuery),function(a){"use strict";function s(t){this.element=a(t)}s.prototype={constructor:s,show:function(){var t,e,i=this.element,s=i.closest("ul:not(.dropdown-menu)"),n=(n=i.attr("data-target"))||(n=i.attr("href"))&&n.replace(/.*(?=#[^\s]*$)/,"");i.parent("li").hasClass("active")||(t=s.find(".active a").last()[0],e=a.Event("show",{relatedTarget:t}),i.trigger(e),e.isDefaultPrevented()||(e=a(n),this.activate(i.parent("li"),s),this.activate(e,e.parent(),function(){i.trigger({type:"shown",relatedTarget:t})})))},activate:function(t,e,i){var s=e.find("> .active"),n=i&&a.support.transition&&s.hasClass("fade");function o(){s.removeClass("active").find("> .dropdown-menu > .active").removeClass("active"),t.addClass("active"),n?(t[0].offsetWidth,t.addClass("in")):t.removeClass("fade"),t.parent(".dropdown-menu")&&t.closest("li.dropdown").addClass("active"),i&&i()}n?s.one(a.support.transition.end,o):o(),s.removeClass("in")}},a.fn.tab=function(i){return this.each(function(){var t=a(this),e=t.data("tab");e||t.data("tab",e=new s(this)),"string"==typeof i&&e[i]()})},a.fn.tab.Constructor=s,a(function(){a("body").on("click.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"]',function(t){t.preventDefault(),a(this).tab("show")})})}(window.jQuery),function(s){"use strict";function n(t,e){this.$element=s(t),this.options=s.extend({},s.fn.typeahead.defaults,e),this.matcher=this.options.matcher||this.matcher,this.sorter=this.options.sorter||this.sorter,this.highlighter=this.options.highlighter||this.highlighter,this.updater=this.options.updater||this.updater,this.$menu=s(this.options.menu).appendTo("body"),this.source=this.options.source,this.shown=!1,this.listen()}n.prototype={constructor:n,select:function(){var t=this.$menu.find(".active").attr("data-value");return this.$element.val(this.updater(t)).trigger("change"),this.hide()},updater:function(t){return t},show:function(){var t=s.extend({},this.$element.offset(),{height:this.$element[0].offsetHeight});return this.$menu.css({top:t.top+t.height,left:t.left}),this.$menu.show(),this.shown=!0,this},hide:function(){return this.$menu.hide(),this.shown=!1,this},lookup:function(t){var e;return this.query=this.$element.val(),!this.query||this.query.length<this.options.minLength?this.shown?this.hide():this:(e=s.isFunction(this.source)?this.source(this.query,s.proxy(this.process,this)):this.source)?this.process(e):this},process:function(t){var e=this;return t=s.grep(t,function(t){return e.matcher(t)}),(t=this.sorter(t)).length?this.render(t.slice(0,this.options.items)).show():this.shown?this.hide():this},matcher:function(t){return~t.toLowerCase().indexOf(this.query.toLowerCase())},sorter:function(t){for(var e,i=[],s=[],n=[];e=t.shift();)(e.toLowerCase().indexOf(this.query.toLowerCase())?~e.indexOf(this.query)?s:n:i).push(e);return i.concat(s,n)},highlighter:function(t){var e=this.query.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&");return t.replace(new RegExp("("+e+")","ig"),function(t,e){return"<strong>"+e+"</strong>"})},render:function(t){var i=this;return(t=s(t).map(function(t,e){return(t=s(i.options.item).attr("data-value",e)).find("a").html(i.highlighter(e)),t[0]})).first().addClass("active"),this.$menu.html(t),this},next:function(t){var e=this.$menu.find(".active").removeClass("active").next();(e=e.length?e:s(this.$menu.find("li")[0])).addClass("active")},prev:function(t){var e=this.$menu.find(".active").removeClass("active").prev();(e=e.length?e:this.$menu.find("li").last()).addClass("active")},listen:function(){this.$element.on("blur",s.proxy(this.blur,this)).on("keypress",s.proxy(this.keypress,this)).on("keyup",s.proxy(this.keyup,this)),(s.browser.chrome||s.browser.webkit||s.browser.msie)&&this.$element.on("keydown",s.proxy(this.keydown,this)),this.$menu.on("click",s.proxy(this.click,this)).on("mouseenter","li",s.proxy(this.mouseenter,this))},move:function(t){if(this.shown){switch(t.keyCode){case 9:case 13:case 27:t.preventDefault();break;case 38:t.preventDefault(),this.prev();break;case 40:t.preventDefault(),this.next()}t.stopPropagation()}},keydown:function(t){this.suppressKeyPressRepeat=!~s.inArray(t.keyCode,[40,38,9,13,27]),this.move(t)},keypress:function(t){this.suppressKeyPressRepeat||this.move(t)},keyup:function(t){switch(t.keyCode){case 40:case 38:break;case 9:case 13:if(!this.shown)return;this.select();break;case 27:if(!this.shown)return;this.hide();break;default:this.lookup()}t.stopPropagation(),t.preventDefault()},blur:function(t){var e=this;setTimeout(function(){e.hide()},150)},click:function(t){t.stopPropagation(),t.preventDefault(),this.select()},mouseenter:function(t){this.$menu.find(".active").removeClass("active"),s(t.currentTarget).addClass("active")}},s.fn.typeahead=function(i){return this.each(function(){var t=s(this),e=t.data("typeahead");e||t.data("typeahead",e=new n(this,"object"==typeof i&&i)),"string"==typeof i&&e[i]()})},s.fn.typeahead.defaults={source:[],items:8,menu:'<ul class="typeahead dropdown-menu"></ul>',item:'<li><a href="#"></a></li>',minLength:1},s.fn.typeahead.Constructor=n,s(function(){s("body").on("focus.typeahead.data-api",'[data-provide="typeahead"]',function(t){var e=s(this);e.data("typeahead")||(t.preventDefault(),e.typeahead(e.data()))})})}(window.jQuery),function(a){"use strict";function s(t,e){this.options=a.extend({},a.fn.affix.defaults,e),this.$window=a(window).on("scroll.affix.data-api",a.proxy(this.checkPosition,this)),this.$element=a(t),this.checkPosition()}s.prototype.checkPosition=function(){var t,e,i,s,n,o;this.$element.is(":visible")&&(t=a(document).height(),e=this.$window.scrollTop(),i=this.$element.offset(),s=(o=this.options.offset).bottom,n=o.top,"object"!=typeof o&&(s=n=o),"function"==typeof n&&(n=o.top()),"function"==typeof s&&(s=o.bottom()),o=!(null!=this.unpin&&e+this.unpin<=i.top)&&(null!=s&&i.top+this.$element.height()>=t-s?"bottom":null!=n&&e<=n&&"top"),this.affixed!==o&&(this.affixed=o,this.unpin="bottom"==o?i.top-e:null,this.$element.removeClass("affix affix-top affix-bottom").addClass("affix"+(o?"-"+o:""))))},a.fn.affix=function(i){return this.each(function(){var t=a(this),e=t.data("affix");e||t.data("affix",e=new s(this,"object"==typeof i&&i)),"string"==typeof i&&e[i]()})},a.fn.affix.Constructor=s,a.fn.affix.defaults={offset:0},a(window).on("load",function(){a('[data-spy="affix"]').each(function(){var t=a(this),e=t.data();e.offset=e.offset||{},e.offsetBottom&&(e.offset.bottom=e.offsetBottom),e.offsetTop&&(e.offset.top=e.offsetTop),t.affix(e)})})}(window.jQuery),function(f,l,d,m,u,p){var r,h,g,v=this,c=Math.floor(1e4*Math.random()),w=Function.prototype,y=/^((http.?:)\/\/([^:\/\s]+)(:\d+)*)/,i=/[\-\w]+\/\.\.\//,N=/([^:])\/\//g,b="",C={},H=f.easyXDM,k="easyXDM_",S=!1;function x(t,e){var i=typeof t[e];return"function"==i||"object"==i&&t[e]||"unknown"==i}if(x(f,"addEventListener"))h=function(t,e,i){t.addEventListener(e,i,!1)},g=function(t,e,i){t.removeEventListener(e,i,!1)};else{if(!x(f,"attachEvent"))throw new Error("Browser not supported");h=function(t,e,i){t.attachEvent("on"+e,i)},g=function(t,e,i){t.detachEvent("on"+e,i)}}var t,e,s=!1,n=[];function o(){if(!s){s=!0;for(var t=0;t<n.length;t++)n[t]();n.length=0}}function M(t,e){s?t.call(e):n.push(function(){t.call(e)})}function T(t){return t.match(y)[3]}function E(t){var t=t.toLowerCase().match(y),e=t[2],i=t[3],t=t[4]||"";return e+"//"+i+(t="http:"==e&&":80"==t||"https:"==e&&":443"==t?"":t)}function $(t){var e;for((t=t.replace(N,"$1/")).match(/^(http||https):\/\//)||("/"!==(e="/"===t.substring(0,1)?"":d.pathname).substring(e.length-1)&&(e=e.substring(0,e.lastIndexOf("/")+1)),t=d.protocol+"//"+d.host+e+t);i.test(t);)t=t.replace(i,"");return t}function O(t,e){var i,s="",n=t.indexOf("#"),o=(-1!==n&&(s=t.substring(n),t=t.substring(0,n)),[]);for(i in e)e.hasOwnProperty(i)&&o.push(i+"="+p(e[i]));return t+(S?"#":-1==t.indexOf("?")?"?":"&")+o.join("&")+s}(s="readyState"in l?"complete"==(t=l.readyState)||~navigator.userAgent.indexOf("AppleWebKit/")&&("loaded"==t||"interactive"==t):!!l.body)||(x(f,"addEventListener")?h(l,"DOMContentLoaded",o):(h(l,"readystatechange",function(){"complete"==l.readyState&&o()}),l.documentElement.doScroll&&f===top&&(e=function(){if(!s){try{l.documentElement.doScroll("left")}catch(t){return void m(e,1)}o()}})()),h(f,"load",o));var D=function(t){for(var e,i={},s=(t=t.substring(1).split("&")).length;s--;)i[(e=t[s].split("="))[0]]=u(e[1]);return i}(/xdm_e=/.test(d.search)?d.search:d.hash);function P(t){return void 0===t}var a,I=function(){var t={},e={a:[1,2,3]},i='{"a":[1,2,3]}';return"undefined"!=typeof JSON&&"function"==typeof JSON.stringify&&JSON.stringify(e).replace(/\s/g,"")===i?JSON:(Object.toJSON&&Object.toJSON(e).replace(/\s/g,"")===i&&(t.stringify=Object.toJSON),"function"==typeof String.prototype.evalJSON&&(e=i.evalJSON()).a&&3===e.a.length&&3===e.a[2]&&(t.parse=function(t){return t.evalJSON()}),t.stringify&&t.parse?(I=function(){return t},t):null)};function R(t,e,i){var s,n;for(n in e)e.hasOwnProperty(n)&&(n in t?"object"==typeof(s=e[n])?R(t[n],s,i):i||(t[n]=e[n]):t[n]=e[n]);return t}function F(t){P(r)&&(e=l.body.appendChild(l.createElement("form")),(s=e.appendChild(l.createElement("input"))).name=k+"TEST"+c,r=s!==e.elements[s.name],l.body.removeChild(e)),r?i=l.createElement('<iframe name="'+t.props.name+'"/>'):(i=l.createElement("IFRAME")).name=t.props.name,i.id=i.name=t.props.name,delete t.props.name,"string"==typeof t.container&&(t.container=l.getElementById(t.container)),t.container||(R(i.style,{position:"absolute",top:"-2000px",left:"0px"}),t.container=l.body);var e,i,s=t.props.src;if(t.props.src="javascript:false",R(i,t.props),i.border=i.frameBorder=0,i.allowTransparency=!0,t.container.appendChild(i),t.onLoad&&h(i,"load",t.onLoad),t.usePost){var n,o=t.container.appendChild(l.createElement("form"));if(o.target=i.name,o.action=s,o.method="POST","object"==typeof t.usePost)for(var a in t.usePost)t.usePost.hasOwnProperty(a)&&(r?n=l.createElement('<input name="'+a+'"/>'):(n=l.createElement("INPUT")).name=a,n.value=t.usePost[a],o.appendChild(n));o.submit(),o.parentNode.removeChild(o)}else i.src=s;return t.props.src=s,i}function A(t){var e,i=t.protocol;if(t.isHost=t.isHost||P(D.xdm_p),S=t.hash||!1,t.props||(t.props={}),t.isHost)t.remote=$(t.remote),t.channel=t.channel||"default"+c++,t.secret=Math.random().toString(16).substring(2),P(i)&&(i=E(d.href)==E(t.remote)?"4":x(f,"postMessage")||x(l,"postMessage")?"1":(t.swf&&x(f,"ActiveXObject"),"Gecko"===navigator.product&&"frameElement"in f&&-1==navigator.userAgent.indexOf("WebKit")?"5":t.remoteHelper?"2":"0"));else if(t.channel=D.xdm_c.replace(/["'<>\\]/g,""),t.secret=D.xdm_s,t.remote=D.xdm_e.replace(/["'<>\\]/g,""),i=D.xdm_p,t.acl&&!function(t,e){for(var i,s=(t="string"==typeof t?[t]:t).length;s--;)if(i=t[s],(i=new RegExp("^"==i.substr(0,1)?i:"^"+i.replace(/(\*)/g,".$1").replace(/\?/g,".")+"$")).test(e))return 1}(t.acl,t.remote))throw new Error("Access denied for "+t.remote);switch(t.protocol=i){case"0":if(R(t,{interval:100,delay:2e3,useResize:!0,useParent:!1,usePolling:!1},!0),t.isHost){if(!t.local){for(var s,n=d.protocol+"//"+d.host,o=l.body.getElementsByTagName("img"),a=o.length;a--;)if((s=o[a]).src.substring(0,n.length)===n){t.local=s.src;break}t.local||(t.local=f)}var r={xdm_c:t.channel,xdm_p:0};t.local===f?(t.usePolling=!0,t.useParent=!0,t.local=d.protocol+"//"+d.host+d.pathname+d.search,r.xdm_e=t.local,r.xdm_pa=1):r.xdm_e=$(t.local),t.container&&(t.useResize=!1,r.xdm_po=1),t.remote=O(t.remote,r)}else R(t,{channel:D.xdm_c,remote:D.xdm_e,useParent:!P(D.xdm_pa),usePolling:!P(D.xdm_po),useResize:!t.useParent&&t.useResize});e=[new C.stack.HashTransport(t),new C.stack.ReliableBehavior({}),new C.stack.QueueBehavior({encode:!0,maxLength:4e3-t.remote.length}),new C.stack.VerifyBehavior({initiate:t.isHost})];break;case"1":e=[new C.stack.PostMessageTransport(t)];break;case"2":t.isHost&&(t.remoteHelper=$(t.remoteHelper)),e=[new C.stack.NameTransport(t),new C.stack.QueueBehavior,new C.stack.VerifyBehavior({initiate:t.isHost})];break;case"3":e=[new C.stack.NixTransport(t)];break;case"4":e=[new C.stack.SameOriginTransport(t)];break;case"5":e=[new C.stack.FrameElementTransport(t)];break;case"6":e=[new C.stack.FlashTransport(t)]}return e.push(new C.stack.QueueBehavior({lazy:t.lazy,remove:!0})),e}function _(t){for(var e,i={incoming:function(t,e){this.up.incoming(t,e)},outgoing:function(t,e){this.down.outgoing(t,e)},callback:function(t){this.up.callback(t)},init:function(){this.down.init()},destroy:function(){this.down.destroy()}},s=0,n=t.length;s<n;s++)R(e=t[s],i,!0),0!==s&&(e.down=t[s-1]),s!==n-1&&(e.up=t[s+1]);return e}R(C,{version:"2.4.19.3",query:D,stack:{},apply:R,getJSONObject:I,whenReady:M,noConflict:function(t){return f.easyXDM=H,(b=t)&&(k="easyXDM_"+b.replace(".","_")+"_"),C}}),C.DomHelper={on:h,un:g,requiresJSON:function(t){var e,i;"object"==typeof(e=f)[i="JSON"]&&e[i]||l.write('<script type="text/javascript" src="'+t+'"><\/script>')}},a={},C.Fn={set:function(t,e){a[t]=e},get:function(t,e){var i;if(a.hasOwnProperty(t))return i=a[t],e&&delete a[t],i}},C.Socket=function(i){var e=_(A(i).concat([{incoming:function(t,e){i.onMessage(t,e)},callback:function(t){i.onReady&&i.onReady(t)}}])),s=E(i.remote);this.origin=E(i.remote),this.destroy=function(){e.destroy()},this.postMessage=function(t){e.outgoing(t,s)},e.init()},C.Rpc=function(e,t){if(t.local)for(var i in t.local){var s;!t.local.hasOwnProperty(i)||"function"==typeof(s=t.local[i])&&(t.local[i]={method:s})}var n=_(A(e).concat([new C.stack.RpcBehavior(this,t),{callback:function(t){e.onReady&&e.onReady(t)}}]));this.origin=E(e.remote),this.destroy=function(){n.destroy()},n.init()},C.stack.SameOriginTransport=function(t){var e,i,s,n;return e={outgoing:function(t,e,i){s(t),i&&i()},destroy:function(){i&&(i.parentNode.removeChild(i),i=null)},onDOMReady:function(){n=E(t.remote),t.isHost?(R(t.props,{src:O(t.remote,{xdm_e:d.protocol+"//"+d.host+d.pathname,xdm_c:t.channel,xdm_p:4}),name:k+t.channel+"_provider"}),i=F(t),C.Fn.set(t.channel,function(t){return s=t,m(function(){e.up.callback(!0)},0),function(t){e.up.incoming(t,n)}})):(s=function(){var t=parent;if(""!==b)for(var e=0,i=b.split(".");e<i.length;e++)t=t[i[e]];return t.easyXDM}().Fn.get(t.channel,!0)(function(t){e.up.incoming(t,n)}),m(function(){e.up.callback(!0)},0))},init:function(){M(e.onDOMReady,e)}}},C.stack.FlashTransport=function(n){var i,s,o,a,r;function h(t,e){m(function(){i.up.incoming(t,o)},0)}function c(i){var t=n.swf+"?host="+n.isHost,e="easyXDM_swf_"+Math.floor(1e4*Math.random()),s=(C.Fn.set("flash_loaded"+i.replace(/[\-.]/g,"_"),function(){C.stack.FlashTransport[i].swf=a=r.firstChild;for(var t=C.stack.FlashTransport[i].queue,e=0;e<t.length;e++)t[e]();t.length=0}),n.swfContainer?r="string"==typeof n.swfContainer?l.getElementById(n.swfContainer):n.swfContainer:(R((r=l.createElement("div")).style,{height:"1px",width:"1px",position:"absolute",overflow:"hidden",right:0,top:0}),l.body.appendChild(r)),"callback=flash_loaded"+p(i.replace(/[\-.]/g,"_"))+"&proto="+v.location.protocol+"&domain="+p(T(v.location.href))+"&port="+p(v.location.href.match(y)[4]||"")+"&ns="+p(b));r.innerHTML="<object height='20' width='20' type='application/x-shockwave-flash' id='"+e+"' data='"+t+"'><param name='allowScriptAccess' value='sameDomain'></param><param name='wmode' value='transparent'><param name='movie' value='"+t+"'></param><param name='flashvars' value='"+s+"'></param><embed type='application/x-shockwave-flash' FlashVars='"+s+"' allowScriptAccess='sameDomain' wmode='transparent' src='"+t+"' height='1' width='1'></embed></object>"}return i={outgoing:function(t,e,i){a.postMessage(n.channel,t.toString()),i&&i()},destroy:function(){try{a.destroyChannel(n.channel)}catch(t){}a=null,s&&(s.parentNode.removeChild(s),s=null)},onDOMReady:function(){o=n.remote,C.Fn.set("flash_"+n.channel+"_init",function(){m(function(){i.up.callback(!0)})}),C.Fn.set("flash_"+n.channel+"_onMessage",h),n.swf=$(n.swf);function t(){C.stack.FlashTransport[e].init=!0,(a=C.stack.FlashTransport[e].swf).createChannel(n.channel,n.secret,E(n.remote),n.isHost),n.isHost&&(R(n.props,{src:O(n.remote,{xdm_e:E(d.href),xdm_c:n.channel,xdm_p:6,xdm_s:n.secret}),name:k+n.channel+"_provider"}),s=F(n))}var e=T(n.swf);C.stack.FlashTransport[e]&&C.stack.FlashTransport[e].init?t():C.stack.FlashTransport[e]?C.stack.FlashTransport[e].queue.push(t):(C.stack.FlashTransport[e]={queue:[t]},c(e))},init:function(){M(i.onDOMReady,i)}}},C.stack.PostMessageTransport=function(s){var i,n,o,a;function r(t){var e=function(t){if(t.origin)return E(t.origin);if(t.uri)return E(t.uri);if(t.domain)return d.protocol+"//"+t.domain;throw"Unable to retrieve the origin of the event"}(t);e==a&&t.data.substring(0,s.channel.length+1)==s.channel+" "&&i.up.incoming(t.data.substring(s.channel.length+1),e)}return i={outgoing:function(t,e,i){o.postMessage(s.channel+" "+t,e||a),i&&i()},destroy:function(){g(f,"message",r),n&&(o=null,n.parentNode.removeChild(n),n=null)},onDOMReady:function(){var e;a=E(s.remote),s.isHost?(h(f,"message",e=function(t){t.data==s.channel+"-ready"&&(o="postMessage"in n.contentWindow?n.contentWindow:n.contentWindow.document,g(f,"message",e),h(f,"message",r),m(function(){i.up.callback(!0)},0))}),R(s.props,{src:O(s.remote,{xdm_e:E(d.href),xdm_c:s.channel,xdm_p:1}),name:k+s.channel+"_provider"}),n=F(s)):(h(f,"message",r),(o="postMessage"in f.parent?f.parent:f.parent.document).postMessage(s.channel+"-ready",a),m(function(){i.up.callback(!0)},0))},init:function(){M(i.onDOMReady,i)}}},C.stack.FrameElementTransport=function(t){var e,i,s,n;return e={outgoing:function(t,e,i){s.call(this,t),i&&i()},destroy:function(){i&&(i.parentNode.removeChild(i),i=null)},onDOMReady:function(){n=E(t.remote),t.isHost?(R(t.props,{src:O(t.remote,{xdm_e:E(d.href),xdm_c:t.channel,xdm_p:5}),name:k+t.channel+"_provider"}),(i=F(t)).fn=function(t){return delete i.fn,s=t,m(function(){e.up.callback(!0)},0),function(t){e.up.incoming(t,n)}}):(l.referrer&&E(l.referrer)!=D.xdm_e&&(f.top.location=D.xdm_e),s=f.frameElement.fn(function(t){e.up.incoming(t,n)}),e.up.callback(!0))},init:function(){M(e.onDOMReady,e)}}},C.stack.NameTransport=function(i){var e,s,n,o,a,r,h,c;function l(t){var e=i.remoteHelper+(s?"#_3":"#_2")+i.channel;n.contentWindow.sendMessage(t,e)}function d(){s?2!=++a&&s||e.up.callback(!0):(l("ready"),e.up.callback(!0))}function u(t){e.up.incoming(t,h)}function p(){r&&m(function(){r(!0)},0)}return e={outgoing:function(t,e,i){r=i,l(t)},destroy:function(){n.parentNode.removeChild(n),n=null,s&&(o.parentNode.removeChild(o),o=null)},onDOMReady:function(){s=i.isHost,a=0,h=E(i.remote),i.local=$(i.local),s?(C.Fn.set(i.channel,function(t){s&&"ready"===t&&(C.Fn.set(i.channel,u),d())}),c=O(i.remote,{xdm_e:i.local,xdm_c:i.channel,xdm_p:2}),R(i.props,{src:c+"#"+i.channel,name:k+i.channel+"_provider"}),o=F(i)):(i.remoteHelper=i.remote,C.Fn.set(i.channel,u));function t(){var e=n||this;g(e,"load",t),C.Fn.set(i.channel+"_load",p),function t(){"function"==typeof e.contentWindow.sendMessage?d():m(t,50)}()}n=F({props:{src:i.local+"#_4"+i.channel},onLoad:t})},init:function(){M(e.onDOMReady,e)}}},C.stack.HashTransport=function(s){var n,o,t,a,r,h,c,l,d,u;function e(){var t,e,i;c&&(t=c.location.href,e="",i=t.indexOf("#"),(e=-1!=i?t.substring(i):e)&&e!=r&&(r=e,n.up.incoming(r.substring(r.indexOf("_")+1),u)))}function p(){t=setInterval(e,a)}return n={outgoing:function(t,e){t=t,l&&(t=s.remote+"#"+h+++"_"+t,(o||!d?l.contentWindow:l).location=t)},destroy:function(){f.clearInterval(t),!o&&d||l.parentNode.removeChild(l),l=null},onDOMReady:function(){var e,i;o=s.isHost,a=s.interval,r="#"+s.channel,h=0,d=s.useParent,u=E(s.remote),o?(R(s.props,{src:s.remote,name:k+s.channel+"_provider"}),d?s.onLoad=function(){c=f,p(),n.up.callback(!0)}:(e=0,i=s.delay/50,function t(){if(++e>i)throw new Error("Unable to reference listenerwindow");try{c=l.contentWindow.frames[k+s.channel+"_consumer"]}catch(t){}c?(p(),n.up.callback(!0)):m(t,50)}()),l=F(s)):(c=f,p(),d?(l=parent,n.up.callback(!0)):(R(s,{props:{src:s.remote+"#"+s.channel+new Date,name:k+s.channel+"_consumer"},onLoad:function(){n.up.callback(!0)}}),l=F(s)))},init:function(){M(n.onDOMReady,n)}}},C.stack.ReliableBehavior=function(t){var n,o,a=0,r=0,h="";return n={incoming:function(t,e){var i=t.indexOf("_"),s=t.substring(0,i).split(",");t=t.substring(i+1),s[0]==a&&(h="",o&&o(!0)),0<t.length&&(n.down.outgoing(s[1]+","+a+"_"+h,e),r!=s[1]&&(r=s[1],n.up.incoming(t,e)))},outgoing:function(t,e,i){h=t,o=i,n.down.outgoing(r+","+ ++a+"_"+t,e)}}},C.stack.QueueBehavior=function(o){var a,i,r=[],s=!0,n="",h=0,c=!1,l=!1;function d(){if(o.remove&&0===r.length)return(t=a).up.down=t.down,t.down.up=t.up,void(t.up=t.down=null);var t,e;s||0===r.length||i||(s=!0,e=r.shift(),a.down.outgoing(e.data,e.origin,function(t){s=!1,e.callback&&m(function(){e.callback(t)},0),d()}))}return a={init:function(){(o=P(o)?{}:o).maxLength&&(h=o.maxLength,l=!0),o.lazy?c=!0:a.down.init()},callback:function(t){s=!1;var e=a.up;d(),e.callback(t)},incoming:function(t,e){var i,s;l?(i=t.indexOf("_"),s=parseInt(t.substring(0,i),10),n+=t.substring(i+1),0===s&&(o.encode&&(n=u(n)),a.up.incoming(n,e),n="")):a.up.incoming(t,e)},outgoing:function(t,e,i){o.encode&&(t=p(t));var s,n=[];if(l){for(;0!==t.length;)s=t.substring(0,h),t=t.substring(s.length),n.push(s);for(;s=n.shift();)r.push({data:n.length+"_"+s,origin:e,callback:0===n.length?i:null})}else r.push({data:t,origin:e,callback:i});c?a.down.init():d()},destroy:function(){i=!0,a.down.destroy()}}},C.stack.VerifyBehavior=function(s){var n,o,a;function r(){o=Math.random().toString(16).substring(2),n.down.outgoing(o)}return n={incoming:function(t,e){var i=t.indexOf("_");-1===i?t===o?n.up.callback(!0):a||(a=t,s.initiate||r(),n.down.outgoing(t)):t.substring(0,i)===a&&n.up.incoming(t.substring(i+1),e)},outgoing:function(t,e,i){n.down.outgoing(o+"_"+t,e,i)},callback:function(t){s.initiate&&r()}}},C.stack.RpcBehavior=function(e,s){var i,n=s.serializer||I(),a=0,r={};function h(t){t.jsonrpc="2.0",i.down.outgoing(n.stringify(t))}function o(t,i,e,s){if(e){var n,o,a;i?(n=function(t){n=w,h({id:i,result:t})},o=function(t,e){o=w;t={id:i,error:{code:-32099,message:t}};e&&(t.error.data=e),h(t)}):n=o=w,a=s,"[object Array]"!==Object.prototype.toString.call(a)&&(s=[s]);try{var r=e.method.apply(e.scope,s.concat([n,o]));P(r)||n(r)}catch(t){o(t.message)}}else i&&h({id:i,error:{code:-32601,message:"Procedure not found."}})}return i={incoming:function(t,e){var i,t=n.parse(t);t.method?s.handle?s.handle(t,h):o(t.method,t.id,s.local[t.method],t.params):(i=r[t.id],t.error?i.error&&i.error(t.error):i.success&&i.success(t.result),delete r[t.id])},init:function(){if(s.remote)for(var t in s.remote)s.remote.hasOwnProperty(t)&&(e[t]=function(s,n){var o=Array.prototype.slice;return function(){var t,e=arguments.length,i={method:n};0<e&&"function"==typeof arguments[e-1]?(1<e&&"function"==typeof arguments[e-2]?(t={success:arguments[e-2],error:arguments[e-1]},i.params=o.call(arguments,0,e-2)):(t={success:arguments[e-1]},i.params=o.call(arguments,0,e-1)),r[""+ ++a]=t,i.id=a):i.params=o.call(arguments,0),s.namedParams&&1===i.params.length&&(i.params=i.params[0]),h(i)}}(s.remote[t],t));i.down.init()},destroy:function(){for(var t in s.remote)s.remote.hasOwnProperty(t)&&e.hasOwnProperty(t)&&delete e[t];i.down.destroy()}}},v.easyXDM=C}(window,document,location,window.setTimeout,decodeURIComponent,encodeURIComponent),function(n){void 0===n.fn.each2&&n.extend(n.fn,{each2:function(t){for(var e=n([0]),i=-1,s=this.length;++i<s&&(e.context=e[0]=this[i])&&!1!==t.call(e[0],i,e););return this}})}(jQuery),function(v,w){"use strict";var t,e,i,y,n,r,g,c,s,o,a;function h(t){var e=v(document.createTextNode(""));t.before(e),e.before(t),e.remove()}function l(t){return t.replace(/[^\u0000-\u007E]/g,function(t){return s[t]||t})}function d(t,e){for(var i=0,s=e.length;i<s;i+=1)if(u(t,e[i]))return i;return-1}function u(t,e){return t===e||t!==w&&e!==w&&(null!==t&&null!==e&&(t.constructor===String?t+""==e+"":e.constructor===String&&e+""==t+""))}function p(t,e){var i,s,n;if(null===t||t.length<1)return[];for(s=0,n=(i=t.split(e)).length;s<n;s+=1)i[s]=i[s].trim();return i}function f(t){return t.outerWidth(!1)-t.width()}function m(e){var i="keyup-change-value";e.on("keydown",function(){v.data(e,i)===w&&v.data(e,i,e.val())}),e.on("keyup",function(){var t=v.data(e,i);t!==w&&e.val()!==t&&(v.removeData(e,i),e.trigger("keyup-change"))})}function b(e,i,s){var n;return s=s||w,function(){var t=arguments;window.clearTimeout(n),n=window.setTimeout(function(){i.apply(s,t)},e)}}function C(t){t.preventDefault(),t.stopPropagation()}function k(t,e,i){var s,n=[],o=t.attr("class").trim();o&&v((o=""+o).split(/\s+/)).each2(function(){0===this.indexOf("select2-")&&n.push(this)}),(o=e.attr("class").trim())&&v((o=""+o).split(/\s+/)).each2(function(){0!==this.indexOf("select2-")&&(s=i(this))&&n.push(s)}),t.attr("class",n.join(" "))}function S(t,e,i,s){var n=l(t.toUpperCase()).indexOf(l(e.toUpperCase())),e=e.length;n<0?i.push(s(t)):(i.push(s(t.substring(0,n))),i.push("<span class='select2-match'>"),i.push(s(t.substring(n,n+e))),i.push("</span>"),i.push(s(t.substring(n+e,t.length))))}function x(t){var e={"\\":"&#92;","&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#47;"};return String(t).replace(/[&<>"'\/\\]/g,function(t){return e[t]})}function M(o){var t,a=null,e=o.quietMillis||100,r=o.url,h=this;return function(n){window.clearTimeout(t),t=window.setTimeout(function(){var t=o.data,e=r,i=o.transport||v.fn.select2.ajaxDefaults.transport,s={type:o.type||"GET",cache:o.cache||!1,jsonpCallback:o.jsonpCallback||w,dataType:o.dataType||"json"},s=v.extend({},v.fn.select2.ajaxDefaults.params,s),t=t?t.call(h,n.term,n.page,n.context):null,e="function"==typeof e?e.call(h,n.term,n.page,n.context):e;a&&"function"==typeof a.abort&&a.abort(),o.params&&(v.isFunction(o.params)?v.extend(s,o.params.call(h)):v.extend(s,o.params)),v.extend(s,{url:e,dataType:o.dataType,data:t,success:function(t){t=o.results(t,n.page,n);n.callback(t)},error:function(t,e,i){n.callback({hasError:!0,jqXHR:t,textStatus:e,errorThrown:i})}}),a=i.call(h,s)},e)}}function T(t){var e,i,s=t,r=function(t){return""+t.text},t=(v.isArray(s)&&(s={results:i=s}),!1===v.isFunction(s)&&(i=s,s=function(){return i}),s());return t.text&&(r=t.text,v.isFunction(r)||(e=t.text,r=function(t){return t[e]})),function(n){var o,a=n.term,i={results:[]};""===a?n.callback(s()):(o=function(t,e){var i,s;if((t=t[0]).children){for(s in i={},t)t.hasOwnProperty(s)&&(i[s]=t[s]);i.children=[],v(t.children).each2(function(t,e){o(e,i.children)}),(i.children.length||n.matcher(a,r(i),t))&&e.push(i)}else n.matcher(a,r(t),t)&&e.push(t)},v(s().results).each2(function(t,e){o(e,i.results)}),n.callback(i))}}function E(e){var o=v.isFunction(e);return function(i){var s=i.term,n={results:[]},t=o?e(i):e;v.isArray(t)&&(v(t).each(function(){var t=this.text!==w,e=t?this.text:this;""!==s&&!i.matcher(s,e)||n.results.push(t?this:{id:this,text:this})}),i.callback(n))}}function $(t,e){if(v.isFunction(t))return 1;if(t){if("string"==typeof t)return 1;throw new Error(e+" must be a string, function, or falsy value")}}function O(t,e){var i;return v.isFunction(t)?(i=Array.prototype.slice.call(arguments,2),t.apply(e,i)):t}function D(){var i=this;v.each(arguments,function(t,e){i[e].remove(),i[e]=null})}function P(t,e){function i(){}return((i.prototype=new t).constructor=i).prototype.parent=t.prototype,i.prototype=v.extend(i.prototype,e),i}window.Select2===w&&(r={x:0,y:0},c={TAB:9,ENTER:13,ESC:27,SPACE:32,LEFT:37,UP:38,RIGHT:39,DOWN:40,SHIFT:16,CTRL:17,ALT:18,PAGE_UP:33,PAGE_DOWN:34,HOME:36,END:35,BACKSPACE:8,DELETE:46,isArrow:function(t){switch(t=t.which||t){case c.LEFT:case c.RIGHT:case c.UP:case c.DOWN:return!0}return!1},isControl:function(t){switch(t.which){case c.SHIFT:case c.CTRL:case c.ALT:return!0}return!!t.metaKey},isFunctionKey:function(t){return 112<=(t=t.which||t)&&t<=123}},s={"Ⓐ":"A","Ａ":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","Ｂ":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ɓ":"B","Ⓒ":"C","Ｃ":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","Ç":"C","Ḉ":"C","Ƈ":"C","Ȼ":"C","Ꜿ":"C","Ⓓ":"D","Ｄ":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ƌ":"D","Ɗ":"D","Ɖ":"D","Ꝺ":"D","Ǳ":"DZ","Ǆ":"DZ","ǲ":"Dz","ǅ":"Dz","Ⓔ":"E","Ｅ":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","Ⓕ":"F","Ｆ":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","Ｇ":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","Ⓗ":"H","Ｈ":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","Ｉ":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","Ｊ":"J","Ĵ":"J","Ɉ":"J","Ⓚ":"K","Ｋ":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","Ｌ":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","Ǉ":"LJ","ǈ":"Lj","Ⓜ":"M","Ｍ":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","Ⓝ":"N","Ｎ":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ƞ":"N","Ɲ":"N","Ꞑ":"N","Ꞥ":"N","Ǌ":"NJ","ǋ":"Nj","Ⓞ":"O","Ｏ":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","Ｐ":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Ｑ":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","Ｒ":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R","Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꝛ":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","Ｓ":"S","ẞ":"S","Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S","Ꞅ":"S","Ⓣ":"T","Ｔ":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T","Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"TZ","Ⓤ":"U","Ｕ":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ǜ":"U","Ǘ":"U","Ǖ":"U","Ǚ":"U","Ủ":"U","Ů":"U","Ű":"U","Ǔ":"U","Ȕ":"U","Ȗ":"U","Ư":"U","Ừ":"U","Ứ":"U","Ữ":"U","Ử":"U","Ự":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","Ṵ":"U","Ʉ":"U","Ⓥ":"V","Ｖ":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","Ｗ":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","Ｘ":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Ｙ":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Ｚ":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","ａ":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","ｂ":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","ｃ":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","ⓓ":"d","ｄ":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","ꝺ":"d","ǳ":"dz","ǆ":"dz","ⓔ":"e","ｅ":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ɛ":"e","ǝ":"e","ⓕ":"f","ｆ":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","ｇ":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ᵹ":"g","ꝿ":"g","ⓗ":"h","ｈ":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","ｉ":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","ｊ":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","ｋ":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","ｌ":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","ǉ":"lj","ⓜ":"m","ｍ":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","ｎ":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ŉ":"n","ꞑ":"n","ꞥ":"n","ǌ":"nj","ⓞ":"o","ｏ":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ɔ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","ｐ":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","ｑ":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","ｒ":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","ｓ":"s","ß":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ⓣ":"t","ｔ":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","ｕ":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","ｖ":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","ｗ":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","ｘ":"x","ẋ":"x","ẍ":"x","ⓨ":"y","ｙ":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","ｚ":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ω":"ω","ς":"σ"},a=v(document),o=1,y=function(){return o++},t=P(Object,{bind:function(t){var e=this;return function(){t.apply(e,arguments)}},init:function(t){var o,e,i,s,n=".select2-results",a=(this.opts=t=this.prepareOpts(t),this.id=t.id,t.element.data("select2")!==w&&null!==t.element.data("select2")&&t.element.data("select2").destroy(),this.container=this.createContainer(),this.liveRegion=v("<span>",{role:"status","aria-live":"polite"}).addClass("select2-hidden-accessible").appendTo(document.body),this.containerId="s2id_"+(t.element.attr("id")||"autogen"+y()),this.containerEventName=this.containerId.replace(/([.])/g,"_").replace(/([;&,\-\.\+\*\~':"\!\^#$%@\[\]\(\)=>\|])/g,"\\$1"),this.container.attr("id",this.containerId),this.container.attr("title",t.element.attr("title")),this.body=v("body"),k(this.container,this.opts.element,this.opts.adaptContainerCssClass),this.container.attr("style",t.element.attr("style")),this.container.css(O(t.containerCss,this.opts.element)),this.container.addClass(O(t.containerCssClass,this.opts.element)),this.elementTabIndex=this.opts.element.attr("tabindex"),this.opts.element.data("select2",this).attr("tabindex","-1").before(this.container).on("click.select2",C),this.container.data("select2",this),this.dropdown=this.container.find(".select2-drop"),k(this.dropdown,this.opts.element,this.opts.adaptDropdownCssClass),this.dropdown.addClass(O(t.dropdownCssClass,this.opts.element)),this.dropdown.data("select2",this),this.dropdown.on("click",C),this.results=o=this.container.find(n),this.search=e=this.container.find("input.select2-input"),this.queryCount=0,this.resultsPage=0,this.context=null,this.initContainer(),this.container.on("click",C),this.results.on("mousemove",function(t){var e=r;e!==w&&e.x===t.pageX&&e.y===t.pageY||v(t.target).trigger("mousemove-filtered",t)}),this.dropdown.on("mousemove-filtered",n,this.bind(this.highlightUnderEvent)),this.dropdown.on("touchstart touchmove touchend",n,this.bind(function(t){this._touchEvent=!0,this.highlightUnderEvent(t)})),this.dropdown.on("touchmove",n,this.bind(this.touchMoved)),this.dropdown.on("touchstart touchend",n,this.bind(this.clearTouchMoved)),this.dropdown.on("click",this.bind(function(t){this._touchEvent&&(this._touchEvent=!1,this.selectHighlighted())})),a=80,i=this.results,s=b(a,function(t){i.trigger("scroll-debounced",t)}),i.on("scroll",function(t){0<=d(t.target,i.get())&&s(t)}),this.dropdown.on("scroll-debounced",n,this.bind(this.loadMoreIfNeeded)),v(this.container).on("change",".select2-input",function(t){t.stopPropagation()}),v(this.dropdown).on("change",".select2-input",function(t){t.stopPropagation()}),v.fn.mousewheel&&o.mousewheel(function(t,e,i,s){var n=o.scrollTop();0<s&&n-s<=0?(o.scrollTop(0),C(t)):s<0&&o.get(0).scrollHeight-o.scrollTop()+s<=o.height()&&(o.scrollTop(o.get(0).scrollHeight-o.height()),C(t))}),m(e),e.on("keyup-change input paste",this.bind(this.updateResults)),e.on("focus",function(){e.addClass("select2-focused")}),e.on("blur",function(){e.removeClass("select2-focused")}),this.dropdown.on("mouseup",n,this.bind(function(t){0<v(t.target).closest(".select2-result-selectable").length&&(this.highlightUnderEvent(t),this.selectHighlighted(t))})),this.dropdown.on("click mouseup mousedown touchstart touchend focusin",function(t){t.stopPropagation()}),this.nextSearchTerm=w,v.isFunction(this.opts.initSelection)&&(this.initSelection(),this.monitorSource()),null!==t.maximumInputLength&&this.search.attr("maxlength",t.maximumInputLength),t.element.prop("disabled")),n=(this.enable(!(a=a===w?!1:a)),t.element.prop("readonly"));this.readonly(n=n===w?!1:n),g=g||((a=v("<div class='select2-measure-scrollbar'></div>")).appendTo("body"),n={width:a.width()-a[0].clientWidth,height:a.height()-a[0].clientHeight},a.remove(),n),this.autofocus=t.element.prop("autofocus"),t.element.prop("autofocus",!1),this.autofocus&&this.focus(),this.search.attr("placeholder",t.searchInputPlaceholder)},destroy:function(){var t=this.opts.element,e=t.data("select2"),i=this;this.close(),t.length&&t[0].detachEvent&&t.each(function(){this.detachEvent("onpropertychange",i._sync)}),this.propertyObserver&&(this.propertyObserver.disconnect(),this.propertyObserver=null),this._sync=null,e!==w&&(e.container.remove(),e.liveRegion.remove(),e.dropdown.remove(),t.removeClass("select2-offscreen").removeData("select2").off(".select2").prop("autofocus",this.autofocus||!1),this.elementTabIndex?t.attr({tabindex:this.elementTabIndex}):t.removeAttr("tabindex"),t.show()),D.call(this,"container","liveRegion","dropdown","results","search")},optionToData:function(t){return t.is("option")?{id:t.prop("value"),text:t.text(),element:t.get(),css:t.attr("class"),disabled:t.prop("disabled"),locked:u(t.attr("locked"),"locked")||u(t.data("locked"),!0)}:t.is("optgroup")?{text:t.attr("label"),children:[],element:t.get(),css:t.attr("class")}:void 0},prepareOpts:function(m){var e,t,g=this,a=m.element;if("select"===a.get(0).tagName.toLowerCase()&&(this.select=t=m.element),t&&v.each(["id","multiple","ajax","query","createSearchChoice","initSelection","data","tags"],function(){if(this in m)throw new Error("Option '"+this+"' is not allowed for Select2 when attached to a <select> element.")}),"function"!=typeof(m=v.extend({},{populateResults:function(t,e,d){var u=this.opts.id,p=this.liveRegion,f=function(t,e,i){for(var s,n,o,a,r,h=[],c=0,l=(t=m.sortResults(t,e,d)).length;c<l;c+=1)a=!(r=!0===(s=t[c]).disabled)&&u(s)!==w,n=s.children&&0<s.children.length,(o=v("<li></li>")).addClass("select2-results-dept-"+i),o.addClass("select2-result"),o.addClass(a?"select2-result-selectable":"select2-result-unselectable"),r&&o.addClass("select2-disabled"),n&&o.addClass("select2-result-with-children"),o.addClass(g.opts.formatResultCssClass(s)),o.attr("role","presentation"),(a=v(document.createElement("div"))).addClass("select2-result-label"),a.attr("id","select2-result-label-"+y()),a.attr("role","option"),(r=m.formatResult(s,a,d,g.opts.escapeMarkup))!==w&&(a.html(r),o.append(a)),n&&((r=v("<ul></ul>")).addClass("select2-result-sub"),f(s.children,r,i+1),o.append(r)),o.data("select2-data",s),h.push(o[0]);e.append(h),p.text(m.formatMatches(t.length))};f(e,t,0)}},v.fn.select2.defaults,m)).id&&(e=m.id,m.id=function(t){return t[e]}),v.isArray(m.element.data("select2Tags"))){if("tags"in m)throw"tags specified as both an attribute 'data-select2-tags' and in options of Select2 "+m.element.attr("id");m.tags=m.element.data("select2Tags")}if(t?(m.query=this.bind(function(s){var t,i={results:[],more:!1},n=s.term,o=function(t,e){var i;t.is("option")?s.matcher(n,t.text(),t)&&e.push(g.optionToData(t)):t.is("optgroup")&&(i=g.optionToData(t),t.children().each2(function(t,e){o(e,i.children)}),0<i.children.length&&e.push(i))},e=a.children();(e=this.getPlaceholder()!==w&&0<e.length&&(t=this.getPlaceholderOption())?e.not(t):e).each2(function(t,e){o(e,i.results)}),s.callback(i)}),m.id=function(t){return t.id}):"query"in m||("ajax"in m?((t=m.element.data("ajax-url"))&&0<t.length&&(m.ajax.url=t),m.query=M.call(m.element,m.ajax)):"data"in m?m.query=T(m.data):"tags"in m&&(m.query=E(m.tags),m.createSearchChoice===w&&(m.createSearchChoice=function(t){return{id:t.trim(),text:t.trim()}}),m.initSelection===w&&(m.initSelection=function(t,e){var i=[];v(p(t.val(),m.separator)).each(function(){var t={id:this,text:this},e=m.tags;v.isFunction(e)&&(e=e()),v(e).each(function(){if(u(this.id,t.id))return t=this,!1}),i.push(t)}),e(i)}))),"function"!=typeof m.query)throw"query function not defined for Select2 "+m.element.attr("id");if("top"===m.createSearchChoicePosition)m.createSearchChoicePosition=function(t,e){t.unshift(e)};else if("bottom"===m.createSearchChoicePosition)m.createSearchChoicePosition=function(t,e){t.push(e)};else if("function"!=typeof m.createSearchChoicePosition)throw"invalid createSearchChoicePosition option must be 'top', 'bottom' or a custom function";return m},monitorSource:function(){var t,e=this.opts.element,i=this;e.on("change.select2",this.bind(function(t){!0!==this.opts.element.data("select2-change-triggered")&&this.initSelection()})),this._sync=this.bind(function(){var t=e.prop("disabled"),t=(this.enable(!(t=t===w?!1:t)),e.prop("readonly"));this.readonly(t=t===w?!1:t),k(this.container,this.opts.element,this.opts.adaptContainerCssClass),this.container.addClass(O(this.opts.containerCssClass,this.opts.element)),k(this.dropdown,this.opts.element,this.opts.adaptDropdownCssClass),this.dropdown.addClass(O(this.opts.dropdownCssClass,this.opts.element))}),e.length&&e[0].attachEvent&&e.each(function(){this.attachEvent("onpropertychange",i._sync)}),(t=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver)!==w&&(this.propertyObserver&&(delete this.propertyObserver,this.propertyObserver=null),this.propertyObserver=new t(function(t){v.each(t,i._sync)}),this.propertyObserver.observe(e.get(0),{attributes:!0,subtree:!1}))},triggerSelect:function(t){t=v.Event("select2-selecting",{val:this.id(t),object:t,choice:t});return this.opts.element.trigger(t),!t.isDefaultPrevented()},triggerChange:function(t){t=v.extend({},t=t||{},{type:"change",val:this.val()}),this.opts.element.data("select2-change-triggered",!0),this.opts.element.trigger(t),this.opts.element.data("select2-change-triggered",!1),this.opts.element.trigger("click"),this.opts.blurOnChange&&this.opts.element.blur()},isInterfaceEnabled:function(){return!0===this.enabledInterface},enableInterface:function(){var t=this._enabled&&!this._readonly;return t!==this.enabledInterface&&(this.container.toggleClass("select2-container-disabled",!t),this.close(),this.enabledInterface=t,!0)},enable:function(t){this._enabled!==(t=t===w||t)&&(this._enabled=t,this.opts.element.prop("disabled",!t),this.enableInterface())},disable:function(){this.enable(!1)},readonly:function(t){this._readonly!==(t=t!==w&&t)&&(this._readonly=t,this.opts.element.prop("readonly",t),this.enableInterface())},opened:function(){return!!this.container&&this.container.hasClass("select2-dropdown-open")},positionDropdown:function(){var t,e,i=this.dropdown,s=this.container.offset(),n=this.container.outerHeight(!1),o=this.container.outerWidth(!1),a=i.outerHeight(!1),r=v(window),h=r.width(),c=r.height(),l=r.scrollLeft()+h,c=r.scrollTop()+c,d=s.top+n,u=s.left,c=d+a<=c,p=s.top-a>=r.scrollTop(),f=i.outerWidth(!1),m=u+f<=l;i.hasClass("select2-drop-above")?(t=!0,!p&&c&&(t=!(e=!0))):(t=!1,!c&&p&&(t=e=!0)),e&&(i.hide(),s=this.container.offset(),n=this.container.outerHeight(!1),o=this.container.outerWidth(!1),a=i.outerHeight(!1),l=r.scrollLeft()+h,r.scrollTop(),d=s.top+n,m=(u=s.left)+(f=i.outerWidth(!1))<=l,i.show(),this.focusSearch()),this.opts.dropdownAutoWidth?(c=v(".select2-results",i)[0],i.addClass("select2-drop-auto-width"),i.css("width",""),o<(f=i.outerWidth(!1)+(c.scrollHeight===c.clientHeight?0:g.width))?o=f:f=o,a=i.outerHeight(!1),m=u+f<=l):this.container.removeClass("select2-drop-auto-width"),"static"!==this.body.css("position")&&(d-=(p=this.body.offset()).top,u-=p.left),e={left:u=m?u:s.left+this.container.outerWidth(!1)-f,width:o},t?(e.top=s.top-a,e.bottom="auto",this.container.addClass("select2-drop-above"),i.addClass("select2-drop-above")):(e.top=d,e.bottom="auto",this.container.removeClass("select2-drop-above"),i.removeClass("select2-drop-above")),e=v.extend(e,O(this.opts.dropdownCss,this.opts.element)),i.css(e)},shouldOpen:function(){var t;return!this.opened()&&(!1!==this._enabled&&!0!==this._readonly&&(t=v.Event("select2-opening"),this.opts.element.trigger(t),!t.isDefaultPrevented()))},clearDropdownAlignmentPreference:function(){this.container.removeClass("select2-drop-above"),this.dropdown.removeClass("select2-drop-above")},open:function(){return!!this.shouldOpen()&&(this.opening(),a.on("mousemove.select2Event",function(t){r.x=t.pageX,r.y=t.pageY}),!0)},opening:function(){var i,t=this.containerEventName,e="scroll."+t,s="resize."+t,n="orientationchange."+t,o=(this.container.addClass("select2-dropdown-open").addClass("select2-container-active"),this.clearDropdownAlignmentPreference(),this.dropdown[0]!==this.body.children().last()[0]&&this.dropdown.detach().appendTo(this.body),0==(i=v("#select2-drop-mask")).length&&((i=v(document.createElement("div"))).attr("id","select2-drop-mask").attr("class","select2-drop-mask"),i.hide(),i.appendTo(this.body),i.on("mousedown touchstart click",function(t){h(i);var e=v("#select2-drop");0<e.length&&((e=e.data("select2")).opts.selectOnBlur&&e.selectHighlighted({noFocus:!0}),e.close(),t.preventDefault(),t.stopPropagation())})),this.dropdown.prev()[0]!==i[0]&&this.dropdown.before(i),v("#select2-drop").removeAttr("id"),this.dropdown.attr("id","select2-drop"),i.show(),this.positionDropdown(),this.dropdown.show(),this.positionDropdown(),this.dropdown.addClass("select2-drop-active"),this);this.container.parents().add(window).each(function(){v(this).on(s+" "+e+" "+n,function(t){o.opened()&&o.positionDropdown()})})},close:function(){var t,e,i,s;this.opened()&&(t=this.containerEventName,e="scroll."+t,i="resize."+t,s="orientationchange."+t,this.container.parents().add(window).each(function(){v(this).off(e).off(i).off(s)}),this.clearDropdownAlignmentPreference(),v("#select2-drop-mask").hide(),this.dropdown.removeAttr("id"),this.dropdown.hide(),this.container.removeClass("select2-dropdown-open").removeClass("select2-container-active"),this.results.empty(),a.off("mousemove.select2Event"),this.clearSearch(),this.search.removeClass("select2-active"),this.opts.element.trigger(v.Event("select2-close")))},externalSearch:function(t){this.open(),this.search.val(t),this.updateResults(!1)},clearSearch:function(){},getMaximumSelectionSize:function(){return O(this.opts.maximumSelectionSize,this.opts.element)},ensureHighlightVisible:function(){var t,e,i,s,n=this.results,o=this.highlight();o<0||(0==o?n.scrollTop(0):(i=this.findHighlightableChoices().find(".select2-result-label"),e=(s=((t=v(i[o])).offset()||{}).top||0)+t.outerHeight(!0),o===i.length-1&&0<(o=n.find("li.select2-more-results")).length&&(e=o.offset().top+o.outerHeight(!0)),(i=n.offset().top+n.outerHeight(!0))<e&&n.scrollTop(n.scrollTop()+(e-i)),(o=s-n.offset().top)<0&&"none"!=t.css("display")&&n.scrollTop(n.scrollTop()+o)))},findHighlightableChoices:function(){return this.results.find(".select2-result-selectable:not(.select2-disabled):not(.select2-selected)")},moveHighlight:function(t){for(var e=this.findHighlightableChoices(),i=this.highlight();-1<i&&i<e.length;){var s=v(e[i+=t]);if(s.hasClass("select2-result-selectable")&&!s.hasClass("select2-disabled")&&!s.hasClass("select2-selected")){this.highlight(i);break}}},highlight:function(t){var e=this.findHighlightableChoices();if(0===arguments.length)return d(e.filter(".select2-highlighted")[0],e.get());(t=t>=e.length?e.length-1:t)<0&&(t=0),this.removeHighlight(),(e=v(e[t])).addClass("select2-highlighted"),this.search.attr("aria-activedescendant",e.find(".select2-result-label").attr("id")),this.ensureHighlightVisible(),this.liveRegion.text(e.text()),(t=e.data("select2-data"))&&this.opts.element.trigger({type:"select2-highlight",val:this.id(t),choice:t})},removeHighlight:function(){this.results.find(".select2-highlighted").removeClass("select2-highlighted")},touchMoved:function(){this._touchMoved=!0},clearTouchMoved:function(){this._touchMoved=!1},countSelectableResults:function(){return this.findHighlightableChoices().length},highlightUnderEvent:function(t){var e,t=v(t.target).closest(".select2-result-selectable");0<t.length&&!t.is(".select2-highlighted")?(e=this.findHighlightableChoices(),this.highlight(e.index(t))):0==t.length&&this.removeHighlight()},loadMoreIfNeeded:function(){var e=this.results,i=e.find("li.select2-more-results"),s=this.resultsPage+1,n=this,o=this.search.val(),a=this.context;0!==i.length&&i.offset().top-e.offset().top-e.height()<=this.opts.loadMorePadding&&(i.addClass("select2-active"),this.opts.query({element:this.opts.element,term:o,page:s,context:a,matcher:this.opts.matcher,callback:this.bind(function(t){n.opened()&&(n.opts.populateResults.call(this,e,t.results,{term:o,page:s,context:a}),n.postprocessResults(t,!1,!1),!0===t.more?(i.detach().appendTo(e).text(O(n.opts.formatLoadMore,n.opts.element,s+1)),window.setTimeout(function(){n.loadMoreIfNeeded()},10)):i.remove(),n.positionDropdown(),n.resultsPage=s,n.context=t.context,this.opts.element.trigger({type:"select2-loaded",items:t}))})}))},tokenize:function(){},updateResults:function(i){var s=this.search,n=this.results,o=this.opts,a=this,t=s.val(),e=v.data(this.container,"select2-last-term");if((!0===i||!e||!u(t,e))&&(v.data(this.container,"select2-last-term",t),!0===i||!1!==this.showSearchInput&&this.opened())){var r=++this.queryCount,e=this.getMaximumSelectionSize();if(!(1<=e&&(t=this.data(),v.isArray(t)&&t.length>=e&&$(o.formatSelectionTooBig,"formatSelectionTooBig"))))return s.val().length<o.minimumInputLength?($(o.formatInputTooShort,"formatInputTooShort")?c("<li class='select2-no-results'>"+O(o.formatInputTooShort,o.element,s.val(),o.minimumInputLength)+"</li>"):c(""),void(i&&this.showSearch&&this.showSearch(!0))):void(o.maximumInputLength&&s.val().length>o.maximumInputLength?$(o.formatInputTooLong,"formatInputTooLong")?c("<li class='select2-no-results'>"+O(o.formatInputTooLong,o.element,s.val(),o.maximumInputLength)+"</li>"):c(""):(o.formatSearching&&0===this.findHighlightableChoices().length&&c("<li class='select2-searching'>"+O(o.formatSearching,o.element)+"</li>"),s.addClass("select2-active"),this.removeHighlight(),(t=this.tokenize())!=w&&null!=t&&s.val(t),this.resultsPage=1,o.query({element:o.element,term:s.val(),page:this.resultsPage,context:null,matcher:o.matcher,callback:this.bind(function(t){var e;r==this.queryCount&&(this.opened()?t.hasError!==w&&$(o.formatAjaxError,"formatAjaxError")?c("<li class='select2-ajax-error'>"+O(o.formatAjaxError,o.element,t.jqXHR,t.textStatus,t.errorThrown)+"</li>"):(this.context=t.context===w?null:t.context,this.opts.createSearchChoice&&""!==s.val()&&(e=this.opts.createSearchChoice.call(a,s.val(),t.results))!==w&&null!==e&&a.id(e)!==w&&null!==a.id(e)&&0===v(t.results).filter(function(){return u(a.id(this),a.id(e))}).length&&this.opts.createSearchChoicePosition(t.results,e),0===t.results.length&&$(o.formatNoMatches,"formatNoMatches")?c("<li class='select2-no-results'>"+O(o.formatNoMatches,o.element,s.val())+"</li>"):(n.empty(),a.opts.populateResults.call(this,n,t.results,{term:s.val(),page:this.resultsPage,context:null}),!0===t.more&&$(o.formatLoadMore,"formatLoadMore")&&(n.append("<li class='select2-more-results'>"+o.escapeMarkup(O(o.formatLoadMore,o.element,this.resultsPage))+"</li>"),window.setTimeout(function(){a.loadMoreIfNeeded()},10)),this.postprocessResults(t,i),h(),this.opts.element.trigger({type:"select2-loaded",items:t}))):this.search.removeClass("select2-active"))})})));c("<li class='select2-selection-limit'>"+O(o.formatSelectionTooBig,o.element,e)+"</li>")}function h(){s.removeClass("select2-active"),a.positionDropdown(),n.find(".select2-no-results,.select2-selection-limit,.select2-searching").length?a.liveRegion.text(n.text()):a.liveRegion.text(a.opts.formatMatches(n.find(".select2-result-selectable").length))}function c(t){n.html(t),h()}},cancel:function(){this.close()},blur:function(){this.opts.selectOnBlur&&this.selectHighlighted({noFocus:!0}),this.close(),this.container.removeClass("select2-container-active"),this.search[0]===document.activeElement&&this.search.blur(),this.clearSearch(),this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus")},focusSearch:function(){var i;(i=this.search)[0]!==document.activeElement&&window.setTimeout(function(){var t=i[0],e=i.val().length;i.focus(),(0<t.offsetWidth||0<t.offsetHeight)&&t===document.activeElement&&(t.setSelectionRange?t.setSelectionRange(e,e):t.createTextRange&&((e=t.createTextRange()).collapse(!1),e.select()))},0)},selectHighlighted:function(t){var e,i;this._touchMoved?this.clearTouchMoved():(e=this.highlight(),(i=this.results.find(".select2-highlighted").closest(".select2-result").data("select2-data"))?(this.highlight(e),this.onSelect(i,t)):t&&t.noFocus&&this.close())},getPlaceholder:function(){var t;return this.opts.element.attr("placeholder")||this.opts.element.attr("data-placeholder")||this.opts.element.data("placeholder")||this.opts.placeholder||((t=this.getPlaceholderOption())!==w?t.text():w)},getPlaceholderOption:function(){var t;if(this.select)return t=this.select.children("option").first(),this.opts.placeholderOption!==w?"first"===this.opts.placeholderOption&&t||"function"==typeof this.opts.placeholderOption&&this.opts.placeholderOption(this.select):""===t.text().trim()&&""===t.val()?t:void 0},initContainerWidth:function(){var t=function(){var t,e,i,s,n;if("off"===this.opts.width)return null;if("element"===this.opts.width)return 0===this.opts.element.outerWidth(!1)?"auto":this.opts.element.outerWidth(!1)+"px";if("copy"!==this.opts.width&&"resolve"!==this.opts.width)return v.isFunction(this.opts.width)?this.opts.width():this.opts.width;if((t=this.opts.element.attr("style"))!==w)for(s=0,n=(e=t.split(";")).length;s<n;s+=1)if(null!==(i=e[s].replace(/\s/g,"").match(/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i))&&1<=i.length)return i[1];return"resolve"===this.opts.width?0<(t=this.opts.element.css("width")).indexOf("%")?t:0===this.opts.element.outerWidth(!1)?"auto":this.opts.element.outerWidth(!1)+"px":null}.call(this);null!==t&&this.container.css("width",t)}}),e=P(t,{createContainer:function(){return v(document.createElement("div")).attr({class:"select2-container"}).html(["<a href='javascript:void(0)' class='select2-choice' tabindex='-1'>","   <span class='select2-chosen'>&#160;</span><abbr class='select2-search-choice-close'></abbr>","   <span class='select2-arrow' role='presentation'><b role='presentation'></b></span>","</a>","<label for='' class='select2-offscreen'></label>","<input class='select2-focusser select2-offscreen' type='text' aria-haspopup='true' role='button' />","<div class='select2-drop select2-display-none'>","   <div class='select2-search'>","       <label for='' class='select2-offscreen'></label>","       <input type='text' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' class='select2-input' role='combobox' aria-expanded='true'","       aria-autocomplete='list' />","   </div>","   <ul class='select2-results' role='listbox'>","   </ul>","</div>"].join(""))},enableInterface:function(){this.parent.enableInterface.apply(this,arguments)&&this.focusser.prop("disabled",!this.isInterfaceEnabled())},opening:function(){var t,e;0<=this.opts.minimumResultsForSearch&&this.showSearch(!0),this.parent.opening.apply(this,arguments),!1!==this.showSearchInput&&this.search.val(this.focusser.val()),this.opts.shouldFocusInput(this)&&(this.search.focus(),(t=this.search.get(0)).createTextRange?((e=t.createTextRange()).collapse(!1),e.select()):t.setSelectionRange&&(e=this.search.val().length,t.setSelectionRange(e,e))),""===this.search.val()&&this.nextSearchTerm!=w&&(this.search.val(this.nextSearchTerm),this.search.select()),this.focusser.prop("disabled",!0).val(""),this.updateResults(!0),this.opts.element.trigger(v.Event("select2-open"))},close:function(){this.opened()&&(this.parent.close.apply(this,arguments),this.focusser.prop("disabled",!1),this.opts.shouldFocusInput(this)&&this.focusser.focus())},focus:function(){this.opened()?this.close():(this.focusser.prop("disabled",!1),this.opts.shouldFocusInput(this)&&this.focusser.focus())},isFocused:function(){return this.container.hasClass("select2-container-active")},cancel:function(){this.parent.cancel.apply(this,arguments),this.focusser.prop("disabled",!1),this.opts.shouldFocusInput(this)&&this.focusser.focus()},destroy:function(){v("label[for='"+this.focusser.attr("id")+"']").attr("for",this.opts.element.attr("id")),this.parent.destroy.apply(this,arguments),D.call(this,"selection","focusser")},initContainer:function(){var e,t=this.container,i=this.dropdown,s=y(),s=(this.opts.minimumResultsForSearch<0?this.showSearch(!1):this.showSearch(!0),this.selection=e=t.find(".select2-choice"),this.focusser=t.find(".select2-focusser"),e.find(".select2-chosen").attr("id","select2-chosen-"+s),this.focusser.attr("aria-labelledby","select2-chosen-"+s),this.results.attr("id","select2-results-"+s),this.search.attr("aria-owns","select2-results-"+s),this.focusser.attr("id","s2id_autogen"+s),t=v("label[for='"+this.opts.element.attr("id")+"']"),this.focusser.prev().text(t.text()).attr("for",this.focusser.attr("id")),this.opts.element.attr("title"));this.opts.element.attr("title",s||t.text()),this.focusser.attr("tabindex",this.elementTabIndex),this.search.attr("id",this.focusser.attr("id")+"_search"),this.search.prev().text(v("label[for='"+this.focusser.attr("id")+"']").text()).attr("for",this.search.attr("id")),this.search.on("keydown",this.bind(function(t){if(this.isInterfaceEnabled()&&229!=t.keyCode)if(t.which===c.PAGE_UP||t.which===c.PAGE_DOWN)C(t);else switch(t.which){case c.UP:case c.DOWN:return this.moveHighlight(t.which===c.UP?-1:1),void C(t);case c.ENTER:return this.selectHighlighted(),void C(t);case c.TAB:return void this.selectHighlighted({noFocus:!0});case c.ESC:return this.cancel(t),void C(t)}})),this.search.on("blur",this.bind(function(t){document.activeElement===this.body.get(0)&&window.setTimeout(this.bind(function(){this.opened()&&this.search.focus()}),0)})),this.focusser.on("keydown",this.bind(function(t){if(this.isInterfaceEnabled()&&t.which!==c.TAB&&!c.isControl(t)&&!c.isFunctionKey(t)&&t.which!==c.ESC){if(!1!==this.opts.openOnEnter||t.which!==c.ENTER)return t.which==c.DOWN||t.which==c.UP||t.which==c.ENTER&&this.opts.openOnEnter?t.altKey||t.ctrlKey||t.shiftKey||t.metaKey?void 0:(this.open(),void C(t)):void(t.which!=c.DELETE&&t.which!=c.BACKSPACE||(this.opts.allowClear&&this.clear(),C(t)));C(t)}})),m(this.focusser),this.focusser.on("keyup-change input",this.bind(function(t){0<=this.opts.minimumResultsForSearch&&(t.stopPropagation(),this.opened()||this.open())})),e.on("mousedown touchstart","abbr",this.bind(function(t){this.isInterfaceEnabled()&&(this.clear(),(t=t).preventDefault(),t.stopImmediatePropagation(),this.close(),this.selection.focus())})),e.on("mousedown touchstart",this.bind(function(t){h(e),this.container.hasClass("select2-container-active")||this.opts.element.trigger(v.Event("select2-focus")),this.opened()?this.close():this.isInterfaceEnabled()&&this.open(),C(t)})),i.on("mousedown touchstart",this.bind(function(){this.opts.shouldFocusInput(this)&&this.search.focus()})),e.on("focus",this.bind(function(t){C(t)})),this.focusser.on("focus",this.bind(function(){this.container.hasClass("select2-container-active")||this.opts.element.trigger(v.Event("select2-focus")),this.container.addClass("select2-container-active")})).on("blur",this.bind(function(){this.opened()||(this.container.removeClass("select2-container-active"),this.opts.element.trigger(v.Event("select2-blur")))})),this.search.on("focus",this.bind(function(){this.container.hasClass("select2-container-active")||this.opts.element.trigger(v.Event("select2-focus")),this.container.addClass("select2-container-active")})),this.initContainerWidth(),this.opts.element.addClass("select2-offscreen"),this.setPlaceholder()},clear:function(t){var e,i=this.selection.data("select2-data");i&&(e=v.Event("select2-clearing"),this.opts.element.trigger(e),e.isDefaultPrevented()||(e=this.getPlaceholderOption(),this.opts.element.val(e?e.val():""),this.selection.find(".select2-chosen").empty(),this.selection.removeData("select2-data"),this.setPlaceholder(),!1!==t&&(this.opts.element.trigger({type:"select2-removed",val:this.id(i),choice:i}),this.triggerChange({removed:i}))))},initSelection:function(){var e;this.isPlaceholderOptionSelected()?(this.updateSelection(null),this.close(),this.setPlaceholder()):(e=this).opts.initSelection.call(null,this.opts.element,function(t){t!==w&&null!==t&&(e.updateSelection(t),e.close(),e.setPlaceholder(),e.nextSearchTerm=e.opts.nextSearchTerm(t,e.search.val()))})},isPlaceholderOptionSelected:function(){var t;return this.getPlaceholder()!==w&&((t=this.getPlaceholderOption())!==w&&t.prop("selected")||""===this.opts.element.val()||this.opts.element.val()===w||null===this.opts.element.val())},prepareOpts:function(){var a=this.parent.prepareOpts.apply(this,arguments),i=this;return"select"===a.element.get(0).tagName.toLowerCase()?a.initSelection=function(t,e){t=t.find("option").filter(function(){return this.selected&&!this.disabled});e(i.optionToData(t))}:"data"in a&&(a.initSelection=a.initSelection||function(t,e){var n=t.val(),o=null;a.query({matcher:function(t,e,i){var s=u(n,a.id(i));return s&&(o=i),s},callback:v.isFunction(e)?function(){e(o)}:v.noop})}),a},getPlaceholder:function(){return this.select&&this.getPlaceholderOption()===w?w:this.parent.getPlaceholder.apply(this,arguments)},setPlaceholder:function(){var t=this.getPlaceholder();!this.isPlaceholderOptionSelected()||t===w||this.select&&this.getPlaceholderOption()===w||(this.selection.find(".select2-chosen").html(this.opts.escapeMarkup(t)),this.selection.addClass("select2-default"),this.container.removeClass("select2-allowclear"))},postprocessResults:function(t,e,i){var s=0,n=this;this.findHighlightableChoices().each2(function(t,e){if(u(n.id(e.data("select2-data")),n.opts.element.val()))return s=t,!1}),!1!==i&&(!0===e&&0<=s?this.highlight(s):this.highlight(0)),!0===e&&0<=(i=this.opts.minimumResultsForSearch)&&this.showSearch(function i(t){var s=0;return v.each(t,function(t,e){e.children?s+=i(e.children):s++}),s}(t.results)>=i)},showSearch:function(t){this.showSearchInput!==t&&(this.showSearchInput=t,this.dropdown.find(".select2-search").toggleClass("select2-search-hidden",!t),this.dropdown.find(".select2-search").toggleClass("select2-offscreen",!t),v(this.dropdown,this.container).toggleClass("select2-with-searchbox",t))},onSelect:function(t,e){var i,s;this.triggerSelect(t)&&(i=this.opts.element.val(),s=this.data(),this.opts.element.val(this.id(t)),this.updateSelection(t),this.opts.element.trigger({type:"select2-selected",val:this.id(t),choice:t}),this.nextSearchTerm=this.opts.nextSearchTerm(t,this.search.val()),this.close(),e&&e.noFocus||!this.opts.shouldFocusInput(this)||this.focusser.focus(),u(i,this.id(t))||this.triggerChange({added:t,removed:s}))},updateSelection:function(t){var e,i=this.selection.find(".select2-chosen");this.selection.data("select2-data",t),i.empty(),(e=null!==t?this.opts.formatSelection(t,i,this.opts.escapeMarkup):e)!==w&&i.append(e),(e=this.opts.formatSelectionCssClass(t,i))!==w&&i.addClass(e),this.selection.removeClass("select2-default"),this.opts.allowClear&&this.getPlaceholder()!==w&&this.container.addClass("select2-allowclear")},val:function(){var t,e=!1,i=null,s=this,n=this.data();if(0===arguments.length)return this.opts.element.val();if(t=arguments[0],1<arguments.length&&(e=arguments[1]),this.select)this.select.val(t).find("option").filter(function(){return this.selected}).each2(function(t,e){return i=s.optionToData(e),!1}),this.updateSelection(i),this.setPlaceholder(),e&&this.triggerChange({added:i,removed:n});else if(t||0===t){if(this.opts.initSelection===w)throw new Error("cannot call val() if initSelection() is not defined");this.opts.element.val(t),this.opts.initSelection(this.opts.element,function(t){s.opts.element.val(t?s.id(t):""),s.updateSelection(t),s.setPlaceholder(),e&&s.triggerChange({added:t,removed:n})})}else this.clear(e)},clearSearch:function(){this.search.val(""),this.focusser.val("")},data:function(t){var e,i=!1;if(0===arguments.length)return e=(e=this.selection.data("select2-data"))==w?null:e;1<arguments.length&&(i=arguments[1]),t?(e=this.data(),this.opts.element.val(t?this.id(t):""),this.updateSelection(t),i&&this.triggerChange({added:t,removed:e})):this.clear(i)}}),i=P(t,{createContainer:function(){return v(document.createElement("div")).attr({class:"select2-container select2-container-multi"}).html(["<ul class='select2-choices'>","  <li class='select2-search-field'>","    <label for='' class='select2-offscreen'></label>","    <input type='text' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' class='select2-input'>","  </li>","</ul>","<div class='select2-drop select2-drop-multi select2-display-none'>","   <ul class='select2-results'>","   </ul>","</div>"].join(""))},prepareOpts:function(){var h=this.parent.prepareOpts.apply(this,arguments),s=this;return"select"===h.element.get(0).tagName.toLowerCase()?h.initSelection=function(t,e){var i=[];t.find("option").filter(function(){return this.selected&&!this.disabled}).each2(function(t,e){i.push(s.optionToData(e))}),e(i)}:"data"in h&&(h.initSelection=h.initSelection||function(t,o){var a=p(t.val(),h.separator),r=[];h.query({matcher:function(t,e,i){var s=v.grep(a,function(t){return u(t,h.id(i))}).length;return s&&r.push(i),s},callback:v.isFunction(o)?function(){for(var t=[],e=0;e<a.length;e++)for(var i=a[e],s=0;s<r.length;s++){var n=r[s];if(u(i,h.id(n))){t.push(n),r.splice(s,1);break}}o(t)}:v.noop})}),h},selectChoice:function(t){var e=this.container.find(".select2-search-choice-focus");e.length&&t&&t[0]==e[0]||(e.length&&this.opts.element.trigger("choice-deselected",e),e.removeClass("select2-search-choice-focus"),t&&t.length&&(this.close(),t.addClass("select2-search-choice-focus"),this.opts.element.trigger("choice-selected",t)))},destroy:function(){v("label[for='"+this.search.attr("id")+"']").attr("for",this.opts.element.attr("id")),this.parent.destroy.apply(this,arguments),D.call(this,"searchContainer","selection")},initContainer:function(){var h,t=".select2-choices",e=(this.searchContainer=this.container.find(".select2-search-field"),this.selection=h=this.container.find(t),this);this.selection.on("click",".select2-search-choice:not(.select2-locked)",function(t){e.search[0].focus(),e.selectChoice(v(this))}),this.search.attr("id","s2id_autogen"+y()),this.search.prev().text(v("label[for='"+this.opts.element.attr("id")+"']").text()).attr("for",this.search.attr("id")),this.search.on("input paste",this.bind(function(){this.search.attr("placeholder")&&0==this.search.val().length||!this.isInterfaceEnabled()||this.opened()||this.open()})),this.search.attr("tabindex",this.elementTabIndex),this.keydowns=0,this.search.on("keydown",this.bind(function(t){if(this.isInterfaceEnabled()){++this.keydowns;var e,i,s,n=h.find(".select2-search-choice-focus"),o=n.prev(".select2-search-choice:not(.select2-locked)"),a=n.next(".select2-search-choice:not(.select2-locked)"),r=(r=this.search,i=e=0,"selectionStart"in(r=v(r)[0])?(e=r.selectionStart,i=r.selectionEnd-e):"selection"in document&&(r.focus(),s=document.selection.createRange(),i=document.selection.createRange().text.length,s.moveStart("character",-r.value.length),e=s.text.length-i),{offset:e,length:i});if(n.length&&(t.which==c.LEFT||t.which==c.RIGHT||t.which==c.BACKSPACE||t.which==c.DELETE||t.which==c.ENTER))return s=n,t.which==c.LEFT&&o.length?s=o:t.which==c.RIGHT?s=a.length?a:null:t.which===c.BACKSPACE?this.unselect(n.first())&&(this.search.width(10),s=o.length?o:a):t.which==c.DELETE?this.unselect(n.first())&&(this.search.width(10),s=a.length?a:null):t.which==c.ENTER&&(s=null),this.selectChoice(s),C(t),void(s&&s.length||this.open());if((t.which===c.BACKSPACE&&1==this.keydowns||t.which==c.LEFT)&&0==r.offset&&!r.length)return this.selectChoice(h.find(".select2-search-choice:not(.select2-locked)").last()),void C(t);if(this.selectChoice(null),this.opened())switch(t.which){case c.UP:case c.DOWN:return this.moveHighlight(t.which===c.UP?-1:1),void C(t);case c.ENTER:return this.selectHighlighted(),void C(t);case c.TAB:return this.selectHighlighted({noFocus:!0}),void this.close();case c.ESC:return this.cancel(t),void C(t)}if(t.which!==c.TAB&&!c.isControl(t)&&!c.isFunctionKey(t)&&t.which!==c.BACKSPACE&&t.which!==c.ESC){if(t.which===c.ENTER){if(!1===this.opts.openOnEnter)return;if(t.altKey||t.ctrlKey||t.shiftKey||t.metaKey)return}this.open(),t.which!==c.PAGE_UP&&t.which!==c.PAGE_DOWN||C(t),t.which===c.ENTER&&C(t)}}})),this.search.on("keyup",this.bind(function(t){this.keydowns=0,this.resizeSearch()})),this.search.on("blur",this.bind(function(t){this.container.removeClass("select2-container-active"),this.search.removeClass("select2-focused"),this.selectChoice(null),this.opened()||this.clearSearch(),t.stopImmediatePropagation(),this.opts.element.trigger(v.Event("select2-blur"))})),this.container.on("click",t,this.bind(function(t){!this.isInterfaceEnabled()||0<v(t.target).closest(".select2-search-choice").length||(this.selectChoice(null),this.clearPlaceholder(),this.container.hasClass("select2-container-active")||this.opts.element.trigger(v.Event("select2-focus")),this.open(),this.focusSearch(),t.preventDefault())})),this.container.on("focus",t,this.bind(function(){this.isInterfaceEnabled()&&(this.container.hasClass("select2-container-active")||this.opts.element.trigger(v.Event("select2-focus")),this.container.addClass("select2-container-active"),this.dropdown.addClass("select2-drop-active"),this.clearPlaceholder())})),this.initContainerWidth(),this.opts.element.addClass("select2-offscreen"),this.clearSearch()},enableInterface:function(){this.parent.enableInterface.apply(this,arguments)&&this.search.prop("disabled",!this.isInterfaceEnabled())},initSelection:function(){var e;""===this.opts.element.val()&&""===this.opts.element.text()&&(this.updateSelection([]),this.close(),this.clearSearch()),!this.select&&""===this.opts.element.val()||(e=this).opts.initSelection.call(null,this.opts.element,function(t){t!==w&&null!==t&&(e.updateSelection(t),e.close(),e.clearSearch())})},clearSearch:function(){var t=this.getPlaceholder(),e=this.getMaxSearchWidth();t!==w&&0===this.getVal().length&&!1===this.search.hasClass("select2-focused")?(this.search.val(t).addClass("select2-default"),this.search.width(0<e?e:this.container.css("width"))):this.search.val("").width(10)},clearPlaceholder:function(){this.search.hasClass("select2-default")&&this.search.val("").removeClass("select2-default")},opening:function(){this.clearPlaceholder(),this.resizeSearch(),this.parent.opening.apply(this,arguments),this.focusSearch(),""===this.search.val()&&this.nextSearchTerm!=w&&(this.search.val(this.nextSearchTerm),this.search.select()),this.updateResults(!0),this.opts.shouldFocusInput(this)&&this.search.focus(),this.opts.element.trigger(v.Event("select2-open"))},close:function(){this.opened()&&this.parent.close.apply(this,arguments)},focus:function(){this.close(),this.search.focus()},isFocused:function(){return this.search.hasClass("select2-focused")},updateSelection:function(t){var e=[],i=[],s=this;v(t).each(function(){d(s.id(this),e)<0&&(e.push(s.id(this)),i.push(this))}),t=i,this.selection.find(".select2-search-choice").remove(),v(t).each(function(){s.addSelectedChoice(this)}),s.postprocessResults()},tokenize:function(){var t=this.search.val();null!=(t=this.opts.tokenizer.call(this,t,this.data(),this.bind(this.onSelect),this.opts))&&t!=w&&(this.search.val(t),0<t.length&&this.open())},onSelect:function(t,e){this.triggerSelect(t)&&""!==t.text&&(this.addSelectedChoice(t),this.opts.element.trigger({type:"selected",val:this.id(t),choice:t}),this.nextSearchTerm=this.opts.nextSearchTerm(t,this.search.val()),this.clearSearch(),this.updateResults(),!this.select&&this.opts.closeOnSelect||this.postprocessResults(t,!1,!0===this.opts.closeOnSelect),!this.opts.closeOnSelect&&0<this.countSelectableResults()?(this.search.width(10),this.resizeSearch(),0<this.getMaximumSelectionSize()&&this.val().length>=this.getMaximumSelectionSize()?this.updateResults(!0):this.nextSearchTerm!=w&&(this.search.val(this.nextSearchTerm),this.updateResults(),this.search.select()),this.positionDropdown()):(this.close(),this.search.width(10)),this.triggerChange({added:t}),e&&e.noFocus||this.focusSearch())},cancel:function(){this.close(),this.focusSearch()},addSelectedChoice:function(t){var e=!t.locked,i=v("<li class='select2-search-choice'>    <div></div>    <a href='#' class='select2-search-choice-close' tabindex='-1'></a></li>"),s=v("<li class='select2-search-choice select2-locked'><div></div></li>"),i=e?i:s,s=this.id(t),n=this.getVal(),o=this.opts.formatSelection(t,i.find("div"),this.opts.escapeMarkup);o!=w&&i.find("div").replaceWith("<div>"+o+"</div>"),(o=this.opts.formatSelectionCssClass(t,i.find("div")))!=w&&i.addClass(o),e&&i.find(".select2-search-choice-close").on("mousedown",C).on("click dblclick",this.bind(function(t){this.isInterfaceEnabled()&&(this.unselect(v(t.target)),this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus"),C(t),this.close(),this.focusSearch())})).on("focus",this.bind(function(){this.isInterfaceEnabled()&&(this.container.addClass("select2-container-active"),this.dropdown.addClass("select2-drop-active"))})),i.data("select2-data",t),i.insertBefore(this.searchContainer),n.push(s),this.setVal(n)},unselect:function(t){var e,i,s=this.getVal();if(0===(t=t.closest(".select2-search-choice")).length)throw"Invalid argument: "+t+". Must be .select2-search-choice";if(e=t.data("select2-data")){var n=v.Event("select2-removing");if(n.val=this.id(e),n.choice=e,this.opts.element.trigger(n),n.isDefaultPrevented())return!1;for(;0<=(i=d(this.id(e),s));)s.splice(i,1),this.setVal(s),this.select&&this.postprocessResults();return t.remove(),this.opts.element.trigger({type:"select2-removed",val:this.id(e),choice:e}),this.triggerChange({removed:e}),!0}},postprocessResults:function(t,e,i){var s=this.getVal(),n=this.results.find(".select2-result"),o=this.results.find(".select2-result-with-children"),a=this;n.each2(function(t,e){0<=d(a.id(e.data("select2-data")),s)&&(e.addClass("select2-selected"),e.find(".select2-result-selectable").addClass("select2-selected"))}),o.each2(function(t,e){e.is(".select2-result-selectable")||0!==e.find(".select2-result-selectable:not(.select2-selected)").length||e.addClass("select2-selected")}),-1==this.highlight()&&!1!==i&&a.highlight(0),!this.opts.createSearchChoice&&0<!n.filter(".select2-result:not(.select2-selected)").length&&(t&&(t.more||0!==this.results.find(".select2-no-results").length)||$(a.opts.formatNoMatches,"formatNoMatches")&&this.results.append("<li class='select2-no-results'>"+O(a.opts.formatNoMatches,a.opts.element,a.search.val())+"</li>"))},getMaxSearchWidth:function(){return this.selection.width()-f(this.search)},resizeSearch:function(){var t,e,i,s=f(this.search);e=this.search,n||(i=e[0].currentStyle||window.getComputedStyle(e[0],null),(n=v(document.createElement("div")).css({position:"absolute",left:"-10000px",top:"-10000px",display:"none",fontSize:i.fontSize,fontFamily:i.fontFamily,fontStyle:i.fontStyle,fontWeight:i.fontWeight,letterSpacing:i.letterSpacing,textTransform:i.textTransform,whiteSpace:"nowrap"})).attr("class","select2-sizer"),v("body").append(n)),n.text(e.val()),i=n.width()+10,e=this.search.offset().left,(e=(e=(e=(t=this.selection.width())-(e-this.selection.offset().left)-s)<i?t-s:e)<40?t-s:e)<=0&&(e=i),this.search.width(Math.floor(e))},getVal:function(){var t;return this.select?null===(t=this.select.val())?[]:t:p(t=this.opts.element.val(),this.opts.separator)},setVal:function(t){var e;this.select?this.select.val(t):(e=[],v(t).each(function(){d(this,e)<0&&e.push(this)}),this.opts.element.val(0===e.length?"":e.join(this.opts.separator)))},buildChangeDetails:function(t,e){for(var e=e.slice(0),t=t.slice(0),i=0;i<e.length;i++)for(var s=0;s<t.length;s++)u(this.opts.id(e[i]),this.opts.id(t[s]))&&(e.splice(i,1),0<i&&i--,t.splice(s,1),s--);return{added:e,removed:t}},val:function(t,i){var s,n=this;if(0===arguments.length)return this.getVal();if((s=this.data()).length||(s=[]),!t&&0!==t)return this.opts.element.val(""),this.updateSelection([]),this.clearSearch(),void(i&&this.triggerChange({added:this.data(),removed:s}));if(this.setVal(t),this.select)this.opts.initSelection(this.select,this.bind(this.updateSelection)),i&&this.triggerChange(this.buildChangeDetails(s,this.data()));else{if(this.opts.initSelection===w)throw new Error("val() cannot be called if initSelection() is not defined");this.opts.initSelection(this.opts.element,function(t){var e=v.map(t,n.id);n.setVal(e),n.updateSelection(t),n.clearSearch(),i&&n.triggerChange(n.buildChangeDetails(s,n.data()))})}this.clearSearch()},onSortStart:function(){if(this.select)throw new Error("Sorting of elements is not supported when attached to <select>. Attach to <input type='hidden'/> instead.");this.search.width(0),this.searchContainer.hide()},onSortEnd:function(){var t=[],e=this;this.searchContainer.show(),this.searchContainer.appendTo(this.searchContainer.parent()),this.resizeSearch(),this.selection.find(".select2-search-choice").each(function(){t.push(e.opts.id(v(this).data("select2-data")))}),this.setVal(t),this.triggerChange()},data:function(t,e){var i,s,n=this;if(0===arguments.length)return this.selection.children(".select2-search-choice").map(function(){return v(this).data("select2-data")}).get();s=this.data(),i=v.map(t=t||[],function(t){return n.opts.id(t)}),this.setVal(i),this.updateSelection(t),this.clearSearch(),e&&this.triggerChange(this.buildChangeDetails(s,this.data()))}}),v.fn.select2=function(){var t,e,i,s,n=Array.prototype.slice.call(arguments,0),o=["val","destroy","opened","open","close","focus","isFocused","container","dropdown","onSortStart","onSortEnd","enable","disable","readonly","positionDropdown","data","search"],a=["opened","isFocused","container","dropdown"],r=["val","data"],h={search:"externalSearch"};return this.each(function(){if(0===n.length||"object"==typeof n[0])(e=0===n.length?{}:v.extend({},n[0])).element=v(this),"select"===e.element.get(0).tagName.toLowerCase()?s=e.element.prop("multiple"):(s=e.multiple||!1,"tags"in e&&(e.multiple=s=!0)),(t=new(s?window.Select2.class.multi:window.Select2.class.single)).init(e);else{if("string"!=typeof n[0])throw"Invalid arguments to select2 plugin: "+n;if(d(n[0],o)<0)throw"Unknown method: "+n[0];if(i=w,(t=v(this).data("select2"))!==w)return e=n[0],i="container"===e?t.container:"dropdown"===e?t.dropdown:t[e=h[e]?h[e]:e].apply(t,n.slice(1)),!(0<=d(n[0],a)||0<=d(n[0],r)&&1==n.length)&&void 0}}),i===w?this:i},v.fn.select2.defaults={width:"copy",loadMorePadding:0,closeOnSelect:!0,openOnEnter:!0,containerCss:{},dropdownCss:{},containerCssClass:"",dropdownCssClass:"",formatResult:function(t,e,i,s){var n=[];return S(t.text,i.term,n,s),n.join("")},formatSelection:function(t,e,i){return t?i(t.text):w},sortResults:function(t,e,i){return t},formatResultCssClass:function(t){return t.css},formatSelectionCssClass:function(t,e){return w},minimumResultsForSearch:0,minimumInputLength:0,maximumInputLength:null,maximumSelectionSize:0,id:function(t){return t==w?null:t.id},matcher:function(t,e){return 0<=l(""+e).toUpperCase().indexOf(l(""+t).toUpperCase())},separator:",",tokenSeparators:[],tokenizer:function(t,e,i,s){var n,o,a,r,h,c=t,l=!1;if(!s.createSearchChoice||!s.tokenSeparators||s.tokenSeparators.length<1)return w;for(;;){for(o=-1,a=0,r=s.tokenSeparators.length;a<r&&(h=s.tokenSeparators[a],!(0<=(o=t.indexOf(h))));a++);if(o<0)break;if(n=t.substring(0,o),t=t.substring(o+h.length),0<n.length&&(n=s.createSearchChoice.call(this,n,e))!==w&&null!==n&&s.id(n)!==w&&null!==s.id(n)){for(l=!1,a=0,r=e.length;a<r;a++)if(u(s.id(n),s.id(e[a]))){l=!0;break}l||i(n)}}return c!==t?t:void 0},escapeMarkup:x,blurOnChange:!1,selectOnBlur:!1,adaptContainerCssClass:function(t){return t},adaptDropdownCssClass:function(t){return null},nextSearchTerm:function(t,e){return w},searchInputPlaceholder:"",createSearchChoicePosition:"top",shouldFocusInput:function(t){return!("ontouchstart"in window||0<navigator.msMaxTouchPoints)||!(t.opts.minimumResultsForSearch<0)}},v.fn.select2.locales=[],v.fn.select2.locales.en={formatMatches:function(t){return 1===t?"One result is available, press enter to select it.":t+" results are available, use up and down arrow keys to navigate."},formatNoMatches:function(){return"No matches found"},formatAjaxError:function(t,e,i){return"Loading failed"},formatInputTooShort:function(t,e){e-=t.length;return"Please enter "+e+" or more character"+(1==e?"":"s")},formatInputTooLong:function(t,e){t=t.length-e;return"Please delete "+t+" character"+(1==t?"":"s")},formatSelectionTooBig:function(t){return"You can only select "+t+" item"+(1==t?"":"s")},formatLoadMore:function(t){return"Loading more results…"},formatSearching:function(){return"Searching…"}},v.extend(v.fn.select2.defaults,v.fn.select2.locales.en),v.fn.select2.ajaxDefaults={transport:v.ajax,params:{type:"GET",cache:!1,dataType:"json"}},window.Select2={query:{ajax:M,local:T,tags:E},util:{debounce:b,markMatch:S,escapeMarkup:x,stripDiacritics:l},class:{abstract:t,single:e,multi:i}})}(jQuery),function(t,e){"object"==typeof exports?module.exports=e():"function"==typeof define&&define.amd?define(e):t.Spinner=e()}(this,function(){"use strict";var u,o=["webkit","Moz","ms","O"],d={};function p(t,e){var i,s=document.createElement(t||"div");for(i in e)s[i]=e[i];return s}function f(t){for(var e=1,i=arguments.length;e<i;e++)t.appendChild(arguments[e]);return t}t=p("style",{type:"text/css"}),f(document.getElementsByTagName("head")[0],t);var m=t.sheet||t.styleSheet;function s(t,e){var i,s,n=t.style;for(e=e.charAt(0).toUpperCase()+e.slice(1),s=0;s<o.length;s++)if(void 0!==n[i=o[s]+e])return i;if(void 0!==n[e])return e}function g(t,e){for(var i in e)t.style[s(t,i)||i]=e[i];return t}function e(t){for(var e=1;e<arguments.length;e++){var i,s=arguments[e];for(i in s)void 0===t[i]&&(t[i]=s[i])}return t}function v(t,e){return"string"==typeof t?t:t[e%t.length]}var i={lines:12,length:7,width:5,radius:10,rotate:0,corners:1,color:"#000",direction:1,speed:1,trail:100,opacity:.25,fps:20,zIndex:2e9,className:"spinner",top:"50%",left:"50%",position:"absolute"};function n(t){this.opts=e(t||{},n.defaults,i)}n.defaults={},e(n.prototype,{spin:function(t){this.stop();var i,s,n,o,a,r,h,c=this,l=c.opts,d=c.el=g(p(0,{className:l.className}),{position:l.position,width:0,zIndex:l.zIndex});l.radius,l.length,l.width;return g(d,{left:l.left,top:l.top}),t&&t.insertBefore(d,t.firstChild||null),d.setAttribute("role","progressbar"),c.lines(d,c.opts),u||(i=0,s=(l.lines-1)*(1-l.direction)/2,o=l.fps,a=o/l.speed,r=(1-l.opacity)/(a*l.trail/100),h=a/l.lines,function t(){i++;for(var e=0;e<l.lines;e++)n=Math.max(1-(i+(l.lines-e)*h)%a*r,l.opacity),c.opacity(d,e*l.direction+s,n,l);c.timeout=c.el&&setTimeout(t,~~(1e3/o))}()),c},stop:function(){var t=this.el;return t&&(clearTimeout(this.timeout),t.parentNode&&t.parentNode.removeChild(t),this.el=void 0),this},lines:function(t,i){var e,s,n,o,a,r,h=0,c=(i.lines-1)*(1-i.direction)/2;function l(t,e){return g(p(),{position:"absolute",width:i.length+i.width+"px",height:i.width+"px",background:t,boxShadow:e,transformOrigin:"left",transform:"rotate("+~~(360/i.lines*h+i.rotate)+"deg) translate("+i.radius+"px,0)",borderRadius:(i.corners*i.width>>1)+"px"})}for(;h<i.lines;h++)r=g(p(),{position:"absolute",top:1+~(i.width/2)+"px",transform:i.hwaccel?"translate3d(0,0,0)":"",opacity:i.opacity,animation:u&&(e=i.opacity,s=i.trail,n=c+h*i.direction,o=i.lines,r=a=void 0,a=["opacity",s,~~(100*e),n,o].join("-"),n=.01+n/o*100,o=Math.max(1-(1-e)/s*(100-n),e),r=u.substring(0,u.indexOf("Animation")).toLowerCase(),d[a]||(m.insertRule("@"+(r&&"-"+r+"-"||"")+"keyframes "+a+"{0%{opacity:"+o+"}"+n+"%{opacity:"+e+"}"+(.01+n)+"%{opacity:1}"+(n+s)%100+"%{opacity:"+e+"}100%{opacity:"+o+"}}",m.cssRules.length),d[a]=1),a+" "+1/i.speed+"s linear infinite")}),i.shadow&&f(r,g(l("#000","0 0 4px #000"),{top:"2px"})),f(t,f(r,l(v(i.color,h),"0 0 1px rgba(0,0,0,.1)")));return t},opacity:function(t,e,i){e<t.childNodes.length&&(t.childNodes[e].style.opacity=i)}});var t=g(p("group"),{behavior:"url(#default#VML)"});function c(t,e){return p("<"+t+' xmlns="urn:schemas-microsoft.com:vml" class="spin-vml">',e)}return!s(t,"transform")&&t.adj?(m.addRule(".spin-vml","behavior:url(#default#VML)"),n.prototype.lines=function(t,s){var n=s.length+s.width,e=2*n;function o(){return g(c("group",{coordsize:e+" "+e,coordorigin:-n+" "+-n}),{width:e,height:e})}var i,a=2*-(s.width+s.length)+"px",r=g(o(),{position:"absolute",top:a,left:a});function h(t,e,i){f(r,f(g(o(),{rotation:360/s.lines*t+"deg",left:~~e}),f(g(c("roundrect",{arcsize:s.corners}),{width:n,height:s.width,left:s.radius,top:-s.width>>1,filter:i}),c("fill",{color:v(s.color,t),opacity:s.opacity}),c("stroke",{opacity:0}))))}if(s.shadow)for(i=1;i<=s.lines;i++)h(i,-2,"progid:DXImageTransform.Microsoft.Blur(pixelradius=2,makeshadow=1,shadowopacity=.3)");for(i=1;i<=s.lines;i++)h(i);return f(t,r)},n.prototype.opacity=function(t,e,i,s){t=t.firstChild;s=s.shadow&&s.lines||0,t&&e+s<t.childNodes.length&&(t=(t=(t=t.childNodes[e+s])&&t.firstChild)&&t.firstChild)&&(t.opacity=i)}):u=s(t,"animation"),n});