This file is indexed.

/usr/share/javascript/chosen/chosen.jquery.min.js is in libjs-chosen 0.9.15-2.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
// Chosen, a Select Box Enhancer for jQuery and Prototype
// by Patrick Filler for Harvest, http://getharvest.com
//
// Version 0.9.15
// Full source at https://github.com/harvesthq/chosen
// Copyright (c) 2011 Harvest http://getharvest.com

// MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md
// This file is generated by `cake build`, do not edit it by hand.
(function(){var t;t=function(){function t(){this.options_index=0,this.parsed=[]}return t.prototype.add_node=function(t){return"OPTGROUP"===t.nodeName.toUpperCase()?this.add_group(t):this.add_option(t)},t.prototype.add_group=function(t){var e,s,i,r,l,n;for(e=this.parsed.length,this.parsed.push({array_index:e,group:!0,label:t.label,children:0,disabled:t.disabled}),l=t.childNodes,n=[],s=0,i=l.length;s<i;s++)r=l[s],n.push(this.add_option(r,e,t.disabled));return n},t.prototype.add_option=function(t,e,s){if("OPTION"===t.nodeName.toUpperCase())return""!==t.text?(null!=e&&(this.parsed[e].children+=1),this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,value:t.value,text:t.text,html:t.innerHTML,selected:t.selected,disabled:s===!0?s:t.disabled,group_array_index:e,classes:t.className,style:t.style.cssText})):this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,empty:!0}),this.options_index+=1},t}(),t.select_to_array=function(e){var s,i,r,l,n;for(l=new t,n=e.childNodes,i=0,r=n.length;i<r;i++)s=n[i],l.add_node(s);return l.parsed},this.SelectParser=t}).call(this),function(){var t,e;e=this,t=function(){function t(e,s){this.form_field=e,this.options=null!=s?s:{},t.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.finish_setup())}return t.prototype.set_default_values=function(){return this.click_test_action=function(t){return function(e){return t.test_active_click(e)}}(this),this.activate_action=function(t){return function(e){return t.activate_field(e)}}(this),this.active_field=!1,this.mouse_on_container=!1,this.results_showing=!1,this.result_highlighted=null,this.result_single_selected=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.search_contains=this.options.search_contains||!1,this.single_backstroke_delete=this.options.single_backstroke_delete||!1,this.max_selected_options=this.options.max_selected_options||1/0,this.inherit_select_classes=this.options.inherit_select_classes||!1},t.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||t.default_multiple_text:this.default_text=this.options.placeholder_text_single||this.options.placeholder_text||t.default_single_text,this.results_none_found=this.form_field.getAttribute("data-no_results_text")||this.options.no_results_text||t.default_no_result_text},t.prototype.mouse_enter=function(){return this.mouse_on_container=!0},t.prototype.mouse_leave=function(){return this.mouse_on_container=!1},t.prototype.input_focus=function(t){if(this.is_multiple){if(!this.active_field)return setTimeout(function(t){return function(){return t.container_mousedown()}}(this),50)}else if(!this.active_field)return this.activate_field()},t.prototype.input_blur=function(t){if(!this.mouse_on_container)return this.active_field=!1,setTimeout(function(t){return function(){return t.blur_test()}}(this),100)},t.prototype.result_add_option=function(t){var e,s;return t.disabled?"":(t.dom_id=this.container_id+"_o_"+t.array_index,e=t.selected&&this.is_multiple?[]:["active-result"],t.selected&&e.push("result-selected"),null!=t.group_array_index&&e.push("group-option"),""!==t.classes&&e.push(t.classes),s=""!==t.style.cssText?' style="'+t.style+'"':"",'<li id="'+t.dom_id+'" class="'+e.join(" ")+'"'+s+">"+t.html+"</li>")},t.prototype.results_update_field=function(){return this.set_default_text(),this.is_multiple||this.results_reset_cleanup(),this.result_clear_highlight(),this.result_single_selected=null,this.results_build()},t.prototype.results_toggle=function(){return this.results_showing?this.results_hide():this.results_show()},t.prototype.results_search=function(t){return this.results_showing?this.winnow_results():this.results_show()},t.prototype.choices_count=function(){var t,e,s,i;if(null!=this.selected_option_count)return this.selected_option_count;for(this.selected_option_count=0,i=this.form_field.options,t=0,e=i.length;t<e;t++)s=i[t],s.selected&&(this.selected_option_count+=1);return this.selected_option_count},t.prototype.choices_click=function(t){if(t.preventDefault(),!this.results_showing)return this.results_show()},t.prototype.keyup_checker=function(t){var e,s;switch(s=null!=(e=t.which)?e:t.keyCode,this.search_field_scale(),s){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(t.preventDefault(),this.results_showing)return this.result_select(t);break;case 27:return this.results_showing&&this.results_hide(),!0;case 9:case 38:case 40:case 16:case 91:case 17:break;default:return this.results_search()}},t.prototype.generate_field_id=function(){var t;return t=this.generate_random_id(),this.form_field.id=t,t},t.prototype.generate_random_char=function(){var t,e,s;return t="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ",s=Math.floor(Math.random()*t.length),e=t.substring(s,s+1)},t.prototype.container_width=function(){return null!=this.options.width?this.options.width:this.form_field.offsetWidth+"px"},t.browser_is_supported=function(){var t;return"Microsoft Internet Explorer"!==window.navigator.appName||null!==(t=document.documentMode)&&t>=8},t.default_multiple_text="Select Some Options",t.default_single_text="Select an Option",t.default_no_result_text="No results match",t}(),e.AbstractChosen=t}.call(this),function(){var t,e,s,i=function(t,e){function s(){this.constructor=t}for(var i in e)r.call(e,i)&&(t[i]=e[i]);return s.prototype=e.prototype,t.prototype=new s,t.__super__=e.prototype,t},r={}.hasOwnProperty;s=this,t=jQuery,t.fn.extend({chosen:function(s){return AbstractChosen.browser_is_supported()?this.each(function(i){var r;if(r=t(this),!r.hasClass("chzn-done"))return r.data("chosen",new e(this,s))}):this}}),e=function(e){function r(){return r.__super__.constructor.apply(this,arguments)}return i(r,e),r.prototype.setup=function(){return this.form_field_jq=t(this.form_field),this.current_selectedIndex=this.form_field.selectedIndex,this.is_rtl=this.form_field_jq.hasClass("chzn-rtl")},r.prototype.finish_setup=function(){return this.form_field_jq.addClass("chzn-done")},r.prototype.set_up_html=function(){var e,s;return this.container_id=this.form_field.id.length?this.form_field.id.replace(/[^\w]/g,"_"):this.generate_field_id(),this.container_id+="_chzn",e=["chzn-container"],e.push("chzn-container-"+(this.is_multiple?"multi":"single")),this.inherit_select_classes&&this.form_field.className&&e.push(this.form_field.className),this.is_rtl&&e.push("chzn-rtl"),s={id:this.container_id,class:e.join(" "),style:"width: "+this.container_width()+";",title:this.form_field.title},this.container=t("<div />",s),this.is_multiple?this.container.html('<ul class="chzn-choices"><li class="search-field"><input type="text" value="'+this.default_text+'" class="default" autocomplete="off" style="width:25px;" /></li></ul><div class="chzn-drop"><ul class="chzn-results"></ul></div>'):this.container.html('<a href="javascript:void(0)" class="chzn-single chzn-default" tabindex="-1"><span>'+this.default_text+'</span><div><b></b></div></a><div class="chzn-drop"><div class="chzn-search"><input type="text" autocomplete="off" /></div><ul class="chzn-results"></ul></div>'),this.form_field_jq.hide().after(this.container),this.dropdown=this.container.find("div.chzn-drop").first(),this.search_field=this.container.find("input").first(),this.search_results=this.container.find("ul.chzn-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.chzn-choices").first(),this.search_container=this.container.find("li.search-field").first()):(this.search_container=this.container.find("div.chzn-search").first(),this.selected_item=this.container.find(".chzn-single").first()),this.results_build(),this.set_tab_index(),this.set_label_behavior(),this.form_field_jq.trigger("liszt:ready",{chosen:this})},r.prototype.register_observers=function(){return this.container.mousedown(function(t){return function(e){t.container_mousedown(e)}}(this)),this.container.mouseup(function(t){return function(e){t.container_mouseup(e)}}(this)),this.container.mouseenter(function(t){return function(e){t.mouse_enter(e)}}(this)),this.container.mouseleave(function(t){return function(e){t.mouse_leave(e)}}(this)),this.search_results.mouseup(function(t){return function(e){t.search_results_mouseup(e)}}(this)),this.search_results.mouseover(function(t){return function(e){t.search_results_mouseover(e)}}(this)),this.search_results.mouseout(function(t){return function(e){t.search_results_mouseout(e)}}(this)),this.search_results.bind("mousewheel DOMMouseScroll",function(t){return function(e){t.search_results_mousewheel(e)}}(this)),this.form_field_jq.bind("liszt:updated",function(t){return function(e){t.results_update_field(e)}}(this)),this.form_field_jq.bind("liszt:activate",function(t){return function(e){t.activate_field(e)}}(this)),this.form_field_jq.bind("liszt:open",function(t){return function(e){t.container_mousedown(e)}}(this)),this.search_field.blur(function(t){return function(e){t.input_blur(e)}}(this)),this.search_field.keyup(function(t){return function(e){t.keyup_checker(e)}}(this)),this.search_field.keydown(function(t){return function(e){t.keydown_checker(e)}}(this)),this.search_field.focus(function(t){return function(e){t.input_focus(e)}}(this)),this.is_multiple?this.search_choices.click(function(t){return function(e){t.choices_click(e)}}(this)):this.container.click(function(t){return function(t){t.preventDefault()}}(this))},r.prototype.search_field_disabled=function(){return this.is_disabled=this.form_field_jq[0].disabled,this.is_disabled?(this.container.addClass("chzn-disabled"),this.search_field[0].disabled=!0,this.is_multiple||this.selected_item.unbind("focus",this.activate_action),this.close_field()):(this.container.removeClass("chzn-disabled"),this.search_field[0].disabled=!1,this.is_multiple?void 0:this.selected_item.bind("focus",this.activate_action))},r.prototype.container_mousedown=function(e){if(!this.is_disabled&&(e&&"mousedown"===e.type&&!this.results_showing&&e.preventDefault(),null==e||!t(e.target).hasClass("search-choice-close")))return this.active_field?this.is_multiple||!e||t(e.target)[0]!==this.selected_item[0]&&!t(e.target).parents("a.chzn-single").length||(e.preventDefault(),this.results_toggle()):(this.is_multiple&&this.search_field.val(""),t(document).click(this.click_test_action),this.results_show()),this.activate_field()},r.prototype.container_mouseup=function(t){if("ABBR"===t.target.nodeName&&!this.is_disabled)return this.results_reset(t)},r.prototype.search_results_mousewheel=function(t){var e,s,i;if(e=-(null!=(s=t.originalEvent)?s.wheelDelta:void 0)||(null!=(i=t.originialEvent)?i.detail:void 0),null!=e)return t.preventDefault(),"DOMMouseScroll"===t.type&&(e*=40),this.search_results.scrollTop(e+this.search_results.scrollTop())},r.prototype.blur_test=function(t){if(!this.active_field&&this.container.hasClass("chzn-container-active"))return this.close_field()},r.prototype.close_field=function(){return t(document).unbind("click",this.click_test_action),this.active_field=!1,this.results_hide(),this.container.removeClass("chzn-container-active"),this.winnow_results_clear(),this.clear_backstroke(),this.show_search_field_default(),this.search_field_scale()},r.prototype.activate_field=function(){return this.container.addClass("chzn-container-active"),this.active_field=!0,this.search_field.val(this.search_field.val()),this.search_field.focus()},r.prototype.test_active_click=function(e){return t(e.target).parents("#"+this.container_id).length?this.active_field=!0:this.close_field()},r.prototype.results_build=function(){var t,e,i,r,l;for(this.parsing=!0,this.selected_option_count=null,this.results_data=s.SelectParser.select_to_array(this.form_field),this.is_multiple&&this.choices_count()>0?this.search_choices.find("li.search-choice").remove():this.is_multiple||(this.selected_item.addClass("chzn-default").find("span").text(this.default_text),this.disable_search||this.form_field.options.length<=this.disable_search_threshold?this.container.addClass("chzn-container-single-nosearch"):this.container.removeClass("chzn-container-single-nosearch")),t="",l=this.results_data,i=0,r=l.length;i<r;i++)e=l[i],e.group?t+=this.result_add_group(e):e.empty||(t+=this.result_add_option(e),e.selected&&this.is_multiple?this.choice_build(e):e.selected&&!this.is_multiple&&(this.selected_item.removeClass("chzn-default").find("span").text(e.text),this.allow_single_deselect&&this.single_deselect_control_build()));return this.search_field_disabled(),this.show_search_field_default(),this.search_field_scale(),this.search_results.html(t),this.parsing=!1},r.prototype.result_add_group=function(e){return e.disabled?"":(e.dom_id=this.container_id+"_g_"+e.array_index,'<li id="'+e.dom_id+'" class="group-result">'+t("<div />").text(e.label).html()+"</li>")},r.prototype.result_do_highlight=function(t){var e,s,i,r,l;if(t.length){if(this.result_clear_highlight(),this.result_highlight=t,this.result_highlight.addClass("highlighted"),i=parseInt(this.search_results.css("maxHeight"),10),l=this.search_results.scrollTop(),r=i+l,s=this.result_highlight.position().top+this.search_results.scrollTop(),e=s+this.result_highlight.outerHeight(),e>=r)return this.search_results.scrollTop(e-i>0?e-i:0);if(s<l)return this.search_results.scrollTop(s)}},r.prototype.result_clear_highlight=function(){return this.result_highlight&&this.result_highlight.removeClass("highlighted"),this.result_highlight=null},r.prototype.results_show=function(){if(null!=this.result_single_selected)this.result_do_highlight(this.result_single_selected);else if(this.is_multiple&&this.max_selected_options<=this.choices_count())return this.form_field_jq.trigger("liszt:maxselected",{chosen:this}),!1;return this.container.addClass("chzn-with-drop"),this.form_field_jq.trigger("liszt:showing_dropdown",{chosen:this}),this.results_showing=!0,this.search_field.focus(),this.search_field.val(this.search_field.val()),this.winnow_results()},r.prototype.results_hide=function(){return this.result_clear_highlight(),this.container.removeClass("chzn-with-drop"),this.form_field_jq.trigger("liszt:hiding_dropdown",{chosen:this}),this.results_showing=!1},r.prototype.set_tab_index=function(t){var e;if(this.form_field_jq.attr("tabindex"))return e=this.form_field_jq.attr("tabindex"),this.form_field_jq.attr("tabindex",-1),this.search_field.attr("tabindex",e)},r.prototype.set_label_behavior=function(){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=t("label[for='"+this.form_field.id+"']")),this.form_field_label.length>0)return this.form_field_label.click(function(t){return function(e){return t.is_multiple?t.container_mousedown(e):t.activate_field()}}(this))},r.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"))},r.prototype.search_results_mouseup=function(e){var s;if(s=t(e.target).hasClass("active-result")?t(e.target):t(e.target).parents(".active-result").first(),s.length)return this.result_highlight=s,this.result_select(e),this.search_field.focus()},r.prototype.search_results_mouseover=function(e){var s;if(s=t(e.target).hasClass("active-result")?t(e.target):t(e.target).parents(".active-result").first())return this.result_do_highlight(s)},r.prototype.search_results_mouseout=function(e){if(t(e.target).hasClass("active-result"))return this.result_clear_highlight()},r.prototype.choice_build=function(e){var s,i;return s=t("<li />",{class:"search-choice"}).html("<span>"+e.html+"</span>"),e.disabled?s.addClass("search-choice-disabled"):(i=t("<a />",{href:"#",class:"search-choice-close",rel:e.array_index}),i.click(function(t){return function(e){return t.choice_destroy_link_click(e)}}(this)),s.append(i)),this.search_container.before(s)},r.prototype.choice_destroy_link_click=function(e){if(e.preventDefault(),e.stopPropagation(),!this.is_disabled)return this.choice_destroy(t(e.target))},r.prototype.choice_destroy=function(t){if(this.result_deselect(t.attr("rel")))return this.show_search_field_default(),this.is_multiple&&this.choices_count()>0&&this.search_field.val().length<1&&this.results_hide(),t.parents("li").first().remove(),this.search_field_scale()},r.prototype.results_reset=function(){if(this.form_field.options[0].selected=!0,this.selected_option_count=null,this.selected_item.find("span").text(this.default_text),this.is_multiple||this.selected_item.addClass("chzn-default"),this.show_search_field_default(),this.results_reset_cleanup(),this.form_field_jq.trigger("change"),this.active_field)return this.results_hide()},r.prototype.results_reset_cleanup=function(){return this.current_selectedIndex=this.form_field.selectedIndex,this.selected_item.find("abbr").remove()},r.prototype.result_select=function(t){var e,s,i,r;if(this.result_highlight)return e=this.result_highlight,s=e.attr("id"),this.result_clear_highlight(),this.is_multiple&&this.max_selected_options<=this.choices_count()?(this.form_field_jq.trigger("liszt:maxselected",{chosen:this}),!1):(this.is_multiple?this.result_deactivate(e):(this.search_results.find(".result-selected").removeClass("result-selected"),this.result_single_selected=e,this.selected_item.removeClass("chzn-default")),e.addClass("result-selected"),r=s.substr(s.lastIndexOf("_")+1),i=this.results_data[r],i.selected=!0,this.form_field.options[i.options_index].selected=!0,this.selected_option_count=null,this.is_multiple?this.choice_build(i):(this.selected_item.find("span").first().text(i.text),this.allow_single_deselect&&this.single_deselect_control_build()),(t.metaKey||t.ctrlKey)&&this.is_multiple||this.results_hide(),this.search_field.val(""),(this.is_multiple||this.form_field.selectedIndex!==this.current_selectedIndex)&&this.form_field_jq.trigger("change",{selected:this.form_field.options[i.options_index].value}),this.current_selectedIndex=this.form_field.selectedIndex,this.search_field_scale())},r.prototype.result_activate=function(t){return t.addClass("active-result")},r.prototype.result_deactivate=function(t){return t.removeClass("active-result")},r.prototype.result_deselect=function(e){var s,i;return i=this.results_data[e],!this.form_field.options[i.options_index].disabled&&(i.selected=!1,this.form_field.options[i.options_index].selected=!1,this.selected_option_count=null,s=t("#"+this.container_id+"_o_"+e),s.removeClass("result-selected").addClass("active-result").show(),this.result_clear_highlight(),this.winnow_results(),this.form_field_jq.trigger("change",{deselected:this.form_field.options[i.options_index].value}),this.search_field_scale(),!0)},r.prototype.single_deselect_control_build=function(){if(this.allow_single_deselect&&this.selected_item.find("abbr").length<1)return this.selected_item.find("span").first().after('<abbr class="search-choice-close"></abbr>')},r.prototype.winnow_results=function(){var e,s,i,r,l,n,h,o,c,a,_,u,d,f,p,g,m,v;for(this.no_results_clear(),f=0,p=this.search_field.val()===this.default_text?"":t("<div/>").text(t.trim(this.search_field.val())).html(),_=this.search_contains?"":"^",a=new RegExp(_+p.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"i"),v=new RegExp(p.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"i"),c=this.results_data,s=0,r=c.length;s<r;s++)if(n=c[s],!n.disabled&&!n.empty)if(n.group)t("#"+n.dom_id).css("display","none");else if(!this.is_multiple||!n.selected){if(e=!1,d=n.dom_id,u=t("#"+d),a.test(n.html))e=!0,f+=1;else if(this.enable_split_word_search&&(n.html.indexOf(" ")>=0||0===n.html.indexOf("["))&&(o=n.html.replace(/\[|\]/g,"").split(" "),o.length))for(i=0,l=o.length;i<l;i++)h=o[i],a.test(h)&&(e=!0,f+=1);e?(p.length?(g=n.html.search(v),m=n.html.substr(0,g+p.length)+"</em>"+n.html.substr(g+p.length),m=m.substr(0,g)+"<em>"+m.substr(g)):m=n.html,u.html(m),this.result_activate(u),null!=n.group_array_index&&t("#"+this.results_data[n.group_array_index].dom_id).css("display","list-item")):(this.result_highlight&&d===this.result_highlight.attr("id")&&this.result_clear_highlight(),this.result_deactivate(u))}return f<1&&p.length?this.no_results(p):this.winnow_results_set_highlight()},r.prototype.winnow_results_clear=function(){var e,s,i,r,l;for(this.search_field.val(""),r=this.search_results.find("li"),l=[],e=0,s=r.length;e<s;e++)i=r[e],i=t(i),i.hasClass("group-result")?l.push(i.css("display","auto")):this.is_multiple&&i.hasClass("result-selected")?l.push(void 0):l.push(this.result_activate(i));return l},r.prototype.winnow_results_set_highlight=function(){var t,e;if(!this.result_highlight&&(e=this.is_multiple?[]:this.search_results.find(".result-selected.active-result"),t=e.length?e.first():this.search_results.find(".active-result").first(),null!=t))return this.result_do_highlight(t)},r.prototype.no_results=function(e){var s;return s=t('<li class="no-results">'+this.results_none_found+' "<span></span>"</li>'),s.find("span").first().html(e),this.search_results.append(s)},r.prototype.no_results_clear=function(){return this.search_results.find(".no-results").remove()},r.prototype.keydown_arrow=function(){var e,s;if(this.result_highlight?this.results_showing&&(s=this.result_highlight.nextAll("li.active-result").first(),s&&this.result_do_highlight(s)):(e=this.search_results.find("li.active-result").first(),e&&this.result_do_highlight(t(e))),!this.results_showing)return this.results_show()},r.prototype.keyup_arrow=function(){var t;return this.results_showing||this.is_multiple?this.result_highlight?(t=this.result_highlight.prevAll("li.active-result"),t.length?this.result_do_highlight(t.first()):(this.choices_count()>0&&this.results_hide(),this.result_clear_highlight())):void 0:this.results_show()},r.prototype.keydown_backstroke=function(){var t;return this.pending_backstroke?(this.choice_destroy(this.pending_backstroke.find("a").first()),this.clear_backstroke()):(t=this.search_container.siblings("li.search-choice").last(),t.length&&!t.hasClass("search-choice-disabled")?(this.pending_backstroke=t,this.single_backstroke_delete?this.keydown_backstroke():this.pending_backstroke.addClass("search-choice-focus")):void 0)},r.prototype.clear_backstroke=function(){return this.pending_backstroke&&this.pending_backstroke.removeClass("search-choice-focus"),this.pending_backstroke=null},r.prototype.keydown_checker=function(t){var e,s;switch(s=null!=(e=t.which)?e:t.keyCode,this.search_field_scale(),8!==s&&this.pending_backstroke&&this.clear_backstroke(),s){case 8:this.backstroke_length=this.search_field.val().length;break;case 9:this.results_showing&&!this.is_multiple&&this.result_select(t),this.mouse_on_container=!1;break;case 13:t.preventDefault();break;case 38:t.preventDefault(),this.keyup_arrow();break;case 40:this.keydown_arrow()}},r.prototype.search_field_scale=function(){var e,s,i,r,l,n,h,o;if(this.is_multiple){for(s=0,o=0,n="position:absolute; left: -1000px; top: -1000px; display:none;",h=["font-size","font-style","font-weight","font-family","line-height","text-transform","letter-spacing"],i=0,r=h.length;i<r;i++)l=h[i],n+=l+":"+this.search_field.css(l)+";";return e=t("<div />",{style:n}),e.text(this.search_field.val()),t("body").append(e),o=e.width()+25,e.remove(),this.f_width||(this.f_width=this.container.outerWidth()),o>this.f_width-10&&(o=this.f_width-10),this.search_field.css({width:o+"px"})}},r.prototype.generate_random_id=function(){var e;for(e="sel"+this.generate_random_char()+this.generate_random_char()+this.generate_random_char();t("#"+e).length>0;)e+=this.generate_random_char();return e},r}(AbstractChosen),s.Chosen=e}.call(this);;