/*!
Chosen, a Select Box Enhancer for jQuery and Prototype
by Patrick Filler for Harvest, http://getharvest.com

Version 1.6.1
Full source at https://github.com/harvesthq/chosen
Copyright (c) 2011-2016 Harvest http://getharvest.com

MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md
This file is generated by `grunt build`, do not edit it by hand.
*/

(function(){var a,b,c,d,e,f={}.hasOwnProperty,g=function(a,b){function d(){this.constructor=a}for(var c in b)f.call(b,c)&&(a[c]=b[c]);return d.prototype=b.prototype,a.prototype=new d,a.__super__=b.prototype,a};d=function(){function a(){this.options_index=0,this.parsed=[]}return a.prototype.add_node=function(a){return"OPTGROUP"===a.nodeName.toUpperCase()?this.add_group(a):this.add_option(a)},a.prototype.add_group=function(a){var b,c,d,e,f,g;for(b=this.parsed.length,this.parsed.push({array_index:b,group:!0,label:this.escapeExpression(a.label),title:a.title?a.title:void 0,children:0,disabled:a.disabled,classes:a.className}),f=a.childNodes,g=[],d=0,e=f.length;d<e;d++)c=f[d],g.push(this.add_option(c,b,a.disabled));return g},a.prototype.add_option=function(a,b,c){if("OPTION"===a.nodeName.toUpperCase())return""!==a.text?(null!=b&&(this.parsed[b].children+=1),this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,value:a.value,text:a.text,html:a.innerHTML,title:a.title?a.title:void 0,selected:a.selected,disabled:c===!0?c:a.disabled,group_array_index:b,group_label:null!=b?this.parsed[b].label:null,classes:a.className,style:a.style.cssText})):this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,empty:!0}),this.options_index+=1},a.prototype.escapeExpression=function(a){var b,c;return null==a||a===!1?"":/[\&\<\>\"\'\`]/.test(a)?(b={"<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},c=/&(?!\w+;)|[\<\>\"\'\`]/g,a.replace(c,function(a){return b[a]||"&amp;"})):a},a}(),d.select_to_array=function(a){var b,c,e,f,g;for(c=new d,g=a.childNodes,e=0,f=g.length;e<f;e++)b=g[e],c.add_node(b);return c.parsed},b=function(){function a(b,c){this.form_field=b,this.options=null!=c?c:{},a.browser_is_supported()&&(this.is_multiple=this.form_field.multiple,this.set_default_text(),this.set_default_values(),this.setup(),this.set_up_html(),this.register_observers(),this.on_ready())}return a.prototype.set_default_values=function(){var a=this;return this.click_test_action=function(b){return a.test_active_click(b)},this.activate_action=function(b){return a.activate_field(b)},this.active_field=!1,this.mouse_on_container=!1,this.results_showing=!1,this.result_highlighted=null,this.allow_single_deselect=null!=this.options.allow_single_deselect&&null!=this.form_field.options[0]&&""===this.form_field.options[0].text&&this.options.allow_single_deselect,this.disable_search_threshold=this.options.disable_search_threshold||0,this.disable_search=this.options.disable_search||!1,this.enable_split_word_search=null==this.options.enable_split_word_search||this.options.enable_split_word_search,this.group_search=null==this.options.group_search||this.options.group_search,this.search_contains=this.options.search_contains||!1,this.single_backstroke_delete=null==this.options.single_backstroke_delete||this.options.single_backstroke_delete,this.max_selected_options=this.options.max_selected_options||1/0,this.inherit_select_classes=this.options.inherit_select_classes||!1,this.display_selected_options=null==this.options.display_selected_options||this.options.display_selected_options,this.display_disabled_options=null==this.options.display_disabled_options||this.options.display_disabled_options,this.include_group_label_in_selected=this.options.include_group_label_in_selected||!1,this.max_shown_results=this.options.max_shown_results||Number.POSITIVE_INFINITY,this.case_sensitive_search=this.options.case_sensitive_search||!1},a.prototype.set_default_text=function(){return this.form_field.getAttribute("data-placeholder")?this.default_text=this.form_field.getAttribute("data-placeholder"):this.is_multiple?this.default_text=this.options.placeholder_text_multiple||this.options.placeholder_text||a.default_multiple_text:this.default_text=this.options.placeholder_text_single||this.options.placeholder_text||a.default_single_text,this.results_none_found=this.form_field.getAttribute("data-no_results_text")||this.options.no_results_text||a.default_no_result_text},a.prototype.choice_label=function(a){return this.include_group_label_in_selected&&null!=a.group_label?"<b class='group-name'>"+a.group_label+"</b>"+a.html:a.html},a.prototype.mouse_enter=function(){return this.mouse_on_container=!0},a.prototype.mouse_leave=function(){return this.mouse_on_container=!1},a.prototype.input_focus=function(a){var b=this;if(this.is_multiple){if(!this.active_field)return setTimeout(function(){return b.container_mousedown()},50)}else if(!this.active_field)return this.activate_field()},a.prototype.input_blur=function(a){var b=this;if(!this.mouse_on_container)return this.active_field=!1,setTimeout(function(){return b.blur_test()},100)},a.prototype.results_option_build=function(a){var b,c,d,e,f,g,h;for(b="",e=0,h=this.results_data,f=0,g=h.length;f<g&&(c=h[f],d="",d=c.group?this.result_add_group(c):this.result_add_option(c),""!==d&&(e++,b+=d),(null!=a?a.first:void 0)&&(c.selected&&this.is_multiple?this.choice_build(c):c.selected&&!this.is_multiple&&this.single_set_selected_text(this.choice_label(c))),!(e>=this.max_shown_results));f++);return b},a.prototype.result_add_option=function(a){var b,c;return a.search_match&&this.include_option_in_results(a)?(b=[],a.disabled||a.selected&&this.is_multiple||b.push("active-result"),!a.disabled||a.selected&&this.is_multiple||b.push("disabled-result"),a.selected&&b.push("result-selected"),null!=a.group_array_index&&b.push("group-option"),""!==a.classes&&b.push(a.classes),c=document.createElement("li"),c.className=b.join(" "),c.style.cssText=a.style,c.setAttribute("data-option-array-index",a.array_index),c.innerHTML=a.search_text,a.title&&(c.title=a.title),this.outerHTML(c)):""},a.prototype.result_add_group=function(a){var b,c;return(a.search_match||a.group_match)&&a.active_options>0?(b=[],b.push("group-result"),a.classes&&b.push(a.classes),c=document.createElement("li"),c.className=b.join(" "),c.innerHTML=a.search_text,a.title&&(c.title=a.title),this.outerHTML(c)):""},a.prototype.results_update_field=function(){if(this.set_default_text(),this.is_multiple||this.results_reset_cleanup(),this.result_clear_highlight(),this.results_build(),this.results_showing)return this.winnow_results()},a.prototype.reset_single_select_options=function(){var a,b,c,d,e;for(d=this.results_data,e=[],b=0,c=d.length;b<c;b++)a=d[b],a.selected?e.push(a.selected=!1):e.push(void 0);return e},a.prototype.results_toggle=function(){return this.results_showing?this.results_hide():this.results_show()},a.prototype.results_search=function(a){return this.results_showing?this.winnow_results():this.results_show()},a.prototype.winnow_results=function(){var a,b,c,d,e,f,g,h,i,j,k,l;for(this.no_results_clear(),d=0,f=this.get_search_text(),a=f.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),i=new RegExp(a,"i"),c=this.get_search_regex(a),l=this.results_data,j=0,k=l.length;j<k;j++)b=l[j],b.search_match=!1,e=null,this.include_option_in_results(b)&&(b.group&&(b.group_match=!1,b.active_options=0),null!=b.group_array_index&&this.results_data[b.group_array_index]&&(e=this.results_data[b.group_array_index],0===e.active_options&&e.search_match&&(d+=1),e.active_options+=1),b.search_text=b.group?b.label:b.html,b.group&&!this.group_search||(b.search_match=this.search_string_match(b.search_text,c),b.search_match&&!b.group&&(d+=1),b.search_match?(f.length&&(g=b.search_text.search(i),h=b.search_text.substr(0,g+f.length)+"</em>"+b.search_text.substr(g+f.length),b.search_text=h.substr(0,g)+"<em>"+h.substr(g)),null!=e&&(e.group_match=!0)):null!=b.group_array_index&&this.results_data[b.group_array_index].search_match&&(b.search_match=!0)));return this.result_clear_highlight(),d<1&&f.length?(this.update_results_content(""),this.no_results(f)):(this.update_results_content(this.results_option_build()),this.winnow_results_set_highlight())},a.prototype.get_search_regex=function(a){var b,c;return b=this.search_contains?"":"^",c=this.case_sensitive_search?"":"i",new RegExp(b+a,c)},a.prototype.search_string_match=function(a,b){var c,d,e,f;if(b.test(a))return!0;if(this.enable_split_word_search&&(a.indexOf(" ")>=0||0===a.indexOf("["))&&(d=a.replace(/\[|\]/g,"").split(" "),d.length))for(e=0,f=d.length;e<f;e++)if(c=d[e],b.test(c))return!0},a.prototype.choices_count=function(){var a,b,c,d;if(null!=this.selected_option_count)return this.selected_option_count;for(this.selected_option_count=0,d=this.form_field.options,b=0,c=d.length;b<c;b++)a=d[b],a.selected&&(this.selected_option_count+=1);return this.selected_option_count},a.prototype.choices_click=function(a){if(a.preventDefault(),!this.results_showing&&!this.is_disabled)return this.results_show()},a.prototype.keyup_checker=function(a){var b,c;switch(b=null!=(c=a.which)?c:a.keyCode,this.search_field_scale(),b){case 8:if(this.is_multiple&&this.backstroke_length<1&&this.choices_count()>0)return this.keydown_backstroke();if(!this.pending_backstroke)return this.result_clear_highlight(),this.results_search();break;case 13:if(a.preventDefault(),this.results_showing)return this.result_select(a);break;case 27:return this.results_showing&&this.results_hide(),!0;case 9:case 38:case 40:case 16:case 91:case 17:case 18:break;default:return this.results_search()}},a.prototype.clipboard_event_checker=function(a){var b=this;return setTimeout(function(){return b.results_search()},50)},a.prototype.container_width=function(){return null!=this.options.width?this.options.width:""+this.form_field.offsetWidth+"px"},a.prototype.include_option_in_results=function(a){return!(this.is_multiple&&!this.display_selected_options&&a.selected)&&(!(!this.display_disabled_options&&a.disabled)&&!a.empty)},a.prototype.search_results_touchstart=function(a){return this.touch_started=!0,this.search_results_mouseover(a)},a.prototype.search_results_touchmove=function(a){return this.touch_started=!1,this.search_results_mouseout(a)},a.prototype.search_results_touchend=function(a){if(this.touch_started)return this.search_results_mouseup(a)},a.prototype.outerHTML=function(a){var b;return a.outerHTML?a.outerHTML:(b=document.createElement("div"),b.appendChild(a),b.innerHTML)},a.browser_is_supported=function(){return"Microsoft Internet Explorer"===window.navigator.appName?document.documentMode>=8:!(/iP(od|hone)/i.test(window.navigator.userAgent)||/IEMobile/i.test(window.navigator.userAgent)||/Windows Phone/i.test(window.navigator.userAgent)||/BlackBerry/i.test(window.navigator.userAgent)||/BB10/i.test(window.navigator.userAgent)||/Android.*Mobile/i.test(window.navigator.userAgent))},a.default_multiple_text="Select Some Options",a.default_single_text="Select an Option",a.default_no_result_text="No results match",a}(),a=jQuery,a.fn.extend({chosen:function(d){return b.browser_is_supported()?this.each(function(b){var e,f;return e=a(this),f=e.data("chosen"),"destroy"===d?void(f instanceof c&&f.destroy()):void(f instanceof c||e.data("chosen",new c(this,d)))}):this}}),c=function(b){function c(){return e=c.__super__.constructor.apply(this,arguments)}return g(c,b),c.prototype.setup=function(){return this.form_field_jq=a(this.form_field),this.current_selectedIndex=this.form_field.selectedIndex,this.is_rtl=this.form_field_jq.hasClass("chosen-rtl")},c.prototype.set_up_html=function(){var b,c;return b=["chosen-container"],b.push("chosen-container-"+(this.is_multiple?"multi":"single")),this.inherit_select_classes&&this.form_field.className&&b.push(this.form_field.className),this.is_rtl&&b.push("chosen-rtl"),c={class:b.join(" "),style:"width: "+this.container_width()+";",title:this.form_field.title},this.form_field.id.length&&(c.id=this.form_field.id.replace(/[^\w]/g,"_")+"_chosen"),this.container=a("<div />",c),this.is_multiple?this.container.html('<ul class="chosen-choices"><li class="search-field"><input type="text" value="'+this.default_text+'" class="default" autocomplete="off" style="width:25px;" /></li></ul><div class="chosen-drop"><ul class="chosen-results"></ul></div>'):this.container.html('<a class="chosen-single chosen-default"><span>'+this.default_text+'</span><div><b></b></div></a><div class="chosen-drop"><div class="chosen-search"><input type="text" autocomplete="off" /></div><ul class="chosen-results"></ul></div>'),this.form_field_jq.hide().after(this.container),this.dropdown=this.container.find("div.chosen-drop").first(),this.search_field=this.container.find("input").first(),this.search_results=this.container.find("ul.chosen-results").first(),this.search_field_scale(),this.search_no_results=this.container.find("li.no-results").first(),this.is_multiple?(this.search_choices=this.container.find("ul.chosen-choices").first(),this.search_container=this.container.find("li.search-field").first()):(this.search_container=this.container.find("div.chosen-search").first(),this.selected_item=this.container.find(".chosen-single").first()),this.results_build(),this.set_tab_index(),this.set_label_behavior()},c.prototype.on_ready=function(){return this.form_field_jq.trigger("chosen:ready",{chosen:this})},c.prototype.register_observers=function(){var a=this;return this.container.bind("touchstart.chosen",function(b){return a.container_mousedown(b),b.preventDefault()}),this.container.bind("touchend.chosen",function(b){return a.container_mouseup(b),b.preventDefault()}),this.container.bind("mousedown.chosen",function(b){a.container_mousedown(b)}),this.container.bind("mouseup.chosen",function(b){a.container_mouseup(b)}),this.container.bind("mouseenter.chosen",function(b){a.mouse_enter(b)}),this.container.bind("mouseleave.chosen",function(b){a.mouse_leave(b)}),this.search_results.bind("mouseup.chosen",function(b){a.search_results_mouseup(b)}),this.search_results.bind("mouseover.chosen",function(b){a.search_results_mouseover(b)}),this.search_results.bind("mouseout.chosen",function(b){a.search_results_mouseout(b)}),this.search_results.bind("mousewheel.chosen DOMMouseScroll.chosen",function(b){a.search_results_mousewheel(b)}),this.search_results.bind("touchstart.chosen",function(b){a.search_results_touchstart(b)}),this.search_results.bind("touchmove.chosen",function(b){a.search_results_touchmove(b)}),this.search_results.bind("touchend.chosen",function(b){a.search_results_touchend(b)}),this.form_field_jq.bind("chosen:updated.chosen",function(b){a.results_update_field(b)}),this.form_field_jq.bind("chosen:activate.chosen",function(b){a.activate_field(b)}),this.form_field_jq.bind("chosen:open.chosen",function(b){a.container_mousedown(b)}),this.form_field_jq.bind("chosen:close.chosen",function(b){a.input_blur(b)}),this.search_field.bind("blur.chosen",function(b){a.input_blur(b)}),this.search_field.bind("keyup.chosen",function(b){a.keyup_checker(b)}),this.search_field.bind("keydown.chosen",function(b){a.keydown_checker(b)}),this.search_field.bind("focus.chosen",function(b){a.input_focus(b)}),this.search_field.bind("cut.chosen",function(b){a.clipboard_event_checker(b)}),this.search_field.bind("paste.chosen",function(b){a.clipboard_event_checker(b)}),this.is_multiple?this.search_choices.bind("click.chosen",function(b){a.choices_click(b)}):this.container.bind("click.chosen",function(a){a.preventDefault()})},c.prototype.destroy=function(){return a(this.container[0].ownerDocument).unbind("click.chosen",this.click_test_action),this.search_field[0].tabIndex&&(this.form_field_jq[0].tabIndex=this.search_field[0].tabIndex),this.container.remove(),this.form_field_jq.removeData("chosen"),this.form_field_jq.show()},c.prototype.search_field_disabled=function(){return this.is_disabled=this.form_field_jq[0].disabled,this.is_disabled?(this.container.addClass("chosen-disabled"),this.search_field[0].disabled=!0,this.is_multiple||this.selected_item.unbind("focus.chosen",this.activate_action),this.close_field()):(this.container.removeClass("chosen-disabled"),this.search_field[0].disabled=!1,this.is_multiple?void 0:this.selected_item.bind("focus.chosen",this.activate_action))},c.prototype.container_mousedown=function(b){if(!this.is_disabled&&(b&&"mousedown"===b.type&&!this.results_showing&&b.preventDefault(),null==b||!a(b.target).hasClass("search-choice-close")))return this.active_field?this.is_multiple||!b||a(b.target)[0]!==this.selected_item[0]&&!a(b.target).parents("a.chosen-single").length||(b.preventDefault(),this.results_toggle()):(this.is_multiple&&this.search_field.val(""),a(this.container[0].ownerDocument).bind("click.chosen",this.click_test_action),this.results_show()),this.activate_field()},c.prototype.container_mouseup=function(a){if("ABBR"===a.target.nodeName&&!this.is_disabled)return this.results_reset(a)},c.prototype.search_results_mousewheel=function(a){var b;if(a.originalEvent&&(b=a.originalEvent.deltaY||-a.originalEvent.wheelDelta||a.originalEvent.detail),null!=b)return a.preventDefault(),"DOMMouseScroll"===a.type&&(b*=40),this.search_results.scrollTop(b+this.search_results.scrollTop())},c.prototype.blur_test=function(a){if(!this.active_field&&this.container.hasClass("chosen-container-active"))return this.close_field()},c.prototype.close_field=function(){return a(this.container[0].ownerDocument).unbind("click.chosen",this.click_test_action),this.active_field=!1,this.results_hide(),this.container.removeClass("chosen-container-active"),this.clear_backstroke(),this.show_search_field_default(),this.search_field_scale()},c.prototype.activate_field=function(){return this.container.addClass("chosen-container-active"),this.active_field=!0,this.search_field.val(this.search_field.val()),this.search_field.focus()},c.prototype.test_active_click=function(b){var c;return c=a(b.target).closest(".chosen-container"),c.length&&this.container[0]===c[0]?this.active_field=!0:this.close_field()},c.prototype.results_build=function(){return this.parsing=!0,this.selected_option_count=null,this.results_data=d.select_to_array(this.form_field),this.is_multiple?this.search_choices.find("li.search-choice").remove():this.is_multiple||(this.single_set_selected_text(),this.disable_search||this.form_field.options.length<=this.disable_search_threshold?(this.search_field[0].readOnly=!0,this.container.addClass("chosen-container-single-nosearch")):(this.search_field[0].readOnly=!1,this.container.removeClass("chosen-container-single-nosearch"))),this.update_results_content(this.results_option_build({first:!0})),this.search_field_disabled(),this.show_search_field_default(),this.search_field_scale(),this.parsing=!1},c.prototype.result_do_highlight=function(a){var b,c,d,e,f;if(a.length){if(this.result_clear_highlight(),this.result_highlight=a,this.result_highlight.addClass("highlighted"),d=parseInt(this.search_results.css("maxHeight"),10),f=this.search_results.scrollTop(),e=d+f,c=this.result_highlight.position().top+this.search_results.scrollTop(),b=c+this.result_highlight.outerHeight(),b>=e)return this.search_results.scrollTop(b-d>0?b-d:0);if(c<f)return this.search_results.scrollTop(c)}},c.prototype.result_clear_highlight=function(){return this.result_highlight&&this.result_highlight.removeClass("highlighted"),this.result_highlight=null},c.prototype.results_show=function(){return this.is_multiple&&this.max_selected_options<=this.choices_count()?(this.form_field_jq.trigger("chosen:maxselected",{chosen:this}),!1):(this.container.addClass("chosen-with-drop"),this.results_showing=!0,this.search_field.focus(),this.search_field.val(this.search_field.val()),this.winnow_results(),this.form_field_jq.trigger("chosen:showing_dropdown",{chosen:this}))},c.prototype.update_results_content=function(a){return this.search_results.html(a)},c.prototype.results_hide=function(){return this.results_showing&&(this.result_clear_highlight(),this.container.removeClass("chosen-with-drop"),this.form_field_jq.trigger("chosen:hiding_dropdown",{chosen:this})),this.results_showing=!1},c.prototype.set_tab_index=function(a){var b;if(this.form_field.tabIndex)return b=this.form_field.tabIndex,this.form_field.tabIndex=-1,this.search_field[0].tabIndex=b},c.prototype.set_label_behavior=function(){var b=this;if(this.form_field_label=this.form_field_jq.parents("label"),!this.form_field_label.length&&this.form_field.id.length&&(this.form_field_label=a("label[for='"+this.form_field.id+"']")),this.form_field_label.length>0)return this.form_field_label.bind("click.chosen",function(a){return b.is_multiple?b.container_mousedown(a):b.activate_field()})},c.prototype.show_search_field_default=function(){return this.is_multiple&&this.choices_count()<1&&!this.active_field?(this.search_field.val(this.default_text),this.search_field.addClass("default")):(this.search_field.val(""),this.search_field.removeClass("default"))},c.prototype.search_results_mouseup=function(b){var c;if(c=a(b.target).hasClass("active-result")?a(b.target):a(b.target).parents(".active-result").first(),c.length)return this.result_highlight=c,this.result_select(b),this.search_field.focus()},c.prototype.search_results_mouseover=function(b){var c;if(c=a(b.target).hasClass("active-result")?a(b.target):a(b.target).parents(".active-result").first())return this.result_do_highlight(c)},c.prototype.search_results_mouseout=function(b){if(a(b.target).hasClass("active-result"))return this.result_clear_highlight()},c.prototype.choice_build=function(b){var c,d,e=this;return c=a("<li />",{class:"search-choice"}).html("<span>"+this.choice_label(b)+"</span>"),b.disabled?c.addClass("search-choice-disabled"):(d=a("<a />",{class:"search-choice-close","data-option-array-index":b.array_index}),d.bind("click.chosen",function(a){return e.choice_destroy_link_click(a)}),c.append(d)),this.search_container.before(c)},c.prototype.choice_destroy_link_click=function(b){if(b.preventDefault(),b.stopPropagation(),!this.is_disabled)return this.choice_destroy(a(b.target))},c.prototype.choice_destroy=function(a){if(this.result_deselect(a[0].getAttribute("data-option-array-index")))return this.show_search_field_default(),this.is_multiple&&this.choices_count()>0&&this.search_field.val().length<1&&this.results_hide(),a.parents("li").first().remove(),this.search_field_scale()},c.prototype.results_reset=function(){if(this.reset_single_select_options(),this.form_field.options[0].selected=!0,this.single_set_selected_text(),this.show_search_field_default(),this.results_reset_cleanup(),this.form_field_jq.trigger("change"),this.active_field)return this.results_hide()},c.prototype.results_reset_cleanup=function(){return this.current_selectedIndex=this.form_field.selectedIndex,this.selected_item.find("abbr").remove()},c.prototype.result_select=function(a){var b,c;if(this.result_highlight)return b=this.result_highlight,this.result_clear_highlight(),this.is_multiple&&this.max_selected_options<=this.choices_count()?(this.form_field_jq.trigger("chosen:maxselected",{chosen:this}),!1):(this.is_multiple?b.removeClass("active-result"):this.reset_single_select_options(),b.addClass("result-selected"),c=this.results_data[b[0].getAttribute("data-option-array-index")],c.selected=!0,this.form_field.options[c.options_index].selected=!0,this.selected_option_count=null,this.is_multiple?this.choice_build(c):this.single_set_selected_text(this.choice_label(c)),(a.metaKey||a.ctrlKey)&&this.is_multiple||this.results_hide(),this.show_search_field_default(),(this.is_multiple||this.form_field.selectedIndex!==this.current_selectedIndex)&&this.form_field_jq.trigger("change",{selected:this.form_field.options[c.options_index].value}),this.current_selectedIndex=this.form_field.selectedIndex,a.preventDefault(),this.search_field_scale())},c.prototype.single_set_selected_text=function(a){return null==a&&(a=this.default_text),a===this.default_text?this.selected_item.addClass("chosen-default"):(this.single_deselect_control_build(),this.selected_item.removeClass("chosen-default")),this.selected_item.find("span").html(a)},c.prototype.result_deselect=function(a){var b;return b=this.results_data[a],!this.form_field.options[b.options_index].disabled&&(b.selected=!1,this.form_field.options[b.options_index].selected=!1,this.selected_option_count=null,this.result_clear_highlight(),this.results_showing&&this.winnow_results(),this.form_field_jq.trigger("change",{deselected:this.form_field.options[b.options_index].value}),this.search_field_scale(),!0)},c.prototype.single_deselect_control_build=function(){if(this.allow_single_deselect)return this.selected_item.find("abbr").length||this.selected_item.find("span").first().after('<abbr class="search-choice-close"></abbr>'),this.selected_item.addClass("chosen-single-with-deselect")},c.prototype.get_search_text=function(){return a("<div/>").text(a.trim(this.search_field.val())).html()},c.prototype.winnow_results_set_highlight=function(){var a,b;if(b=this.is_multiple?[]:this.search_results.find(".result-selected.active-result"),a=b.length?b.first():this.search_results.find(".active-result").first(),null!=a)return this.result_do_highlight(a)},c.prototype.no_results=function(b){var c;return c=a('<li class="no-results">'+this.results_none_found+' "<span></span>"</li>'),c.find("span").first().html(b),this.search_results.append(c),this.form_field_jq.trigger("chosen:no_results",{chosen:this})},c.prototype.no_results_clear=function(){return this.search_results.find(".no-results").remove()},c.prototype.keydown_arrow=function(){var a;return this.results_showing&&this.result_highlight?(a=this.result_highlight.nextAll("li.active-result").first())?this.result_do_highlight(a):void 0:this.results_show()},c.prototype.keyup_arrow=function(){var a;return this.results_showing||this.is_multiple?this.result_highlight?(a=this.result_highlight.prevAll("li.active-result"),a.length?this.result_do_highlight(a.first()):(this.choices_count()>0&&this.results_hide(),this.result_clear_highlight())):void 0:this.results_show()},c.prototype.keydown_backstroke=function(){var a;return this.pending_backstroke?(this.choice_destroy(this.pending_backstroke.find("a").first()),this.clear_backstroke()):(a=this.search_container.siblings("li.search-choice").last(),a.length&&!a.hasClass("search-choice-disabled")?(this.pending_backstroke=a,this.single_backstroke_delete?this.keydown_backstroke():this.pending_backstroke.addClass("search-choice-focus")):void 0)},c.prototype.clear_backstroke=function(){return this.pending_backstroke&&this.pending_backstroke.removeClass("search-choice-focus"),this.pending_backstroke=null},c.prototype.keydown_checker=function(a){var b,c;switch(b=null!=(c=a.which)?c:a.keyCode,this.search_field_scale(),8!==b&&this.pending_backstroke&&this.clear_backstroke(),b){case 8:this.backstroke_length=this.search_field.val().length;break;case 9:this.results_showing&&!this.is_multiple&&this.result_select(a),this.mouse_on_container=!1;break;case 13:this.results_showing&&a.preventDefault();break;case 32:this.disable_search&&a.preventDefault();break;case 38:a.preventDefault(),this.keyup_arrow();break;case 40:a.preventDefault(),this.keydown_arrow()}},c.prototype.search_field_scale=function(){var b,c,d,e,f,g,h,i,j;if(this.is_multiple){for(d=0,h=0,f="position:absolute; left: -1000px; top: -1000px; display:none;",g=["font-size","font-style","font-weight","font-family","line-height","text-transform","letter-spacing"],i=0,j=g.length;i<j;i++)e=g[i],f+=e+":"+this.search_field.css(e)+";";return b=a("<div />",{style:f}),b.text(this.search_field.val()),a("body").append(b),h=b.width()+25,b.remove(),c=this.container.outerWidth(),h>c-10&&(h=c-10),this.search_field.css({width:h+"px"})}},c}(b)}).call(this);
;/*! Copyright 2012, Ben Lin (http://dreamerslab.com/)
 * Licensed under the MIT License (LICENSE.txt).
 *
 * Version: 1.0.16
 *
 * Requires: jQuery >= 1.2.3
 */
!function(a){a.fn.addBack=a.fn.addBack||a.fn.andSelf,a.fn.extend({actual:function(b,c){if(!this[b])throw'$.actual => The jQuery method "'+b+'" you called does not exist';var g,h,d={absolute:!1,clone:!1,includeMargin:!1},e=a.extend(d,c),f=this.eq(0);if(e.clone===!0)g=function(){var a="position: absolute !important; top: -1000 !important; ";f=f.clone().attr("style",a).appendTo("body")},h=function(){f.remove()};else{var k,i=[],j="";g=function(){k=f.parents().addBack().filter(":hidden"),j+="visibility: hidden !important; display: block !important; ",e.absolute===!0&&(j+="position: absolute !important; "),k.each(function(){var b=a(this),c=b.attr("style");i.push(c),b.attr("style",c?c+";"+j:j)})},h=function(){k.each(function(b){var c=a(this),d=i[b];void 0===d?c.removeAttr("style"):c.attr("style",d)})}}g();var l=/(outer)/.test(b)?f[b](e.includeMargin):f[b]();return h(),l}})}(jQuery);
;/**
 * jQuery Interdependencies library
 *
 * http://miohtama.github.com/jquery-interdependencies/
 *
 * Copyright 2012-2013 Mikko Ohtamaa, others
 */

/*global console, window*/

!function(a){"use strict";function b(a){window.console&&window.console.log&&console.log(a)}function c(b,c){return"#"==c[0]&&c.indexOf(" ")<0?a(c):b.find(c)}function e(a,b,c){this.init(a,b,c)}function f(){this.rules=[]}a.extend(e.prototype,{init:function(a,b,c){this.controller=a,this.condition=b,this.value=c,this.rules=[],this.controls=[]},evalCondition:function(b,c,d,e,f){if("=="==d)return this.checkBoolean(e)==this.checkBoolean(f);if("!="==d)return this.checkBoolean(e)!=this.checkBoolean(f);if(">="==d)return Number(f)>=Number(e);if("<="==d)return Number(f)<=Number(e);if(">"==d)return Number(f)>Number(e);if("<"==d)return Number(f)<Number(e);if("()"==d)return window[e](b,c,f);if("any"==d)return a.inArray(f,e.split(","))>-1;if("not-any"==d)return a.inArray(f,e.split(","))==-1;throw new Error("Unknown condition:"+d)},checkBoolean:function(a){switch(a){case!0:case"true":case 1:case"1":a=!0;break;case!1:case"false":case 0:case"0":a=!1}return a},checkCondition:function(a,c){if(!this.condition)return!0;var d=a.find(this.controller);0===d.size()&&c.log&&b("Evaling condition: Could not find controller input "+this.controller);var e=this.getControlValue(a,d);return c.log&&void 0===e&&b("Evaling condition: Could not exctract value from input "+this.controller),void 0!==e&&(e=this.normalizeValue(d,this.value,e),this.evalCondition(a,d,this.condition,this.value,e))},normalizeValue:function(a,b,c){return"number"==typeof b?parseFloat(c):c},getControlValue:function(a,b){return("radio"==b.attr("type")||"checkbox"==b.attr("type"))&&b.size()>1?b.filter(":checked").val():"checkbox"==b.attr("type")||"radio"==b.attr("type")?b.is(":checked"):b.val()},createRule:function(a,b,c){var d=new e(a,b,c);return this.rules.push(d),d},include:function(a){if(!a)throw new Error("Must give an input selector");this.controls.push(a)},applyRule:function(c,d,e){var f;f=void 0===e?this.checkCondition(c,d):e,d.log&&b("Applying rule on "+this.controller+"=="+this.value+" enforced:"+e+" result:"+f),d.log&&!this.controls.length&&b("Zero length controls slipped through");var g=d.show||function(a){a.show()},h=d.hide||function(a){a.hide()},i=a.map(this.controls,function(a,e){var f=c.find(a);return d.log&&0===f.size()&&b("Could not find element:"+a),f});f?(a(i).each(function(){d.log&&0===a(this).size()&&(b("Control selection is empty when showing"),b(this)),g(this)}),a(this.rules).each(function(){this.applyRule(c,d)})):(a(i).each(function(){d.log&&0===a(this).size()&&(b("Control selection is empty when hiding:"),b(this)),h(this)}),a(this.rules).each(function(){this.applyRule(c,d,!1)}))}}),a.extend(f.prototype,{createRule:function(a,b,c){var d=new e(a,b,c);return this.rules.push(d),d},applyRules:function(a,c){var d;for(c=c||{},c.log&&b("Starting evaluation ruleset of "+this.rules.length+" rules"),d=0;d<this.rules.length;d++)this.rules[d].applyRule(a,c)},walk:function(){function c(d){b.push(d),a(d.children).each(function(){c(this)})}var b=[];return a(this.rules).each(function(){c(this)}),b},checkTargets:function(d,e){var f=0,g=this.walk();a(g).each(function(){if(0===d.find(this.controller).size())throw new Error("Rule's controller does not exist:"+this.controller);if(0===this.controls.length)throw new Error("Rule has no controls:"+this);a(this.controls).each(function(){if(0===c(d,this))throw new Error("Rule's target control "+this+" does not exist in context "+d.get(0));f++})}),e.log&&b("Controller check ok, rules count "+g.length+" controls count "+f)},install:function(b){a.deps.enable(a(document.body),this,b)}});var g={createRuleset:function(){return new f},enable:function(a,c,d){d=d||{},(d.checkTargets||void 0===d.checkTargets)&&c.checkTargets(a,d);d.log&&b("Enabling dependency change monitoring on "+a.get(0));var f=function(){c.applyRules(a,d)},g=a.on?a.on("change.deps",null,null,f):a.live("change.deps",f);return c.applyRules(a,d),g}};a.deps=g}(jQuery);
;/* ========================================================================
 * Bootstrap: transition.js v3.3.4
 * http://getbootstrap.com/javascript/#transitions
 * ========================================================================
 * Copyright 2011-2015 Twitter, Inc.
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
 * ========================================================================
 * Changed function name for avoid conflict
 * ======================================================================== */
+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]};return!1}a.fn.CSemulateTransitionEnd=function(b){var c=!1,d=this;a(this).one("bsTransitionEnd",function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b(),a.support.transition&&(a.event.special.bsTransitionEnd={bindType:a.support.transition.end,delegateType:a.support.transition.end,handle:function(b){if(a(b.target).is(this))return b.handleObj.handler.apply(this,arguments)}})})}(jQuery);

/* ========================================================================
 * Bootstrap: tooltip.js v3.3.4
 * http://getbootstrap.com/javascript/#tooltip
 * Inspired by the original jQuery.tipsy by Jason Frame
 * ========================================================================
 * Copyright 2011-2015 Twitter, Inc.
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
 * ========================================================================
 * Changed function and class names for avoid conflict
 * ======================================================================== */
+function(a){"use strict";function c(c){return this.each(function(){var d=a(this),e=d.data("bs.cstooltip"),f="object"==typeof c&&c;!e&&/destroy|hide/.test(c)||(e||d.data("bs.cstooltip",e=new b(this,f)),"string"==typeof c&&e[c]())})}var b=function(a,b){this.type=null,this.options=null,this.enabled=null,this.timeout=null,this.hoverState=null,this.$element=null,this.init("cstooltip",a,b)};b.VERSION="3.3.4",b.TRANSITION_DURATION=150,b.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'<div class="la-tooltip" role="tooltip"><div class="la-tooltip-arrow"></div><div class="la-tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0}},b.prototype.init=function(b,c,d){if(this.enabled=!0,this.type=b,this.$element=a(c),this.options=this.getOptions(d),this.$viewport=this.options.viewport&&a(this.options.viewport.selector||this.options.viewport),this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");for(var e=this.options.trigger.split(" "),f=e.length;f--;){var g=e[f];if("click"==g)this.$element.on("click."+this.type,this.options.selector,a.proxy(this.toggle,this));else if("manual"!=g){var h="hover"==g?"mouseenter":"focusin",i="hover"==g?"mouseleave":"focusout";this.$element.on(h+"."+this.type,this.options.selector,a.proxy(this.enter,this)),this.$element.on(i+"."+this.type,this.options.selector,a.proxy(this.leave,this))}}this.options.selector?this._options=a.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},b.prototype.getDefaults=function(){return b.DEFAULTS},b.prototype.getOptions=function(b){return b=a.extend({},this.getDefaults(),this.$element.data(),b),b.delay&&"number"==typeof b.delay&&(b.delay={show:b.delay,hide:b.delay}),b},b.prototype.getDelegateOptions=function(){var b={},c=this.getDefaults();return this._options&&a.each(this._options,function(a,d){c[a]!=d&&(b[a]=d)}),b},b.prototype.enter=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c&&c.$tip&&c.$tip.is(":visible")?void(c.hoverState="in"):(c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),clearTimeout(c.timeout),c.hoverState="in",c.options.delay&&c.options.delay.show?void(c.timeout=setTimeout(function(){"in"==c.hoverState&&c.show()},c.options.delay.show)):c.show())},b.prototype.leave=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),clearTimeout(c.timeout),c.hoverState="out",c.options.delay&&c.options.delay.hide?void(c.timeout=setTimeout(function(){"out"==c.hoverState&&c.hide()},c.options.delay.hide)):c.hide()},b.prototype.show=function(){var c=a.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(c);var d=a.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(c.isDefaultPrevented()||!d)return;var e=this,f=this.tip(),g=this.getUID(this.type);this.setContent(),f.attr("id",g),this.$element.attr("aria-describedby",g),this.options.animation&&f.addClass("fade");var h="function"==typeof this.options.placement?this.options.placement.call(this,f[0],this.$element[0]):this.options.placement,i=/\s?auto?\s?/i,j=i.test(h);j&&(h=h.replace(i,"")||"top"),f.detach().css({top:0,left:0,display:"block"}).addClass(h).data("bs."+this.type,this),this.options.container?f.appendTo(this.options.container):f.insertAfter(this.$element);var k=this.getPosition(),l=f[0].offsetWidth,m=f[0].offsetHeight;if(j){var n=h,o=this.options.container?a(this.options.container):this.$element.parent(),p=this.getPosition(o);h="bottom"==h&&k.bottom+m>p.bottom?"top":"top"==h&&k.top-m<p.top?"bottom":"right"==h&&k.right+l>p.width?"left":"left"==h&&k.left-l<p.left?"right":h,f.removeClass(n).addClass(h)}var q=this.getCalculatedOffset(h,k,l,m);this.applyPlacement(q,h);var r=function(){var a=e.hoverState;e.$element.trigger("shown.bs."+e.type),e.hoverState=null,"out"==a&&e.leave(e)};a.support.transition&&this.$tip.hasClass("fade")?f.one("bsTransitionEnd",r).CSemulateTransitionEnd(b.TRANSITION_DURATION):r()}},b.prototype.applyPlacement=function(b,c){var d=this.tip(),e=d[0].offsetWidth,f=d[0].offsetHeight,g=parseInt(d.css("margin-top"),10),h=parseInt(d.css("margin-left"),10);isNaN(g)&&(g=0),isNaN(h)&&(h=0),b.top=b.top+g,b.left=b.left+h,a.offset.setOffset(d[0],a.extend({using:function(a){d.css({top:Math.round(a.top),left:Math.round(a.left)})}},b),0),d.addClass("in");var i=d[0].offsetWidth,j=d[0].offsetHeight;"top"==c&&j!=f&&(b.top=b.top+f-j);var k=this.getViewportAdjustedDelta(c,b,i,j);k.left?b.left+=k.left:b.top+=k.top;var l=/top|bottom/.test(c),m=l?2*k.left-e+i:2*k.top-f+j,n=l?"offsetWidth":"offsetHeight";d.offset(b),this.replaceArrow(m,d[0][n],l)},b.prototype.replaceArrow=function(a,b,c){this.arrow().css(c?"left":"top",50*(1-a/b)+"%").css(c?"top":"left","")},b.prototype.setContent=function(){var a=this.tip(),b=this.getTitle();a.find(".la-tooltip-inner")[this.options.html?"html":"text"](b),a.removeClass("fade in top bottom left right")},b.prototype.hide=function(c){function g(){"in"!=d.hoverState&&e.detach(),d.$element.removeAttr("aria-describedby").trigger("hidden.bs."+d.type),c&&c()}var d=this,e=a(this.$tip),f=a.Event("hide.bs."+this.type);if(this.$element.trigger(f),!f.isDefaultPrevented())return e.removeClass("in"),a.support.transition&&e.hasClass("fade")?e.one("bsTransitionEnd",g).CSemulateTransitionEnd(b.TRANSITION_DURATION):g(),this.hoverState=null,this},b.prototype.fixTitle=function(){var a=this.$element;(a.attr("title")||"string"!=typeof a.attr("data-original-title"))&&a.attr("data-original-title",a.attr("title")||"").attr("title","")},b.prototype.hasContent=function(){return this.getTitle()},b.prototype.getPosition=function(b){b=b||this.$element;var c=b[0],d="BODY"==c.tagName,e=c.getBoundingClientRect();null==e.width&&(e=a.extend({},e,{width:e.right-e.left,height:e.bottom-e.top}));var f=d?{top:0,left:0}:b.offset(),g={scroll:d?document.documentElement.scrollTop||document.body.scrollTop:b.scrollTop()},h=d?{width:a(window).width(),height:a(window).height()}:null;return a.extend({},e,g,h,f)},b.prototype.getCalculatedOffset=function(a,b,c,d){return"bottom"==a?{top:b.top+b.height,left:b.left+b.width/2-c/2}:"top"==a?{top:b.top-d,left:b.left+b.width/2-c/2}:"left"==a?{top:b.top+b.height/2-d/2,left:b.left-c}:{top:b.top+b.height/2-d/2,left:b.left+b.width}},b.prototype.getViewportAdjustedDelta=function(a,b,c,d){var e={top:0,left:0};if(!this.$viewport)return e;var f=this.options.viewport&&this.options.viewport.padding||0,g=this.getPosition(this.$viewport);if(/right|left/.test(a)){var h=b.top-f-g.scroll,i=b.top+f-g.scroll+d;h<g.top?e.top=g.top-h:i>g.top+g.height&&(e.top=g.top+g.height-i)}else{var j=b.left-f,k=b.left+f+c;j<g.left?e.left=g.left-j:k>g.width&&(e.left=g.left+g.width-k)}return e},b.prototype.getTitle=function(){var a,b=this.$element,c=this.options;return a=b.attr("data-original-title")||("function"==typeof c.title?c.title.call(b[0]):c.title)},b.prototype.getUID=function(a){do a+=~~(1e6*Math.random());while(document.getElementById(a));return a},b.prototype.tip=function(){return this.$tip=this.$tip||a(this.options.template)},b.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".la-tooltip-arrow")},b.prototype.enable=function(){this.enabled=!0},b.prototype.disable=function(){this.enabled=!1},b.prototype.toggleEnabled=function(){this.enabled=!this.enabled},b.prototype.toggle=function(b){var c=this;b&&(c=a(b.currentTarget).data("bs."+this.type),c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c))),c.tip().hasClass("in")?c.leave(c):c.enter(c)},b.prototype.destroy=function(){var a=this;clearTimeout(this.timeout),this.hide(function(){a.$element.off("."+a.type).removeData("bs."+a.type)})};var d=a.fn.cstooltip;a.fn.cstooltip=c,a.fn.cstooltip.Constructor=b,a.fn.cstooltip.noConflict=function(){return a.fn.cstooltip=d,this}}(jQuery);


/**
 *
 * Color picker
 * Author: Stefan Petre www.eyecon.ro
 *
 * Dual licensed under the MIT and GPL licenses
 *
 */

+function(a){var b=function(){var d=65,f='<div class="colorpicker"><div class="colorpicker_color"><div><div></div></div></div><div class="colorpicker_hue"><div></div></div><div class="colorpicker_new_color"></div><div class="colorpicker_current_color"></div><div class="colorpicker_hex"><input type="text" maxlength="6" size="6" /></div><div class="colorpicker_rgb_r colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_rgb_g colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_rgb_b colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_hsb_h colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_hsb_s colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_hsb_b colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_submit"></div></div>',g={eventName:"click",onShow:function(){},onBeforeShow:function(){},onHide:function(){},onChange:function(){},onSubmit:function(){},color:"ff0000",livePreview:!0,flat:!1},h=function(b,c){var d=O(b);a(c).data("colorpicker").fields.eq(1).val(d.r).end().eq(2).val(d.g).end().eq(3).val(d.b).end()},i=function(b,c){a(c).data("colorpicker").fields.eq(4).val(b.h).end().eq(5).val(b.s).end().eq(6).val(b.b).end()},j=function(b,c){a(c).data("colorpicker").fields.eq(0).val(Q(b)).end()},k=function(b,c){a(c).data("colorpicker").selector.css("backgroundColor","#"+Q({h:b.h,s:100,b:100})),a(c).data("colorpicker").selectorIndic.css({left:parseInt(150*b.s/100,10),top:parseInt(150*(100-b.b)/100,10)})},l=function(b,c){a(c).data("colorpicker").hue.css("top",parseInt(150-150*b.h/360,10))},m=function(b,c){a(c).data("colorpicker").currentColor.css("backgroundColor","#"+Q(b))},n=function(b,c){a(c).data("colorpicker").newColor.css("backgroundColor","#"+Q(b))},o=function(b){var c=b.charCode||b.keyCode||-1;if(c>d&&c<=90||32==c)return!1;var e=a(this).parent().parent();e.data("colorpicker").livePreview===!0&&p.apply(this)},p=function(b){var d,c=a(this).parent().parent();this.parentNode.className.indexOf("_hex")>0?c.data("colorpicker").color=d=M(K(this.value)):this.parentNode.className.indexOf("_hsb")>0?c.data("colorpicker").color=d=I({h:parseInt(c.data("colorpicker").fields.eq(4).val(),10),s:parseInt(c.data("colorpicker").fields.eq(5).val(),10),b:parseInt(c.data("colorpicker").fields.eq(6).val(),10)}):c.data("colorpicker").color=d=N(J({r:parseInt(c.data("colorpicker").fields.eq(1).val(),10),g:parseInt(c.data("colorpicker").fields.eq(2).val(),10),b:parseInt(c.data("colorpicker").fields.eq(3).val(),10)})),b&&(h(d,c.get(0)),j(d,c.get(0)),i(d,c.get(0))),k(d,c.get(0)),l(d,c.get(0)),n(d,c.get(0)),c.data("colorpicker").onChange.apply(c,[d,Q(d),O(d)])},q=function(b){var c=a(this).parent().parent();c.data("colorpicker").fields.parent().removeClass("colorpicker_focus")},r=function(){d=this.parentNode.className.indexOf("_hex")>0?70:65,a(this).parent().parent().data("colorpicker").fields.parent().removeClass("colorpicker_focus"),a(this).parent().addClass("colorpicker_focus")},s=function(b){var c=a(this).parent().find("input").focus(),d={el:a(this).parent().addClass("colorpicker_slider"),max:this.parentNode.className.indexOf("_hsb_h")>0?360:this.parentNode.className.indexOf("_hsb")>0?100:255,y:b.pageY,field:c,val:parseInt(c.val(),10),preview:a(this).parent().parent().data("colorpicker").livePreview};a(document).bind("mouseup",d,u),a(document).bind("mousemove",d,t)},t=function(a){return a.data.field.val(Math.max(0,Math.min(a.data.max,parseInt(a.data.val+a.pageY-a.data.y,10)))),a.data.preview&&p.apply(a.data.field.get(0),[!0]),!1},u=function(b){return p.apply(b.data.field.get(0),[!0]),b.data.el.removeClass("colorpicker_slider").find("input").focus(),a(document).unbind("mouseup",u),a(document).unbind("mousemove",t),!1},v=function(b){var c={cal:a(this).parent(),y:a(this).offset().top};c.preview=c.cal.data("colorpicker").livePreview,a(document).bind("mouseup",c,x),a(document).bind("mousemove",c,w)},w=function(a){return p.apply(a.data.cal.data("colorpicker").fields.eq(4).val(parseInt(360*(150-Math.max(0,Math.min(150,a.pageY-a.data.y)))/150,10)).get(0),[a.data.preview]),!1},x=function(b){return h(b.data.cal.data("colorpicker").color,b.data.cal.get(0)),j(b.data.cal.data("colorpicker").color,b.data.cal.get(0)),a(document).unbind("mouseup",x),a(document).unbind("mousemove",w),!1},y=function(b){var c={cal:a(this).parent(),pos:a(this).offset()};c.preview=c.cal.data("colorpicker").livePreview,a(document).bind("mouseup",c,A),a(document).bind("mousemove",c,z)},z=function(a){return p.apply(a.data.cal.data("colorpicker").fields.eq(6).val(parseInt(100*(150-Math.max(0,Math.min(150,a.pageY-a.data.pos.top)))/150,10)).end().eq(5).val(parseInt(100*Math.max(0,Math.min(150,a.pageX-a.data.pos.left))/150,10)).get(0),[a.data.preview]),!1},A=function(b){return h(b.data.cal.data("colorpicker").color,b.data.cal.get(0)),j(b.data.cal.data("colorpicker").color,b.data.cal.get(0)),a(document).unbind("mouseup",A),a(document).unbind("mousemove",z),!1},B=function(b){a(this).addClass("colorpicker_focus")},C=function(b){a(this).removeClass("colorpicker_focus")},D=function(b){var c=a(this).parent(),d=c.data("colorpicker").color;c.data("colorpicker").origColor=d,m(d,c.get(0)),c.data("colorpicker").onSubmit(d,Q(d),O(d),c.data("colorpicker").el)},E=function(b){var c=a("#"+a(this).data("colorpickerId"));c.data("colorpicker").onBeforeShow.apply(this,[c.get(0)]);var d=a(this).offset(),e=H(),f=d.top+this.offsetHeight,g=d.left;return f+176>e.t+e.h&&(f-=this.offsetHeight+176),g+356>e.l+e.w&&(g-=356),c.css({left:g+"px",top:f+"px"}),0!=c.data("colorpicker").onShow.apply(this,[c.get(0)])&&c.show(),a(document).bind("mousedown",{cal:c},F),!1},F=function(b){G(b.data.cal.get(0),b.target,b.data.cal.get(0))||(0!=b.data.cal.data("colorpicker").onHide.apply(this,[b.data.cal.get(0)])&&b.data.cal.hide(),a(document).unbind("mousedown",F))},G=function(a,b,c){if(a==b)return!0;if(a.contains)return a.contains(b);if(a.compareDocumentPosition)return!!(16&a.compareDocumentPosition(b));for(var d=b.parentNode;d&&d!=c;){if(d==a)return!0;d=d.parentNode}return!1},H=function(){var a="CSS1Compat"==document.compatMode;return{l:window.pageXOffset||(a?document.documentElement.scrollLeft:document.body.scrollLeft),t:window.pageYOffset||(a?document.documentElement.scrollTop:document.body.scrollTop),w:window.innerWidth||(a?document.documentElement.clientWidth:document.body.clientWidth),h:window.innerHeight||(a?document.documentElement.clientHeight:document.body.clientHeight)}},I=function(a){return{h:Math.min(360,Math.max(0,a.h)),s:Math.min(100,Math.max(0,a.s)),b:Math.min(100,Math.max(0,a.b))}},J=function(a){return{r:Math.min(255,Math.max(0,a.r)),g:Math.min(255,Math.max(0,a.g)),b:Math.min(255,Math.max(0,a.b))}},K=function(a){var b=6-a.length;if(b>0){for(var c=[],d=0;d<b;d++)c.push("0");c.push(a),a=c.join("")}return a},L=function(a){var a=parseInt(a.indexOf("#")>-1?a.substring(1):a,16);return{r:a>>16,g:(65280&a)>>8,b:255&a}},M=function(a){return N(L(a))},N=function(a){var b={h:0,s:0,b:0},c=Math.min(a.r,a.g,a.b),d=Math.max(a.r,a.g,a.b),e=d-c;return b.b=d,b.s=0!=d?255*e/d:0,0!=b.s?a.r==d?b.h=(a.g-a.b)/e:a.g==d?b.h=2+(a.b-a.r)/e:b.h=4+(a.r-a.g)/e:b.h=-1,b.h*=60,b.h<0&&(b.h+=360),b.s*=100/255,b.b*=100/255,b},O=function(a){var b={},c=Math.round(a.h),d=Math.round(255*a.s/100),e=Math.round(255*a.b/100);if(0==d)b.r=b.g=b.b=e;else{var f=e,g=(255-d)*e/255,h=(f-g)*(c%60)/60;360==c&&(c=0),c<60?(b.r=f,b.b=g,b.g=g+h):c<120?(b.g=f,b.b=g,b.r=f-h):c<180?(b.g=f,b.r=g,b.b=g+h):c<240?(b.b=f,b.r=g,b.g=f-h):c<300?(b.b=f,b.g=g,b.r=g+h):c<360?(b.r=f,b.g=g,b.b=f-h):(b.r=0,b.g=0,b.b=0)}return{r:Math.round(b.r),g:Math.round(b.g),b:Math.round(b.b)}},P=function(b){var c=[b.r.toString(16),b.g.toString(16),b.b.toString(16)];return a.each(c,function(a,b){1==b.length&&(c[a]="0"+b)}),c.join("")},Q=function(a){return P(O(a))},R=function(){var b=a(this).parent(),c=b.data("colorpicker").origColor;b.data("colorpicker").color=c,h(c,b.get(0)),j(c,b.get(0)),i(c,b.get(0)),k(c,b.get(0)),l(c,b.get(0)),n(c,b.get(0))};return{init:function(b){if(b=a.extend({},g,b||{}),"string"==typeof b.color)b.color=M(b.color);else if(void 0!=b.color.r&&void 0!=b.color.g&&void 0!=b.color.b)b.color=N(b.color);else{if(void 0==b.color.h||void 0==b.color.s||void 0==b.color.b)return this;b.color=I(b.color)}return this.each(function(){if(!a(this).data("colorpickerId")){var c=a.extend({},b);c.origColor=b.color;var d="collorpicker_"+parseInt(1e3*Math.random());a(this).data("colorpickerId",d);var e=a(f).attr("id",d);c.flat?e.appendTo(this).show():e.appendTo(document.body),c.fields=e.find("input").bind("keyup",o).bind("change",p).bind("blur",q).bind("focus",r),e.find("span").bind("mousedown",s).end().find(">div.colorpicker_current_color").bind("click",R),c.selector=e.find("div.colorpicker_color").bind("mousedown",y),c.selectorIndic=c.selector.find("div div"),c.el=this,c.hue=e.find("div.colorpicker_hue div"),e.find("div.colorpicker_hue").bind("mousedown",v),c.newColor=e.find("div.colorpicker_new_color"),c.currentColor=e.find("div.colorpicker_current_color"),e.data("colorpicker",c),e.find("div.colorpicker_submit").bind("mouseenter",B).bind("mouseleave",C).bind("click",D),h(c.color,e.get(0)),i(c.color,e.get(0)),j(c.color,e.get(0)),l(c.color,e.get(0)),k(c.color,e.get(0)),m(c.color,e.get(0)),n(c.color,e.get(0)),c.flat?e.css({position:"relative",display:"block"}):a(this).bind(c.eventName,E)}})},showPicker:function(){return this.each(function(){a(this).data("colorpickerId")&&E.apply(this)})},hidePicker:function(){return this.each(function(){a(this).data("colorpickerId")&&a("#"+a(this).data("colorpickerId")).hide()})},setColor:function(b){if("string"==typeof b)b=M(b);else if(void 0!=b.r&&void 0!=b.g&&void 0!=b.b)b=N(b);else{if(void 0==b.h||void 0==b.s||void 0==b.b)return this;b=I(b)}return this.each(function(){if(a(this).data("colorpickerId")){var c=a("#"+a(this).data("colorpickerId"));c.data("colorpicker").color=b,c.data("colorpicker").origColor=b,h(b,c.get(0)),i(b,c.get(0)),j(b,c.get(0)),l(b,c.get(0)),k(b,c.get(0)),m(b,c.get(0)),n(b,c.get(0))}})}}}();a.fn.extend({ColorPicker:b.init,ColorPickerHide:b.hidePicker,ColorPickerShow:b.showPicker,ColorPickerSetColor:b.setColor})}(jQuery);

/*!
 * jQuery ClassyGradient
 * www.class.pm
 *
 * Written by Marius Stanciu - Sergiu <marius@class.pm>
 * Licensed under the MIT license www.class.pm/LICENSE-MIT
 * Version 1.1.0
 *
 */

+function(a){a.ClassyGradient=function(b,c){var f,g,h,i,j,k,l,m,n,o,d={gradient:"0% #02CDE8, 100% #000000",width:300,height:18,point:8,orientation:"vertical",target:null,onChange:function(){},onInit:function(){}},e=a(b),p=new Array;return this.settings={},this.__constructor=function(){return this.settings=a.extend({},d,c),this.update(),this.settings.onInit(),this},this.update=function(){this._setupPoints(),this._setup(),this._render()},this.getCSS=function(){var b="",c="0%",d="100%",e="left bottom",f="top";"horizontal"===this.settings.orientation&&(c="100%",d="0%",e="right top",f="left"),f=this.settings.orientation;var g='<svg xmlns="http://www.w3.org/2000/svg"><defs><linearGradient id="gradient" x1="0%" y1="0%" x2="'+c+'" y2="'+d+'">',h="-webkit-gradient(linear, left top, "+e,i="";return a.each(p,function(a,b){h+=", color-stop("+b[0]+", "+b[1]+")",i+=","+b[1]+" "+b[0],g+='<stop offset="'+b[0]+'" style="stop-color:'+b[1]+';" />'}),h+=")",i=i.substr(1),g+='</linearGradient></defs><rect fill="url(#gradient)" height="100%" width="100%" /></svg>',g=this._base64(g),b+="background: url(data:image/svg+xml;base64,"+g+");\n",b+="background: "+h+";\n",b+="background: -moz-linear-gradient("+f+","+i+");\n",b+="background: -webkit-linear-gradient("+f+","+i+");\n",b+="background: -o-linear-gradient("+f+","+i+");\n",b+="background: -ms-linear-gradient("+f+","+i+");\n",b+="background: linear-gradient("+f+","+i+");"},this.getArray=function(){return p},this.getString=function(){var b="";return a.each(p,function(a,c){b+=c[0]+" "+c[1]+","}),b=b.substr(0,b.length-1)},this.setOrientation=function(a){this.settings.orientation=a,this._renderToTarget()},this._setupPoints=function(){p=new Array,p=a.isArray(this.settings.gradient)?this.settings.gradient:this._getGradientFromString(this.settings.gradient)},this._setup=function(){var b=this;e.empty(),f=a('<div class="ClassyGradient"></div>'),g=a('<canvas class="canvas" width="'+this.settings.width+'" height="'+this.settings.height+'"></canvas>'),f.append(g),n=g.get(0).getContext("2d"),h=a('<div class="points"></div>'),h.css("width",this.settings.width+Math.round(this.settings.point/2+1)+"px"),f.append(h),i=a('<div class="info"></div>'),i.append('<div class="arrow"></div>'),f.append(i),j=a('<div class="content"></div>'),i.append(j),e.hover(function(){e.addClass("hover")},function(){e.removeClass("hover")}),k=a('<div class="point-color"><div style="background-color: #00ff00"></div></div>'),l=a('<span class="point-position">%</span>'),m=a('<a href="#" class="delete"></a>'),j.append(k,l,m),e.append(f),k.ColorPicker({color:"#00ff00",onSubmit:function(a,c,d){e.find(".point-color div").css("backgroundColor","#"+c),o.css("backgroundColor","#"+c),b._renderCanvas(),b._renderToTarget()},onChange:function(a,c,d){e.find(".point-color div").css("backgroundColor","#"+c),o.css("backgroundColor","#"+c),b._renderCanvas(),b._renderToTarget()}}),a(document).bind("click",function(){e.is(".hover")||i.hide("fast")}),g.unbind("click"),g.bind("click",function(c){var d=g.offset(),e=c.pageX-d.left;e=Math.round(100*e/b.settings.width);var f="#000000",i=999999999999;a.each(p,function(a,b){parseInt(b[0])<e&&e-parseInt(b[0])<i?(i=e-parseInt(b[0]),f=b[1]):parseInt(b[0])>e&&parseInt(b[0])-e<i&&(i=parseInt(b[0])-e,f=b[1])}),p.push([e+"%",f]),p.sort(b._sortByPosition),b._render(),a.each(p,function(a,c){c[0]==e+"%"&&b._selectPoint(h.find(".point:eq("+a+")"))})})},this._render=function(){this._initGradientPoints(),this._renderCanvas(),this._renderToTarget()},this._initGradientPoints=function(){var b=this;h.empty(),a.each(p,function(a,c){h.append('<div class="point" style="background-color: '+c[1]+"; left:"+parseInt(c[0])*b.settings.width/100+'px;"></div>')}),h.find(".point").css("width",this.settings.point+"px").css("height",this.settings.point+"px").mouseup(function(){b._selectPoint(this)}).draggable({axis:"x",containment:"parent",drag:function(){b._selectPoint(this),b._renderCanvas(),b._renderToTarget()}})},this._selectPoint=function(b){var c=this;o=a(b);var d=a(b).css("backgroundColor"),f=parseInt(a(b).css("left"));f=Math.round(f/this.settings.width*100),d=d.substr(4,d.length),d=d.substr(0,d.length-1),k.ColorPickerSetColor(this._rgbToHex(d.split(","))),k.find("div").css("backgroundColor",this._rgbToHex(d.split(","))),l.html("Position: "+f+"%"),m.unbind("click").bind("click",function(){return p.length>1&&(p.splice(o.index(),1),c._render(),e.find(".info").hide("fast")),!1}),e.find(".info").css("marginLeft",parseInt(a(b).css("left"))-30+"px").show("fast")},this._renderCanvas=function(){var b=this;p=new Array,e.find(".point").each(function(c,d){var e=Math.round(parseInt(a(d).css("left"))/b.settings.width*100),f=a(d).css("backgroundColor").substr(4,a(d).css("backgroundColor").length-5);f=b._rgbToHex(f.split(",")),p.push([e+"%",f])}),p.sort(b._sortByPosition),this._renderToCanvas(),this.settings.onChange(this.getString(),this.getCSS(),this.getArray())},this._renderToElement=function(b,c){var d="0%",e="100%",f="left bottom",h="top";b!==g&&"horizontal"!==this.settings.orientation||(d="100%",e="0%",f="right top",h="left"),h=this.settings.orientation;var i='<svg xmlns="http://www.w3.org/2000/svg"><defs><linearGradient id="gradient" x1="0%" y1="0%" x2="'+d+'" y2="'+e+'">',k="-webkit-gradient(linear, left top, "+f,l="";if(a.each(c,function(a,b){k+=", color-stop("+b[0]+", "+b[1]+")",l+=","+b[1]+" "+b[0],i+='<stop offset="'+b[0]+'" style="stop-color:'+b[1]+';" />'}),k+=")",l=l.substr(1),i+="</linearGradient></defs>",b===j){var m=parseInt(j.css("borderRadius"));i+='<rect fill="url(#gradient)" height="100%" width="100%" rx="'+m+'" ry="'+m+'" />'}else i+='<rect fill="url(#gradient)" height="100%" width="100%" />';i+="</svg>",i=this._base64(i),b.css("background","url(data:image/svg+xml;base64,"+i+")"),b.css("background",k),b.css("background","-moz-linear-gradient("+h+","+l+")"),b.css("background","-webkit-linear-gradient("+h+","+l+")"),b.css("background","-o-linear-gradient("+h+","+l+")"),b.css("background","-ms-linear-gradient("+h+","+l+")"),b.css("background","linear-gradient("+h+","+l+")")},this._renderToTarget=function(){null!==this.settings.target&&this._renderToElement(a(this.settings.target),p)},this._renderToCanvas=function(){var b=n.createLinearGradient(0,0,this.settings.width,0);a.each(p,function(a,c){b.addColorStop(parseInt(c[0])/100,c[1])}),n.clearRect(0,0,this.settings.width,this.settings.height),n.fillStyle=b,n.fillRect(0,0,this.settings.width,this.settings.height),this.settings.onChange(this.getString(),this.getCSS(),this.getArray())},this._getGradientFromString=function(b){var c=new Array,d=b.split(",");return a.each(d,function(a,b){var d;"100"==b.substr(b.indexOf("%")-3,b.indexOf("%"))||"100%"==b.substr(b.indexOf("%")-3,b.indexOf("%"))?d="100%":b.indexOf("%")>1?(d=parseInt(b.substr(b.indexOf("%")-2,b.indexOf("%"))),d+="%"):(d=parseInt(b.substr(b.indexOf("%")-1,b.indexOf("%"))),d+="%");var e=b.substr(b.indexOf("#"),7);c.push([d,e])}),c},this._rgbToHex=function(a){function e(a){return a=parseInt(a,10),isNaN(a)?"00":(a=Math.max(0,Math.min(a,255)),"0123456789ABCDEF".charAt((a-a%16)/16)+"0123456789ABCDEF".charAt(a%16))}var b=a[0],c=a[1],d=a[2];return"#"+e(b)+e(c)+e(d)},this._sortByPosition=function(a,b){return parseInt(a[0])<parseInt(b[0])?-1:parseInt(a[0])>parseInt(b[0])?1:0},this._base64=function(a){for(var d,e,f,g,h,i,j,b="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",c="",k=0;k<a.length;)d=a.charCodeAt(k++),e=a.charCodeAt(k++),f=a.charCodeAt(k++),g=d>>2,h=(3&d)<<4|e>>4,i=(15&e)<<2|f>>6,j=63&f,isNaN(e)?i=j=64:isNaN(f)&&(j=64),c+=b.charAt(g)+b.charAt(h)+b.charAt(i)+b.charAt(j);return c},this.__constructor()},a.fn.ClassyGradient=function(b){return this.each(function(){if(void 0===a(this).data("ClassyGradient")){var c=new a.ClassyGradient(this,b);a(this).data("ClassyGradient",c)}})}}(jQuery);


/*!
 * JavaScript Cookie v2.1.3
 * https://github.com/js-cookie/js-cookie
 *
 * Copyright 2006, 2015 Klaus Hartl & Fagner Brack
 * Released under the MIT license
 */
!function(a){var b=!1;if("function"==typeof define&&define.amd&&(define(a),b=!0),"object"==typeof exports&&(module.exports=a(),b=!0),!b){var c=window.Cookies,d=window.Cookies=a();d.noConflict=function(){return window.Cookies=c,d}}}(function(){function a(){for(var a=0,b={};a<arguments.length;a++){var c=arguments[a];for(var d in c)b[d]=c[d]}return b}function b(c){function d(b,e,f){var g;if("undefined"!=typeof document){if(arguments.length>1){if(f=a({path:"/"},d.defaults,f),"number"==typeof f.expires){var h=new Date;h.setMilliseconds(h.getMilliseconds()+864e5*f.expires),f.expires=h}try{g=JSON.stringify(e),/^[\{\[]/.test(g)&&(e=g)}catch(a){}return e=c.write?c.write(e,b):encodeURIComponent(String(e)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),b=encodeURIComponent(String(b)),b=b.replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent),b=b.replace(/[\(\)]/g,escape),document.cookie=[b,"=",e,f.expires?"; expires="+f.expires.toUTCString():"",f.path?"; path="+f.path:"",f.domain?"; domain="+f.domain:"",f.secure?"; secure":""].join("")}b||(g={});for(var i=document.cookie?document.cookie.split("; "):[],j=/(%[0-9A-Z]{2})+/g,k=0;k<i.length;k++){var l=i[k].split("="),m=l.slice(1).join("=");'"'===m.charAt(0)&&(m=m.slice(1,-1));try{var n=l[0].replace(j,decodeURIComponent);if(m=c.read?c.read(m,n):c(m,n)||m.replace(j,decodeURIComponent),this.json)try{m=JSON.parse(m)}catch(a){}if(b===n){g=m;break}b||(g[n]=m)}catch(a){}}return g}}return d.set=d,d.get=function(a){return d.call(d,a)},d.getJSON=function(){return d.apply({json:!0},[].slice.call(arguments))},d.defaults={},d.remove=function(b,c){d(b,"",a(c,{expires:-1}))},d.withConverter=b,d}return b(function(){})});

/**
 * @license
 * =========================================================
 * bootstrap-datetimepicker.js
 * http://www.eyecon.ro/bootstrap-datepicker
 * =========================================================
 * Copyright 2012 Stefan Petre
 *
 * Contributions:
 *  - Andrew Rowls
 *  - Thiago de Arruda
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * =========================================================
 */
!function(a){function l(a){return a.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}function m(a,b,c){return b<a.length?a:Array(b-a.length+1).join(c||" ")+a}function n(a,b,c,d,e,f){return b&&c?'<div class="bootstrap-datetimepicker-widget dropdown-menu"><ul><li'+(f?' class="collapse in"':"")+'><div class="datepicker">'+p.template+'</div></li><li class="picker-switch accordion-toggle"><a><i class="fa fa-clock-o"></i></a></li><li'+(f?' class="collapse"':"")+'><div class="timepicker">'+q.getTemplate(d,e)+"</div></li></ul></div>":c?'<div class="bootstrap-datetimepicker-widget dropdown-menu"><div class="timepicker">'+q.getTemplate(d,e)+"</div></div>":'<div class="bootstrap-datetimepicker-widget dropdown-menu"><div class="datepicker">'+p.template+"</div></div>"}function o(){return new Date(Date.UTC.apply(Date,arguments))}var c=(void 0!=window.orientation,function(a,b){this.id=e++,this.init(a,b)});c.prototype={constructor:c,init:function(b,c){var d;if(!c.pickTime&&!c.pickDate)throw new Error("Must choose at least one picker");if(this.options=c,this.$element=a(b),this.language=c.language in f?c.language:"en",this.pickDate=c.pickDate,this.pickTime=c.pickTime,this.isInput=this.$element.is("input"),this.component=!1,(this.$element.find(".input-append")||this.$element.find(".input-prepend"))&&(this.component=this.$element.find(".add-on")),this.format=c.format,this.format||(this.isInput?this.format=this.$element.data("format"):this.format=this.$element.find("input").data("format"),this.format||(this.format="MM/dd/yyyy")),this._compileFormat(),this.component&&(d=this.component.find("i")),this.pickTime&&(d&&d.length&&(this.timeIcon=d.data("time-icon")),this.timeIcon||(this.timeIcon="fa fa-clock-o"),d.addClass(this.timeIcon)),this.pickDate&&(d&&d.length&&(this.dateIcon=d.data("date-icon")),this.dateIcon||(this.dateIcon="fa fa-calendar"),d.removeClass(this.timeIcon),d.addClass(this.dateIcon)),this.widget=a(n(this.timeIcon,c.pickDate,c.pickTime,c.pick12HourFormat,c.pickSeconds,c.collapse)).appendTo("body"),this.minViewMode=c.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=c.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=c.weekStart||this.$element.data("date-weekstart")||0,this.weekEnd=0===this.weekStart?6:this.weekStart-1,this.setStartDate(c.startDate||this.$element.data("date-startdate")),this.setEndDate(c.endDate||this.$element.data("date-enddate")),this.fillDow(),this.fillMonths(),this.fillHours(),this.fillMinutes(),this.fillSeconds(),this.update(),this.showMode(),this._attachDatePickerEvents()},show:function(a){this.widget.show(),this.height=this.component?this.component.outerHeight():this.$element.outerHeight(),this.place(),this._attachDatePickerGlobalEvents(),a&&(a.stopPropagation(),a.preventDefault())},disable:function(){this.$element.find("input").prop("disabled",!0),this._detachDatePickerEvents()},enable:function(){this.$element.find("input").prop("disabled",!1),this._attachDatePickerEvents()},hide:function(){for(var a=this.widget.find(".collapse"),b=0;b<a.length;b++){var c=a.eq(b).data("collapse");if(c&&c.transitioning)return}this.widget.hide(),this.viewMode=this.startViewMode,this.showMode(),this.set(),this._detachDatePickerGlobalEvents()},set:function(){var a="";if(this._unset||(a=this.formatDate(this._date)),this.isInput)this.$element.val(a),this._resetMaskPos(this.$element);else{if(this.component){var b=this.$element.find("input");b.val(a),this._resetMaskPos(b)}this.$element.data("date",a)}},setValue:function(a){a?this._unset=!1:this._unset=!0,"string"==typeof a?this._date=this.parseDate(a):a&&(this._date=new Date(a)),this.set(),this.viewDate=o(this._date.getUTCFullYear(),this._date.getUTCMonth(),1,0,0,0,0),this.fillDate(),this.fillTime()},getDate:function(){return this._unset?null:new Date(this._date.valueOf())},setDate:function(a){a?this.setValue(a.valueOf()):this.setValue(null)},setStartDate:function(a){a instanceof Date?this.startDate=a:"string"==typeof a?(this.startDate=new o(a),this.startDate.getUTCFullYear()||(this.startDate=-(1/0))):this.startDate=-(1/0),this.viewDate&&this.update()},setEndDate:function(a){a instanceof Date?this.endDate=a:"string"==typeof a?(this.endDate=new o(a),this.endDate.getUTCFullYear()||(this.endDate=1/0)):this.endDate=1/0,this.viewDate&&this.update()},getLocalDate:function(){if(this._unset)return null;var a=this._date;return new Date(a.getUTCFullYear(),a.getUTCMonth(),a.getUTCDate(),a.getUTCHours(),a.getUTCMinutes(),a.getUTCSeconds(),a.getUTCMilliseconds())},setLocalDate:function(a){a?this.setValue(Date.UTC(a.getFullYear(),a.getMonth(),a.getDate(),a.getHours(),a.getMinutes(),a.getSeconds(),a.getMilliseconds())):this.setValue(null)},place:function(){var b="fixed",c=this.component?this.component.offset():this.$element.offset();this.width=this.component?this.component.outerWidth():this.$element.outerWidth(),c.top=c.top+this.height;var d=a(window);void 0!=this.options.width&&this.widget.width(this.options.width),"left"==this.options.orientation&&(this.widget.addClass("left-oriented"),c.left=c.left-this.widget.width()+20),this._isInFixed()&&(b="fixed",c.top-=d.scrollTop(),c.left-=d.scrollLeft()),d.width()<c.left+this.widget.outerWidth()?(c.right=d.width()-c.left-this.width,c.left="auto",this.widget.addClass("pull-right")):(c.right="auto",this.widget.removeClass("pull-right")),this.widget.css({position:b,top:c.top,left:c.left,right:c.right})},notifyChange:function(){this.$element.trigger({type:"changeDate",date:this.getDate(),localDate:this.getLocalDate()})},update:function(a){var b=a;if(!b&&(b=this.isInput?this.$element.val():this.$element.find("input").val(),b&&(this._date=this.parseDate(b)),!this._date)){var c=new Date;this._date=o(c.getFullYear(),c.getMonth(),c.getDate(),c.getHours(),c.getMinutes(),c.getSeconds(),c.getMilliseconds())}this.viewDate=o(this._date.getUTCFullYear(),this._date.getUTCMonth(),1,0,0,0,0),this.fillDate(),this.fillTime()},fillDow:function(){for(var b=this.weekStart,c=a("<tr>");b<this.weekStart+7;)c.append('<th class="dow">'+f[this.language].daysMin[b++%7]+"</th>");this.widget.find(".datepicker-days thead").append(c)},fillMonths:function(){for(var a="",b=0;b<12;)a+='<span class="month">'+f[this.language].monthsShort[b++]+"</span>";this.widget.find(".datepicker-months td").append(a)},fillDate:function(){var b=this.viewDate.getUTCFullYear(),c=this.viewDate.getUTCMonth(),d=o(this._date.getUTCFullYear(),this._date.getUTCMonth(),this._date.getUTCDate(),0,0,0,0),e="object"==typeof this.startDate?this.startDate.getUTCFullYear():-(1/0),g="object"==typeof this.startDate?this.startDate.getUTCMonth():-1,h="object"==typeof this.endDate?this.endDate.getUTCFullYear():1/0,i="object"==typeof this.endDate?this.endDate.getUTCMonth():12;this.widget.find(".datepicker-days").find(".disabled").removeClass("disabled"),this.widget.find(".datepicker-months").find(".disabled").removeClass("disabled"),this.widget.find(".datepicker-years").find(".disabled").removeClass("disabled"),this.widget.find(".datepicker-days th:eq(1)").text(f[this.language].months[c]+" "+b);var j=o(b,c-1,28,0,0,0,0),k=p.getDaysInMonth(j.getUTCFullYear(),j.getUTCMonth());j.setUTCDate(k),j.setUTCDate(k-(j.getUTCDay()-this.weekStart+7)%7),(b==e&&c<=g||b<e)&&this.widget.find(".datepicker-days th:eq(0)").addClass("disabled"),(b==h&&c>=i||b>h)&&this.widget.find(".datepicker-days th:eq(2)").addClass("disabled");var l=new Date(j.valueOf());l.setUTCDate(l.getUTCDate()+42),l=l.valueOf();for(var n,q,m=[];j.valueOf()<l;)j.getUTCDay()===this.weekStart&&(n=a("<tr>"),m.push(n)),q="",j.getUTCFullYear()<b||j.getUTCFullYear()==b&&j.getUTCMonth()<c?q+=" old":(j.getUTCFullYear()>b||j.getUTCFullYear()==b&&j.getUTCMonth()>c)&&(q+=" new"),j.valueOf()===d.valueOf()&&(q+=" active"),j.valueOf()+864e5<=this.startDate&&(q+=" disabled"),j.valueOf()>this.endDate&&(q+=" disabled"),n.append('<td class="day'+q+'">'+j.getUTCDate()+"</td>"),j.setUTCDate(j.getUTCDate()+1);this.widget.find(".datepicker-days tbody").empty().append(m);var r=this._date.getUTCFullYear(),s=this.widget.find(".datepicker-months").find("th:eq(1)").text(b).end().find("span").removeClass("active");r===b&&s.eq(this._date.getUTCMonth()).addClass("active"),r-1<e&&this.widget.find(".datepicker-months th:eq(0)").addClass("disabled"),r+1>h&&this.widget.find(".datepicker-months th:eq(2)").addClass("disabled");for(var t=0;t<12;t++)b==e&&g>t||b<e?a(s[t]).addClass("disabled"):(b==h&&i<t||b>h)&&a(s[t]).addClass("disabled");m="",b=10*parseInt(b/10,10);var u=this.widget.find(".datepicker-years").find("th:eq(1)").text(b+"-"+(b+9)).end().find("td");this.widget.find(".datepicker-years").find("th").removeClass("disabled"),e>b&&this.widget.find(".datepicker-years").find("th:eq(0)").addClass("disabled"),h<b+9&&this.widget.find(".datepicker-years").find("th:eq(2)").addClass("disabled"),b-=1;for(var t=-1;t<11;t++)m+='<span class="year'+(t===-1||10===t?" old":"")+(r===b?" active":"")+(b<e||b>h?" disabled":"")+'">'+b+"</span>",b+=1;u.html(m)},fillHours:function(){var a=this.widget.find(".timepicker .timepicker-hours table");a.parent().hide();var b="";if(this.options.pick12HourFormat)for(var c=1,d=0;d<3;d+=1){b+="<tr>";for(var e=0;e<4;e+=1){var f=c.toString();b+='<td class="hour">'+m(f,2,"0")+"</td>",c++}b+="</tr>"}else for(var c=0,d=0;d<6;d+=1){b+="<tr>";for(var e=0;e<4;e+=1){var f=c.toString();b+='<td class="hour">'+m(f,2,"0")+"</td>",c++}b+="</tr>"}a.html(b)},fillMinutes:function(){var a=this.widget.find(".timepicker .timepicker-minutes table");a.parent().hide();for(var b="",c=0,d=0;d<5;d++){b+="<tr>";for(var e=0;e<4;e+=1){var f=c.toString();b+='<td class="minute">'+m(f,2,"0")+"</td>",c+=3}b+="</tr>"}a.html(b)},fillSeconds:function(){var a=this.widget.find(".timepicker .timepicker-seconds table");a.parent().hide();for(var b="",c=0,d=0;d<5;d++){b+="<tr>";for(var e=0;e<4;e+=1){var f=c.toString();b+='<td class="second">'+m(f,2,"0")+"</td>",c+=3}b+="</tr>"}a.html(b)},fillTime:function(){if(this._date){var a=this.widget.find(".timepicker span[data-time-component]"),c=(a.closest("table"),this.options.pick12HourFormat),d=this._date.getUTCHours(),e="AM";c&&(d>=12&&(e="PM"),0===d?d=12:12!=d&&(d%=12),this.widget.find(".timepicker [data-action=togglePeriod]").text(e)),d=m(d.toString(),2,"0");var f=m(this._date.getUTCMinutes().toString(),2,"0"),g=m(this._date.getUTCSeconds().toString(),2,"0");a.filter("[data-time-component=hours]").text(d),a.filter("[data-time-component=minutes]").text(f),a.filter("[data-time-component=seconds]").text(g)}},click:function(b){b.stopPropagation(),b.preventDefault(),this._unset=!1;var c=a(b.target).closest("span, td, th");if(1===c.length&&!c.is(".disabled"))switch(c[0].nodeName.toLowerCase()){case"th":switch(c[0].className){case"switch":this.showMode(1);break;case"prev":case"next":var d=this.viewDate,e=p.modes[this.viewMode].navFnc,f=p.modes[this.viewMode].navStep;"prev"===c[0].className&&(f*=-1),d["set"+e](d["get"+e]()+f),this.fillDate(),this.set()}break;case"span":if(c.is(".month")){var g=c.parent().find("span").index(c);this.viewDate.setUTCMonth(g)}else{var h=parseInt(c.text(),10)||0;this.viewDate.setUTCFullYear(h)}0!==this.viewMode&&(this._date=o(this.viewDate.getUTCFullYear(),this.viewDate.getUTCMonth(),this.viewDate.getUTCDate(),this._date.getUTCHours(),this._date.getUTCMinutes(),this._date.getUTCSeconds(),this._date.getUTCMilliseconds()),this.notifyChange()),this.showMode(-1),this.fillDate(),this.set();break;case"td":if(c.is(".day")){var i=parseInt(c.text(),10)||1,g=this.viewDate.getUTCMonth(),h=this.viewDate.getUTCFullYear();c.is(".old")?0===g?(g=11,h-=1):g-=1:c.is(".new")&&(11==g?(g=0,h+=1):g+=1),this._date=o(h,g,i,this._date.getUTCHours(),this._date.getUTCMinutes(),this._date.getUTCSeconds(),this._date.getUTCMilliseconds()),this.viewDate=o(h,g,Math.min(28,i),0,0,0,0),this.fillDate(),this.set(),this.notifyChange()}}},actions:{incrementHours:function(a){this._date.setUTCHours(this._date.getUTCHours()+1)},incrementMinutes:function(a){this._date.setUTCMinutes(this._date.getUTCMinutes()+1)},incrementSeconds:function(a){this._date.setUTCSeconds(this._date.getUTCSeconds()+1)},decrementHours:function(a){this._date.setUTCHours(this._date.getUTCHours()-1)},decrementMinutes:function(a){this._date.setUTCMinutes(this._date.getUTCMinutes()-1)},decrementSeconds:function(a){this._date.setUTCSeconds(this._date.getUTCSeconds()-1)},togglePeriod:function(a){var b=this._date.getUTCHours();b>=12?b-=12:b+=12,this._date.setUTCHours(b)},showPicker:function(){this.widget.find(".timepicker > div:not(.timepicker-picker)").hide(),this.widget.find(".timepicker .timepicker-picker").show()},showHours:function(){this.widget.find(".timepicker .timepicker-picker").hide(),this.widget.find(".timepicker .timepicker-hours").show()},showMinutes:function(){this.widget.find(".timepicker .timepicker-picker").hide(),this.widget.find(".timepicker .timepicker-minutes").show()},showSeconds:function(){this.widget.find(".timepicker .timepicker-picker").hide(),this.widget.find(".timepicker .timepicker-seconds").show()},selectHour:function(b){var c=a(b.target),d=parseInt(c.text(),10);if(this.options.pick12HourFormat){var e=this._date.getUTCHours();e>=12?12!=d&&(d=(d+12)%24):12===d?d=0:d%=12}this._date.setUTCHours(d),this.actions.showPicker.call(this)},selectMinute:function(b){var c=a(b.target),d=parseInt(c.text(),10);this._date.setUTCMinutes(d),this.actions.showPicker.call(this)},selectSecond:function(b){var c=a(b.target),d=parseInt(c.text(),10);this._date.setUTCSeconds(d),this.actions.showPicker.call(this)}},doAction:function(b){b.stopPropagation(),b.preventDefault(),this._date||(this._date=o(1970,0,0,0,0,0,0));var c=a(b.currentTarget).data("action"),d=this.actions[c].apply(this,arguments);return this.set(),this.fillTime(),this.notifyChange(),d},stopEvent:function(a){a.stopPropagation(),a.preventDefault()},keydown:function(b){var c=this,d=b.which,e=a(b.target);8!=d&&46!=d||setTimeout(function(){c._resetMaskPos(e)})},keypress:function(b){var c=b.which;if(8!=c&&46!=c){var d=a(b.target),e=String.fromCharCode(c),f=d.val()||"";f+=e;var g=this._mask[this._maskPos];if(!g)return!1;if(g.end==f.length){if(!g.pattern.test(f.slice(g.start))){for(f=f.slice(0,f.length-1);(g=this._mask[this._maskPos])&&g.character;)f+=g.character,this._maskPos++;return f+=e,g.end!=f.length?(d.val(f),!1):g.pattern.test(f.slice(g.start))?(d.val(f),this._maskPos++,!1):(d.val(f.slice(0,g.start)),!1)}this._maskPos++}}},change:function(b){var c=a(b.target),d=c.val();this._formatPattern.test(d)?(this.update(),this.setValue(this._date.getTime()),this.notifyChange(),this.set()):d&&d.trim()?(this.setValue(this._date.getTime()),this._date?this.set():c.val("")):this._date&&(this.setValue(null),this.notifyChange(),this._unset=!0),this._resetMaskPos(c)},showMode:function(a){a&&(this.viewMode=Math.max(this.minViewMode,Math.min(2,this.viewMode+a))),this.widget.find(".datepicker > div").hide().filter(".datepicker-"+p.modes[this.viewMode].clsName).show()},destroy:function(){this._detachDatePickerEvents(),this._detachDatePickerGlobalEvents(),this.widget.remove(),this.$element.removeData("datetimepicker"),this.component.removeData("datetimepicker")},formatDate:function(a){return this.format.replace(k,function(b){var c,d,e,f=b.length;if("ms"===b&&(f=1),d=g[b].property,"Hours12"===d)e=a.getUTCHours(),0===e?e=12:12!==e&&(e%=12);else{if("Period12"===d)return a.getUTCHours()>=12?"PM":"AM";c="get"+d,e=a[c]()}return"getUTCMonth"===c&&(e+=1),"getUTCYear"===c&&(e=e+1900-2e3),m(e.toString(),f,"0")})},parseDate:function(a){var b,c,d,f,g={};if(!(b=this._formatPattern.exec(a)))return null;for(c=1;c<b.length;c++)d=this._propertiesByIndex[c],d&&(f=b[c],/^\d+$/.test(f)&&(f=parseInt(f,10)),g[d]=f);return this._finishParsingDate(g)},_resetMaskPos:function(a){for(var b=a.val(),c=0;c<this._mask.length;c++){if(this._mask[c].end>b.length){this._maskPos=c;break}if(this._mask[c].end===b.length){this._maskPos=c+1;break}}},_finishParsingDate:function(a){var b,c,d,e,f,g,h;return b=a.UTCFullYear,a.UTCYear&&(b=2e3+a.UTCYear),b||(b=1970),c=a.UTCMonth?a.UTCMonth-1:0,d=a.UTCDate||1,e=a.UTCHours||0,f=a.UTCMinutes||0,g=a.UTCSeconds||0,h=a.UTCMilliseconds||0,a.Hours12&&(e=a.Hours12),a.Period12&&(/pm/i.test(a.Period12)?12!=e&&(e=(e+12)%24):e%=12),o(b,c,d,e,f,g,h)},_compileFormat:function(){for(var a,b,c=[],d=[],e=this.format,f={},h=0,i=0;a=j.exec(e);)b=a[0],b in g?(h++,f[h]=g[b].property,c.push("\\s*"+g[b].getPattern(this)+"\\s*"),d.push({pattern:new RegExp(g[b].getPattern(this)),property:g[b].property,start:i,end:i+=b.length})):(c.push(l(b)),d.push({pattern:new RegExp(l(b)),character:b,start:i,end:++i})),e=e.slice(b.length);this._mask=d,this._maskPos=0,this._formatPattern=new RegExp("^\\s*"+c.join("")+"\\s*$"),this._propertiesByIndex=f},_attachDatePickerEvents:function(){var b=this;this.widget.on("click",".datepicker *",a.proxy(this.click,this)),this.widget.on("click","[data-action]",a.proxy(this.doAction,this)),this.widget.on("mousedown",a.proxy(this.stopEvent,this)),this.pickDate&&this.pickTime&&this.widget.on("click.togglePicker",".accordion-toggle",function(c){c.stopPropagation();var d=a(this),e=d.closest("ul"),f=e.find(".collapse.in"),g=e.find(".collapse:not(.in)");if(f&&f.length){var h=f.data("collapse");if(h&&h.transitioning)return;f.css("height","0px").removeClass("in"),g.css("height","auto").addClass("in"),d.find("i").toggleClass(b.timeIcon+" "+b.dateIcon),b.$element.find(".add-on i").toggleClass(b.timeIcon+" "+b.dateIcon)}}),this.isInput?(this.$element.on({focus:a.proxy(this.show,this),change:a.proxy(this.change,this)}),this.options.maskInput&&this.$element.on({keydown:a.proxy(this.keydown,this),keypress:a.proxy(this.keypress,this)})):(this.$element.on({change:a.proxy(this.change,this)},"input"),this.options.maskInput&&this.$element.on({keydown:a.proxy(this.keydown,this),keypress:a.proxy(this.keypress,this)},"input"),this.component?this.component.on("click",a.proxy(this.show,this)):this.$element.on("click",a.proxy(this.show,this)))},_attachDatePickerGlobalEvents:function(){a(window).on("resize.datetimepicker"+this.id,a.proxy(this.place,this)),this.isInput||a(document).on("mousedown.datetimepicker"+this.id,a.proxy(this.hide,this))},_detachDatePickerEvents:function(){this.widget.off("click",".datepicker *",this.click),this.widget.off("click","[data-action]"),this.widget.off("mousedown",this.stopEvent),this.pickDate&&this.pickTime&&this.widget.off("click.togglePicker"),this.isInput?(this.$element.off({focus:this.show,change:this.change}),this.options.maskInput&&this.$element.off({keydown:this.keydown,keypress:this.keypress})):(this.$element.off({change:this.change},"input"),this.options.maskInput&&this.$element.off({keydown:this.keydown,keypress:this.keypress},"input"),this.component?this.component.off("click",this.show):this.$element.off("click",this.show))},_detachDatePickerGlobalEvents:function(){a(window).off("resize.datetimepicker"+this.id),this.isInput||a(document).off("mousedown.datetimepicker"+this.id)},_isInFixed:function(){if(this.$element){for(var b=this.$element.parents(),c=!1,d=0;d<b.length;d++)if("fixed"==a(b[d]).css("position")){c=!0;break}return c}return!1}},a.fn.bsdatetimepicker=function(b,d){return this.each(function(){var e=a(this),f=e.data("datetimepicker"),g="object"==typeof b&&b;f||e.data("datetimepicker",f=new c(this,a.extend({},a.fn.bsdatetimepicker.defaults,g))),"string"==typeof b&&f[b](d)})},a.fn.bsdatetimepicker.defaults={maskInput:!1,pickDate:!0,pickTime:!0,pick12HourFormat:!1,pickSeconds:!0,startDate:-(1/0),endDate:1/0,collapse:!0},a.fn.bsdatetimepicker.Constructor=c;var e=0,f=a.fn.bsdatetimepicker.dates={en:{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"]}},g={dd:{property:"UTCDate",getPattern:function(){return"(0?[1-9]|[1-2][0-9]|3[0-1])\\b"}},MM:{property:"UTCMonth",getPattern:function(){return"(0?[1-9]|1[0-2])\\b"}},yy:{property:"UTCYear",getPattern:function(){return"(\\d{2})\\b"}},yyyy:{property:"UTCFullYear",getPattern:function(){return"(\\d{4})\\b"}},hh:{property:"UTCHours",getPattern:function(){return"(0?[0-9]|1[0-9]|2[0-3])\\b"}},mm:{property:"UTCMinutes",getPattern:function(){return"(0?[0-9]|[1-5][0-9])\\b"}},ss:{property:"UTCSeconds",getPattern:function(){return"(0?[0-9]|[1-5][0-9])\\b"}},ms:{property:"UTCMilliseconds",getPattern:function(){return"([0-9]{1,3})\\b"}},HH:{property:"Hours12",getPattern:function(){return"(0?[1-9]|1[0-2])\\b"}},PP:{property:"Period12",getPattern:function(){return"(AM|PM|am|pm|Am|aM|Pm|pM)\\b"}}},h=[];for(var i in g)h.push(i);h[h.length-1]+="\\b",h.push(".");var j=new RegExp(h.join("\\b|"));h.pop();var k=new RegExp(h.join("\\b|"),"g"),p={modes:[{clsName:"days",navFnc:"UTCMonth",navStep:1},{clsName:"months",navFnc:"UTCFullYear",navStep:1},{clsName:"years",navFnc:"UTCFullYear",navStep:10}],isLeapYear:function(a){return a%4===0&&a%100!==0||a%400===0},getDaysInMonth:function(a,b){return[31,p.isLeapYear(a)?29:28,31,30,31,30,31,31,30,31,30,31][b]},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>'};p.template='<div class="datepicker-days"><table class="table-condensed">'+p.headTemplate+'<tbody></tbody></table></div><div class="datepicker-months"><table class="table-condensed">'+p.headTemplate+p.contTemplate+'</table></div><div class="datepicker-years"><table class="table-condensed">'+p.headTemplate+p.contTemplate+"</table></div>";var q={hourTemplate:'<span data-action="showHours" data-time-component="hours" class="timepicker-hour"></span>',minuteTemplate:'<span data-action="showMinutes" data-time-component="minutes" class="timepicker-minute"></span>',secondTemplate:'<span data-action="showSeconds" data-time-component="seconds" class="timepicker-second"></span>'};q.getTemplate=function(a,b){return'<div class="timepicker-picker"><table class="table-condensed"'+(a?' data-hour-format="12"':"")+'><tr><td><a href="#" class="btn" data-action="incrementHours"><i class="fa  fa-angle-up"></i></a></td><td class="separator"></td><td><a href="#" class="btn" data-action="incrementMinutes"><i class="fa  fa-angle-up"></i></a></td>'+(b?'<td class="separator"></td><td><a href="#" class="btn" data-action="incrementSeconds"><i class="fa  fa-angle-up"></i></a></td>':"")+(a?'<td class="separator"></td>':"")+"</tr><tr><td>"+q.hourTemplate+'</td> <td class="separator">:</td><td>'+q.minuteTemplate+"</td> "+(b?'<td class="separator">:</td><td>'+q.secondTemplate+"</td>":"")+(a?'<td class="separator"></td><td><button type="button" class="btn btn-primary" data-action="togglePeriod"></button></td>':"")+'</tr><tr><td><a href="#" class="btn" data-action="decrementHours"><i class="fa  fa-angle-down"></i></a></td><td class="separator"></td><td><a href="#" class="btn" data-action="decrementMinutes"><i class="fa  fa-angle-down"></i></a></td>'+(b?'<td class="separator"></td><td><a href="#" class="btn" data-action="decrementSeconds"><i class="fa  fa-angle-down"></i></a></td>':"")+(a?'<td class="separator"></td>':"")+'</tr></table></div><div class="timepicker-hours" data-action="selectHour"><table class="table-condensed"></table></div><div class="timepicker-minutes" data-action="selectMinute"><table class="table-condensed"></table></div>'+(b?'<div class="timepicker-seconds" data-action="selectSecond"><table class="table-condensed"></table></div>':"")}}(window.jQuery);