--- a/src/pyams_skin/resources/js/ext/jquery-select2-3.5.4.min.js Thu Sep 06 17:35:14 2018 +0200
+++ b/src/pyams_skin/resources/js/ext/jquery-select2-3.5.4.min.js Sun Sep 09 11:16:35 2018 +0200
@@ -1,1 +1,1 @@
-!function(e){void 0===e.fn.each2&&e.extend(e.fn,{each2:function(t){for(var s=e([0]),i=-1,n=this.length;++i<n&&(s.context=s[0]=this[i])&&!1!==t.call(s[0],i,s););return this}})}(jQuery),function(e,t){"use strict";function s(t){var s=e(document.createTextNode(""));t.before(s),s.before(t),s.remove()}function i(e){return e.replace(/[^\u0000-\u007E]/g,function(e){return j[e]||e})}function n(e,t){for(var s=0,i=t.length;s<i;s+=1)if(a(e,t[s]))return s;return-1}function o(){var t=e(U);t.appendTo(document.body);var s={width:t.width()-t[0].clientWidth,height:t.height()-t[0].clientHeight};return t.remove(),s}function a(e,s){return e===s||e!==t&&s!==t&&(null!==e&&null!==s&&(e.constructor===String?e+""==s+"":s.constructor===String&&s+""==e+""))}function l(e,t,s){var i,n,o;if(null===e||e.length<1)return[];for(n=0,o=(i=e.split(t)).length;n<o;n+=1)i[n]=s(i[n]);return i}function r(e){return e.outerWidth(!1)-e.width()}function c(s){var i="keyup-change-value";s.on("keydown",function(){e.data(s,i)===t&&e.data(s,i,s.val())}),s.on("keyup",function(){var n=e.data(s,i);n!==t&&s.val()!==n&&(e.removeData(s,i),s.trigger("keyup-change"))})}function h(s){s.on("mousemove",function(s){var i=N;i!==t&&i.x===s.pageX&&i.y===s.pageY||e(s.target).trigger("mousemove-filtered",s)})}function u(e,s,i){i=i||t;var n;return function(){var t=arguments;window.clearTimeout(n),n=window.setTimeout(function(){s.apply(i,t)},e)}}function d(e,t){var s=u(e,function(e){t.trigger("scroll-debounced",e)});t.on("scroll",function(e){n(e.target,t.get())>=0&&s(e)})}function p(e){e[0]!==document.activeElement&&window.setTimeout(function(){var t,s=e[0],i=e.val().length;e.focus(),(s.offsetWidth>0||s.offsetHeight>0)&&s===document.activeElement&&(s.setSelectionRange?s.setSelectionRange(i,i):s.createTextRange&&((t=s.createTextRange()).collapse(!1),t.select()))},0)}function f(t){var s=0,i=0;if("selectionStart"in(t=e(t)[0]))s=t.selectionStart,i=t.selectionEnd-s;else if("selection"in document){t.focus();var n=document.selection.createRange();i=document.selection.createRange().text.length,n.moveStart("character",-t.value.length),s=n.text.length-i}return{offset:s,length:i}}function g(e){e.preventDefault(),e.stopPropagation()}function m(e){e.preventDefault(),e.stopImmediatePropagation()}function v(t){if(!L){var s=t[0].currentStyle||window.getComputedStyle(t[0],null);(L=e(document.createElement("div")).css({position:"absolute",left:"-10000px",top:"-10000px",display:"none",fontSize:s.fontSize,fontFamily:s.fontFamily,fontStyle:s.fontStyle,fontWeight:s.fontWeight,letterSpacing:s.letterSpacing,textTransform:s.textTransform,whiteSpace:"nowrap"})).attr("class","select2-sizer"),e(document.body).append(L)}return L.text(t.val()),L.width()}function b(t,s,i){var n,o,a=[];(n=e.trim(t.attr("class")))&&e((n=""+n).split(/\s+/)).each2(function(){0===this.indexOf("select2-")&&a.push(this)}),(n=e.trim(s.attr("class")))&&e((n=""+n).split(/\s+/)).each2(function(){0!==this.indexOf("select2-")&&(o=i(this))&&a.push(o)}),t.attr("class",a.join(" "))}function w(e,t,s,n){var o=i(e.toUpperCase()).indexOf(i(t.toUpperCase())),a=t.length;o<0?s.push(n(e)):(s.push(n(e.substring(0,o))),s.push("<span class='select2-match'>"),s.push(n(e.substring(o,o+a))),s.push("</span>"),s.push(n(e.substring(o+a,e.length))))}function S(e){var t={"\\":"\","&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};return String(e).replace(/[&<>"'\/\\]/g,function(e){return t[e]})}function C(s){var i,n=null,o=s.quietMillis||100,a=s.url,l=this;return function(r){window.clearTimeout(i),i=window.setTimeout(function(){var i=s.data,o=a,c=s.transport||e.fn.select2.ajaxDefaults.transport,h={type:s.type||"GET",cache:s.cache||!1,jsonpCallback:s.jsonpCallback||t,dataType:s.dataType||"json"},u=e.extend({},e.fn.select2.ajaxDefaults.params,h);i=i?i.call(l,r.term,r.page,r.context):null,o="function"==typeof o?o.call(l,r.term,r.page,r.context):o,n&&"function"==typeof n.abort&&n.abort(),s.params&&(e.isFunction(s.params)?e.extend(u,s.params.call(l)):e.extend(u,s.params)),e.extend(u,{url:o,dataType:s.dataType,data:i,success:function(e){var t=s.results(e,r.page,r);r.callback(t)},error:function(e,t,s){var i={hasError:!0,jqXHR:e,textStatus:t,errorThrown:s};r.callback(i)}}),n=c.call(l,u)},o)}}function y(t){var s,i,n=t,o=function(e){return""+e.text};e.isArray(n)&&(n={results:i=n}),!1===e.isFunction(n)&&(i=n,n=function(){return i});var a=n();return a.text&&(o=a.text,e.isFunction(o)||(s=a.text,o=function(e){return e[s]})),function(t){var s,i=t.term,a={results:[]};""!==i?(s=function(n,a){var l,r;if((n=n[0]).children){l={};for(r in n)n.hasOwnProperty(r)&&(l[r]=n[r]);l.children=[],e(n.children).each2(function(e,t){s(t,l.children)}),(l.children.length||t.matcher(i,o(l),n))&&a.push(l)}else t.matcher(i,o(n),n)&&a.push(n)},e(n().results).each2(function(e,t){s(t,a.results)}),t.callback(a)):t.callback(n())}}function x(s){var i=e.isFunction(s);return function(n){var o=n.term,a={results:[]},l=i?s(n):s;e.isArray(l)&&(e(l).each(function(){var e=this.text!==t,s=e?this.text:this;(""===o||n.matcher(o,s))&&a.results.push(e?this:{id:this,text:this})}),n.callback(a))}}function E(t,s){if(e.isFunction(t))return!0;if(!t)return!1;if("string"==typeof t)return!0;throw new Error(s+" must be a string, function, or falsy value")}function T(t,s){if(e.isFunction(t)){var i=Array.prototype.slice.call(arguments,2);return t.apply(s,i)}return t}function O(t){var s=0;return e.each(t,function(e,t){t.children?s+=O(t.children):s++}),s}function I(){var t=this;e.each(arguments,function(e,s){t[s].remove(),t[s]=null})}function P(t,s){var i=function(){};return i.prototype=new t,i.prototype.constructor=i,i.prototype.parent=t.prototype,i.prototype=e.extend(i.prototype,s),i}if(window.Select2===t){var k,R,A,D,L,M,H,N={x:0,y:0},F={TAB:9,ENTER:13,ESC:27,SPACE:32,LEFT:37,UP:38,RIGHT:39,DOWN:40,SHIFT:16,CTRL:17,ALT:18,PAGE_UP:33,PAGE_DOWN:34,HOME:36,END:35,BACKSPACE:8,DELETE:46,isArrow:function(e){switch(e=e.which?e.which:e){case F.LEFT:case F.RIGHT:case F.UP:case F.DOWN:return!0}return!1},isControl:function(e){switch(e.which){case F.SHIFT:case F.CTRL:case F.ALT:return!0}return!!e.metaKey},isFunctionKey:function(e){return(e=e.which?e.which:e)>=112&&e<=123}},U="<div class='select2-measure-scrollbar'></div>",j={"Ⓐ":"A","A":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","B":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ɓ":"B","Ⓒ":"C","C":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","Ç":"C","Ḉ":"C","Ƈ":"C","Ȼ":"C","Ꜿ":"C","Ⓓ":"D","D":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ƌ":"D","Ɗ":"D","Ɖ":"D","Ꝺ":"D","DZ":"DZ","DŽ":"DZ","Dz":"Dz","Dž":"Dz","Ⓔ":"E","E":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","Ⓕ":"F","F":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","G":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","Ⓗ":"H","H":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","I":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","J":"J","Ĵ":"J","Ɉ":"J","Ⓚ":"K","K":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","L":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","LJ":"LJ","Lj":"Lj","Ⓜ":"M","M":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","Ⓝ":"N","N":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ƞ":"N","Ɲ":"N","Ꞑ":"N","Ꞥ":"N","NJ":"NJ","Nj":"Nj","Ⓞ":"O","O":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","P":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Q":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","R":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R","Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꝛ":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","S":"S","ẞ":"S","Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S","Ꞅ":"S","Ⓣ":"T","T":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T","Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"TZ","Ⓤ":"U","U":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ǜ":"U","Ǘ":"U","Ǖ":"U","Ǚ":"U","Ủ":"U","Ů":"U","Ű":"U","Ǔ":"U","Ȕ":"U","Ȗ":"U","Ư":"U","Ừ":"U","Ứ":"U","Ữ":"U","Ử":"U","Ự":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","Ṵ":"U","Ʉ":"U","Ⓥ":"V","V":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","W":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","X":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Y":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Z":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","a":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","b":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","c":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","ⓓ":"d","d":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","ꝺ":"d","dz":"dz","dž":"dz","ⓔ":"e","e":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ɛ":"e","ǝ":"e","ⓕ":"f","f":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","g":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ᵹ":"g","ꝿ":"g","ⓗ":"h","h":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","i":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","j":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","k":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","l":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","lj":"lj","ⓜ":"m","m":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","n":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ʼn":"n","ꞑ":"n","ꞥ":"n","nj":"nj","ⓞ":"o","o":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ɔ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","p":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","q":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","r":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","s":"s","ß":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ⓣ":"t","t":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","u":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","v":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","w":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","x":"x","ẋ":"x","ẍ":"x","ⓨ":"y","y":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","z":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ω":"ω","ς":"σ"};M=e(document),D=function(){var e=1;return function(){return e++}}(),R=P(k=P(Object,{bind:function(e){var t=this;return function(){e.apply(t,arguments)}},init:function(s){var i,n;this.opts=s=this.prepareOpts(s),this.id=s.id,s.element.data("select2")!==t&&null!==s.element.data("select2")&&s.element.data("select2").destroy(),this.container=this.createContainer(),this.liveRegion=e(".select2-hidden-accessible"),0==this.liveRegion.length&&(this.liveRegion=e("<span>",{role:"status","aria-live":"polite"}).addClass("select2-hidden-accessible").appendTo(document.body)),this.containerId="s2id_"+(s.element.attr("id")||"autogen"+D()),this.containerEventName=this.containerId.replace(/([.])/g,"_").replace(/([;&,\-\.\+\*\~':"\!\^#$%@\[\]\(\)=>\|])/g,"\\$1"),this.container.attr("id",this.containerId),this.container.attr("title",s.element.attr("title")),this.body=e(document.body),b(this.container,this.opts.element,this.opts.adaptContainerCssClass),this.container.attr("style",s.element.attr("style")),this.container.css(T(s.containerCss,this.opts.element)),this.container.addClass(T(s.containerCssClass,this.opts.element)),this.elementTabIndex=this.opts.element.attr("tabindex"),this.opts.element.data("select2",this).attr("tabindex","-1").before(this.container).on("click.select2",g),this.container.data("select2",this),this.dropdown=this.container.find(".select2-drop"),b(this.dropdown,this.opts.element,this.opts.adaptDropdownCssClass),this.dropdown.addClass(T(s.dropdownCssClass,this.opts.element)),this.dropdown.data("select2",this),this.dropdown.on("click",g),this.results=i=this.container.find(".select2-results"),this.search=n=this.container.find("input.select2-input"),this.queryCount=0,this.resultsPage=0,this.context=null,this.initContainer(),this.container.on("click",g),h(this.results),this.dropdown.on("mousemove-filtered",".select2-results",this.bind(this.highlightUnderEvent)),this.dropdown.on("touchstart touchmove touchend",".select2-results",this.bind(function(e){this._touchEvent=!0,this.highlightUnderEvent(e)})),this.dropdown.on("touchmove",".select2-results",this.bind(this.touchMoved)),this.dropdown.on("touchstart touchend",".select2-results",this.bind(this.clearTouchMoved)),this.dropdown.on("click",this.bind(function(e){this._touchEvent&&(this._touchEvent=!1,this.selectHighlighted())})),d(80,this.results),this.dropdown.on("scroll-debounced",".select2-results",this.bind(this.loadMoreIfNeeded)),e(this.container).on("change",".select2-input",function(e){e.stopPropagation()}),e(this.dropdown).on("change",".select2-input",function(e){e.stopPropagation()}),e.fn.mousewheel&&i.mousewheel(function(e,t,s,n){var o=i.scrollTop();n>0&&o-n<=0?(i.scrollTop(0),g(e)):n<0&&i.get(0).scrollHeight-i.scrollTop()+n<=i.height()&&(i.scrollTop(i.get(0).scrollHeight-i.height()),g(e))}),c(n),n.on("keyup-change input paste",this.bind(this.updateResults)),n.on("focus",function(){n.addClass("select2-focused")}),n.on("blur",function(){n.removeClass("select2-focused")}),this.dropdown.on("mouseup",".select2-results",this.bind(function(t){e(t.target).closest(".select2-result-selectable").length>0&&(this.highlightUnderEvent(t),this.selectHighlighted(t))})),this.dropdown.on("click mouseup mousedown touchstart touchend focusin",function(e){e.stopPropagation()}),this.lastSearchTerm=t,e.isFunction(this.opts.initSelection)&&(this.initSelection(),this.monitorSource()),null!==s.maximumInputLength&&this.search.attr("maxlength",s.maximumInputLength);var a=s.element.prop("disabled");a===t&&(a=!1),this.enable(!a);var l=s.element.prop("readonly");l===t&&(l=!1),this.readonly(l),H=H||o(),this.autofocus=s.element.prop("autofocus"),s.element.prop("autofocus",!1),this.autofocus&&this.focus(),this.search.attr("placeholder",s.searchInputPlaceholder)},destroy:function(){var e=this.opts.element,s=e.data("select2"),i=this;this.close(),e.length&&e[0].detachEvent&&i._sync&&e.each(function(){i._sync&&this.detachEvent("onpropertychange",i._sync)}),this.propertyObserver&&(this.propertyObserver.disconnect(),this.propertyObserver=null),this._sync=null,s!==t&&(s.container.remove(),s.liveRegion.remove(),s.dropdown.remove(),e.removeData("select2").off(".select2"),e.is("input[type='hidden']")?e.css("display",""):(e.show().prop("autofocus",this.autofocus||!1),this.elementTabIndex?e.attr({tabindex:this.elementTabIndex}):e.removeAttr("tabindex"),e.show())),I.call(this,"container","liveRegion","dropdown","results","search")},optionToData:function(e){return e.is("option")?{id:e.prop("value"),text:e.text(),element:e.get(),css:e.attr("class"),disabled:e.prop("disabled"),locked:a(e.attr("locked"),"locked")||a(e.data("locked"),!0)}:e.is("optgroup")?{text:e.attr("label"),children:[],element:e.get(),css:e.attr("class")}:void 0},prepareOpts:function(s){var i,n,o,r,c=this;if("select"===(i=s.element).get(0).tagName.toLowerCase()&&(this.select=n=s.element),n&&e.each(["id","multiple","ajax","query","createSearchChoice","initSelection","data","tags"],function(){if(this in s)throw new Error("Option '"+this+"' is not allowed for Select2 when attached to a <select> element.")}),s.debug=s.debug||e.fn.select2.defaults.debug,s.debug&&console&&console.warn&&(null!=s.id&&console.warn("Select2: The `id` option has been removed in Select2 4.0.0, consider renaming your `id` property or mapping the property before your data makes it to Select2. You can read more at https://select2.github.io/announcements-4.0.html#changed-id"),null!=s.text&&console.warn("Select2: The `text` option has been removed in Select2 4.0.0, consider renaming your `text` property or mapping the property before your data makes it to Select2. You can read more at https://select2.github.io/announcements-4.0.html#changed-id"),null!=s.sortResults&&console.warn("Select2: the `sortResults` option has been renamed to `sorter` in Select2 4.0.0. "),null!=s.selectOnBlur&&console.warn("Select2: The `selectOnBlur` option has been renamed to `selectOnClose` in Select2 4.0.0."),null!=s.ajax&&null!=s.ajax.results&&console.warn("Select2: The `ajax.results` option has been renamed to `ajax.processResults` in Select2 4.0.0."),null!=s.formatNoResults&&console.warn("Select2: The `formatNoResults` option has been renamed to `language.noResults` in Select2 4.0.0."),null!=s.formatSearching&&console.warn("Select2: The `formatSearching` option has been renamed to `language.searching` in Select2 4.0.0."),null!=s.formatInputTooShort&&console.warn("Select2: The `formatInputTooShort` option has been renamed to `language.inputTooShort` in Select2 4.0.0."),null!=s.formatInputTooLong&&console.warn("Select2: The `formatInputTooLong` option has been renamed to `language.inputTooLong` in Select2 4.0.0."),null!=s.formatLoading&&console.warn("Select2: The `formatLoading` option has been renamed to `language.loadingMore` in Select2 4.0.0."),null!=s.formatSelectionTooBig&&console.warn("Select2: The `formatSelectionTooBig` option has been renamed to `language.maximumSelected` in Select2 4.0.0."),s.element.data("select2Tags")&&console.warn("Select2: The `data-select2-tags` attribute has been renamed to `data-tags` in Select2 4.0.0.")),null!=s.element.data("tags")){var h=s.element.data("tags");e.isArray(h)||(h=[]),s.element.data("select2Tags",h)}if(null!=s.sorter&&(s.sortResults=s.sorter),null!=s.selectOnClose&&(s.selectOnBlur=s.selectOnClose),null!=s.ajax&&e.isFunction(s.ajax.processResults)&&(s.ajax.results=s.ajax.processResults),null!=s.language){var u=s.language;e.isFunction(u.noMatches)&&(s.formatNoMatches=u.noMatches),e.isFunction(u.searching)&&(s.formatSearching=u.searching),e.isFunction(u.inputTooShort)&&(s.formatInputTooShort=u.inputTooShort),e.isFunction(u.inputTooLong)&&(s.formatInputTooLong=u.inputTooLong),e.isFunction(u.loadingMore)&&(s.formatLoading=u.loadingMore),e.isFunction(u.maximumSelected)&&(s.formatSelectionTooBig=u.maximumSelected)}if("function"!=typeof(s=e.extend({},{populateResults:function(i,n,o){var a,l=this.opts.id,r=this.liveRegion;(a=function(i,n,h){var u,d,p,f,g,m,v,b,w,S,C=[];for(u=0,d=(i=s.sortResults(i,n,o)).length;u<d;u+=1)f=!(g=!0===(p=i[u]).disabled)&&l(p)!==t,m=p.children&&p.children.length>0,(v=e("<li></li>")).addClass("select2-results-dept-"+h),v.addClass("select2-result"),v.addClass(f?"select2-result-selectable":"select2-result-unselectable"),g&&v.addClass("select2-disabled"),m&&v.addClass("select2-result-with-children"),v.addClass(c.opts.formatResultCssClass(p)),v.attr("role","presentation"),(b=e(document.createElement("div"))).addClass("select2-result-label"),b.attr("id","select2-result-label-"+D()),b.attr("role","option"),(S=s.formatResult(p,b,o,c.opts.escapeMarkup))!==t&&(b.html(S),v.append(b)),m&&((w=e("<ul></ul>")).addClass("select2-result-sub"),a(p.children,w,h+1),v.append(w)),v.data("select2-data",p),C.push(v[0]);n.append(C),r.text(s.formatMatches(i.length))})(n,i,0)}},e.fn.select2.defaults,s)).id&&(o=s.id,s.id=function(e){return e[o]}),e.isArray(s.element.data("select2Tags"))){if("tags"in s)throw"tags specified as both an attribute 'data-select2-tags' and in options of Select2 "+s.element.attr("id");s.tags=s.element.data("select2Tags")}if(n?(s.query=this.bind(function(e){var s,n,o,a={results:[],more:!1},l=e.term;o=function(t,s){var i;t.is("option")?e.matcher(l,t.text(),t)&&s.push(c.optionToData(t)):t.is("optgroup")&&(i=c.optionToData(t),t.children().each2(function(e,t){o(t,i.children)}),i.children.length>0&&s.push(i))},s=i.children(),this.getPlaceholder()!==t&&s.length>0&&(n=this.getPlaceholderOption())&&(s=s.not(n)),s.each2(function(e,t){o(t,a.results)}),e.callback(a)}),s.id=function(e){return e.id}):"query"in s||("ajax"in s?((r=s.element.data("ajax-url"))&&r.length>0&&(s.ajax.url=r),s.query=C.call(s.element,s.ajax)):"data"in s?s.query=y(s.data):"tags"in s&&(s.query=x(s.tags),s.createSearchChoice===t&&(s.createSearchChoice=function(t){return{id:e.trim(t),text:e.trim(t)}}),s.initSelection===t&&(s.initSelection=function(t,i){var n=[];e(l(t.val(),s.separator,s.transformVal)).each(function(){var t={id:this,text:this},i=s.tags;e.isFunction(i)&&(i=i()),e(i).each(function(){if(a(this.id,t.id))return t=this,!1}),n.push(t)}),i(n)}))),"function"!=typeof s.query)throw"query function not defined for Select2 "+s.element.attr("id");if("top"===s.createSearchChoicePosition)s.createSearchChoicePosition=function(e,t){e.unshift(t)};else if("bottom"===s.createSearchChoicePosition)s.createSearchChoicePosition=function(e,t){e.push(t)};else if("function"!=typeof s.createSearchChoicePosition)throw"invalid createSearchChoicePosition option must be 'top', 'bottom' or a custom function";return s},monitorSource:function(){var s,i=this.opts.element,n=this;i.on("change.select2",this.bind(function(e){!0!==this.opts.element.data("select2-change-triggered")&&this.initSelection()})),this._sync=this.bind(function(){var e=i.prop("disabled");e===t&&(e=!1),this.enable(!e);var s=i.prop("readonly");s===t&&(s=!1),this.readonly(s),this.container&&(b(this.container,this.opts.element,this.opts.adaptContainerCssClass),this.container.addClass(T(this.opts.containerCssClass,this.opts.element))),this.dropdown&&(b(this.dropdown,this.opts.element,this.opts.adaptDropdownCssClass),this.dropdown.addClass(T(this.opts.dropdownCssClass,this.opts.element)))}),i.length&&i[0].attachEvent&&i.each(function(){this.attachEvent("onpropertychange",n._sync)}),(s=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver)!==t&&(this.propertyObserver&&(delete this.propertyObserver,this.propertyObserver=null),this.propertyObserver=new s(function(t){e.each(t,n._sync)}),this.propertyObserver.observe(i.get(0),{attributes:!0,subtree:!1}))},triggerSelect:function(t){var s=e.Event("select2-selecting",{val:this.id(t),object:t,choice:t});return this.opts.element.trigger(s),!s.isDefaultPrevented()},triggerChange:function(t){t=t||{},t=e.extend({},t,{type:"change",val:this.val()}),this.opts.element.data("select2-change-triggered",!0),this.opts.element.trigger(t),this.opts.element.data("select2-change-triggered",!1),this.opts.element.click(),this.opts.blurOnChange&&this.opts.element.blur()},isInterfaceEnabled:function(){return!0===this.enabledInterface},enableInterface:function(){var e=this._enabled&&!this._readonly,t=!e;return e!==this.enabledInterface&&(this.container.toggleClass("select2-container-disabled",t),this.close(),this.enabledInterface=e,!0)},enable:function(e){e===t&&(e=!0),this._enabled!==e&&(this._enabled=e,this.opts.element.prop("disabled",!e),this.enableInterface())},disable:function(){this.enable(!1)},readonly:function(e){e===t&&(e=!1),this._readonly!==e&&(this._readonly=e,this.opts.element.prop("readonly",e),this.enableInterface())},opened:function(){return!!this.container&&this.container.hasClass("select2-dropdown-open")},positionDropdown:function(){var t,s,i,n,o,a=this.dropdown,l=this.container,r=l.offset(),c=l.outerHeight(!1),h=l.outerWidth(!1),u=a.outerHeight(!1),d=e(window),p=d.width(),f=d.height(),g=d.scrollLeft()+p,m=d.scrollTop()+f,v=r.top+c,b=r.left,w=v+u<=m,S=r.top-u>=d.scrollTop(),C=a.outerWidth(!1);a.hasClass("select2-drop-above")?(s=!0,!S&&w&&(i=!0,s=!1)):(s=!1,!w&&S&&(i=!0,s=!0)),i&&(a.hide(),r=this.container.offset(),c=this.container.outerHeight(!1),h=this.container.outerWidth(!1),u=a.outerHeight(!1),g=d.scrollLeft()+p,m=d.scrollTop()+f,v=r.top+c,b=r.left,C=a.outerWidth(!1),a.show(),this.focusSearch()),this.opts.dropdownAutoWidth?(o=e(".select2-results",a)[0],a.addClass("select2-drop-auto-width"),a.css("width",""),(C=a.outerWidth(!1)+(o.scrollHeight===o.clientHeight?0:H.width))>h?h=C:C=h,u=a.outerHeight(!1)):this.container.removeClass("select2-drop-auto-width"),"static"!==this.body.css("position")&&(v-=(t=this.body.offset()).top,b-=t.left),!(b+C<=g)&&r.left+g+l.outerWidth(!1)>C&&(b=r.left+this.container.outerWidth(!1)-C),n={left:b,width:h},s?(this.container.addClass("select2-drop-above"),a.addClass("select2-drop-above"),u=a.outerHeight(!1),n.top=r.top-u,n.bottom="auto"):(n.top=v,n.bottom="auto",this.container.removeClass("select2-drop-above"),a.removeClass("select2-drop-above")),n=e.extend(n,T(this.opts.dropdownCss,this.opts.element)),a.css(n)},shouldOpen:function(){var t;return!this.opened()&&(!1!==this._enabled&&!0!==this._readonly&&(t=e.Event("select2-opening"),this.opts.element.trigger(t),!t.isDefaultPrevented()))},clearDropdownAlignmentPreference:function(){this.container.removeClass("select2-drop-above"),this.dropdown.removeClass("select2-drop-above")},open:function(){return!!this.shouldOpen()&&(this.opening(),M.on("mousemove.select2Event",function(e){N.x=e.pageX,N.y=e.pageY}),!0)},opening:function(){var t,i=this.containerEventName,n="scroll."+i,o="resize."+i,a="orientationchange."+i;this.container.addClass("select2-dropdown-open").addClass("select2-container-active"),this.clearDropdownAlignmentPreference(),this.dropdown[0]!==this.body.children().last()[0]&&this.dropdown.detach().appendTo(this.body),0===(t=e("#select2-drop-mask")).length&&((t=e(document.createElement("div"))).attr("id","select2-drop-mask").attr("class","select2-drop-mask"),t.hide(),t.appendTo(this.body),t.on("mousedown touchstart click",function(i){s(t);var n,o=e("#select2-drop");o.length>0&&((n=o.data("select2")).opts.selectOnBlur&&n.selectHighlighted({noFocus:!0}),n.close(),i.preventDefault(),i.stopPropagation())})),this.dropdown.prev()[0]!==t[0]&&this.dropdown.before(t),e("#select2-drop").removeAttr("id"),this.dropdown.attr("id","select2-drop"),t.show(),this.positionDropdown(),this.dropdown.show(),this.positionDropdown(),this.dropdown.addClass("select2-drop-active");var l=this;this.container.parents().add(window).each(function(){e(this).on(o+" "+n+" "+a,function(e){l.opened()&&l.positionDropdown()})})},close:function(){if(this.opened()){var t=this.containerEventName,s="scroll."+t,i="resize."+t,n="orientationchange."+t;this.container.parents().add(window).each(function(){e(this).off(s).off(i).off(n)}),this.clearDropdownAlignmentPreference(),e("#select2-drop-mask").hide(),this.dropdown.removeAttr("id"),this.dropdown.hide(),this.container.removeClass("select2-dropdown-open").removeClass("select2-container-active"),this.results.empty(),M.off("mousemove.select2Event"),this.clearSearch(),this.search.removeClass("select2-active"),this.search.removeAttr("aria-activedescendant"),this.opts.element.trigger(e.Event("select2-close"))}},externalSearch:function(e){this.open(),this.search.val(e),this.updateResults(!1)},clearSearch:function(){},prefillNextSearchTerm:function(){if(""!==this.search.val())return!1;var e=this.opts.nextSearchTerm(this.data(),this.lastSearchTerm);return e!==t&&(this.search.val(e),this.search.select(),!0)},getMaximumSelectionSize:function(){return T(this.opts.maximumSelectionSize,this.opts.element)},ensureHighlightVisible:function(){var t,s,i,n,o,a,l,r,c=this.results;(s=this.highlight())<0||0!=s&&(t=this.findHighlightableChoices().find(".select2-result-label"),n=(r=((i=e(t[s])).offset()||{}).top||0)+i.outerHeight(!0),s===t.length-1&&(l=c.find("li.select2-more-results")).length>0&&(n=l.offset().top+l.outerHeight(!0)),n>(o=c.offset().top+c.outerHeight(!1))&&c.scrollTop(c.scrollTop()+(n-o)),(a=r-c.offset().top)<0&&"none"!=i.css("display")&&c.scrollTop(c.scrollTop()+a))},findHighlightableChoices:function(){return this.results.find(".select2-result-selectable:not(.select2-disabled):not(.select2-selected)")},moveHighlight:function(t){for(var s=this.findHighlightableChoices(),i=this.highlight();i>-1&&i<s.length;){var n=e(s[i+=t]);if(n.hasClass("select2-result-selectable")&&!n.hasClass("select2-disabled")&&!n.hasClass("select2-selected")){this.highlight(i);break}}},highlight:function(t){var s,i,o=this.findHighlightableChoices();if(0===arguments.length)return n(o.filter(".select2-highlighted")[0],o.get());t>=o.length&&(t=o.length-1),t<0&&(t=0),this.removeHighlight(),(s=e(o[t])).addClass("select2-highlighted"),this.search.attr("aria-activedescendant",s.find(".select2-result-label").attr("id")),this.ensureHighlightVisible(),this.liveRegion.text(s.text()),(i=s.data("select2-data"))&&this.opts.element.trigger({type:"select2-highlight",val:this.id(i),choice:i})},removeHighlight:function(){this.results.find(".select2-highlighted").removeClass("select2-highlighted")},touchMoved:function(){this._touchMoved=!0},clearTouchMoved:function(){this._touchMoved=!1},countSelectableResults:function(){return this.findHighlightableChoices().length},highlightUnderEvent:function(t){var s=e(t.target).closest(".select2-result-selectable");if(s.length>0&&!s.is(".select2-highlighted")){var i=this.findHighlightableChoices();this.highlight(i.index(s))}else 0==s.length&&this.removeHighlight()},loadMoreIfNeeded:function(){var e=this.results,t=e.find("li.select2-more-results"),s=this.resultsPage+1,i=this,n=this.search.val(),o=this.context;0!==t.length&&t.offset().top-e.offset().top-e.height()<=this.opts.loadMorePadding&&(t.addClass("select2-active"),this.opts.query({element:this.opts.element,term:n,page:s,context:o,matcher:this.opts.matcher,callback:this.bind(function(a){i.opened()&&(i.opts.populateResults.call(this,e,a.results,{term:n,page:s,context:o}),i.postprocessResults(a,!1,!1),!0===a.more?(t.detach().appendTo(e).html(i.opts.escapeMarkup(T(i.opts.formatLoadMore,i.opts.element,s+1))),window.setTimeout(function(){i.loadMoreIfNeeded()},10)):t.remove(),i.positionDropdown(),i.resultsPage=s,i.context=a.context,this.opts.element.trigger({type:"select2-loaded",items:a}))})}))},tokenize:function(){},updateResults:function(s){function i(){c.removeClass("select2-active"),d.positionDropdown(),h.find(".select2-no-results,.select2-selection-limit,.select2-searching").length?d.liveRegion.text(h.text()):d.liveRegion.text(d.opts.formatMatches(h.find('.select2-result-selectable:not(".select2-selected")').length))}function n(e){h.html(e),i()}var o,l,r,c=this.search,h=this.results,u=this.opts,d=this,p=c.val(),f=e.data(this.container,"select2-last-term");if((!0===s||!f||!a(p,f))&&(e.data(this.container,"select2-last-term",p),!0===s||!1!==this.showSearchInput&&this.opened())){r=++this.queryCount;var g=this.getMaximumSelectionSize();if(!(g>=1&&(o=this.data(),e.isArray(o)&&o.length>=g&&E(u.formatSelectionTooBig,"formatSelectionTooBig"))))return c.val().length<u.minimumInputLength?(n(E(u.formatInputTooShort,"formatInputTooShort")?"<li class='select2-no-results'>"+T(u.formatInputTooShort,u.element,c.val(),u.minimumInputLength)+"</li>":""),void(s&&this.showSearch&&this.showSearch(!0))):void(u.maximumInputLength&&c.val().length>u.maximumInputLength?n(E(u.formatInputTooLong,"formatInputTooLong")?"<li class='select2-no-results'>"+T(u.formatInputTooLong,u.element,c.val(),u.maximumInputLength)+"</li>":""):(u.formatSearching&&0===this.findHighlightableChoices().length&&n("<li class='select2-searching'>"+T(u.formatSearching,u.element)+"</li>"),c.addClass("select2-active"),this.removeHighlight(),(l=this.tokenize())!=t&&null!=l&&c.val(l),this.resultsPage=1,u.query({element:u.element,term:c.val(),page:this.resultsPage,context:null,matcher:u.matcher,callback:this.bind(function(o){var l;if(r==this.queryCount)if(this.opened())if(o.hasError!==t&&E(u.formatAjaxError,"formatAjaxError"))n("<li class='select2-ajax-error'>"+T(u.formatAjaxError,u.element,o.jqXHR,o.textStatus,o.errorThrown)+"</li>");else{if(this.context=o.context===t?null:o.context,this.opts.createSearchChoice&&""!==c.val()&&(l=this.opts.createSearchChoice.call(d,c.val(),o.results))!==t&&null!==l&&d.id(l)!==t&&null!==d.id(l)&&0===e(o.results).filter(function(){return a(d.id(this),d.id(l))}).length&&this.opts.createSearchChoicePosition(o.results,l),0===o.results.length&&E(u.formatNoMatches,"formatNoMatches"))return n("<li class='select2-no-results'>"+T(u.formatNoMatches,u.element,c.val())+"</li>"),void(this.showSearch&&this.showSearch(c.val()));h.empty(),d.opts.populateResults.call(this,h,o.results,{term:c.val(),page:this.resultsPage,context:null}),!0===o.more&&E(u.formatLoadMore,"formatLoadMore")&&(h.append("<li class='select2-more-results'>"+u.escapeMarkup(T(u.formatLoadMore,u.element,this.resultsPage))+"</li>"),window.setTimeout(function(){d.loadMoreIfNeeded()},10)),this.postprocessResults(o,s),i(),this.opts.element.trigger({type:"select2-loaded",items:o})}else this.search.removeClass("select2-active")})})));n("<li class='select2-selection-limit'>"+T(u.formatSelectionTooBig,u.element,g)+"</li>")}},cancel:function(){this.close()},blur:function(){this.opts.selectOnBlur&&this.selectHighlighted({noFocus:!0}),this.close(),this.container.removeClass("select2-container-active"),this.search[0]===document.activeElement&&this.search.blur(),this.clearSearch(),this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus")},focusSearch:function(){p(this.search)},selectHighlighted:function(e){if(this._touchMoved)this.clearTouchMoved();else{var t=this.highlight(),s=this.results.find(".select2-highlighted").closest(".select2-result").data("select2-data");s?(this.highlight(t),this.onSelect(s,e)):e&&e.noFocus&&this.close()}},getPlaceholder:function(){var e;return this.opts.element.attr("placeholder")||this.opts.element.attr("data-placeholder")||this.opts.element.data("placeholder")||this.opts.placeholder||((e=this.getPlaceholderOption())!==t?e.text():t)},getPlaceholderOption:function(){if(this.select){var s=this.select.children("option").first();if(this.opts.placeholderOption!==t)return"first"===this.opts.placeholderOption&&s||"function"==typeof this.opts.placeholderOption&&this.opts.placeholderOption(this.select);if(""===e.trim(s.text())&&""===s.val())return s}},initContainerWidth:function(){var t=function(){var t,s,i,n,o,a;if("off"===this.opts.width)return null;if("element"===this.opts.width)return 0===this.opts.element.outerWidth(!1)?"auto":this.opts.element.outerWidth(!1)+"px";if("copy"===this.opts.width||"resolve"===this.opts.width){if("string"==typeof(t=this.opts.element.attr("style")))for(n=0,o=(s=t.split(";")).length;n<o;n+=1)if(a=s[n].replace(/\s/g,""),null!==(i=a.match(/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i))&&i.length>=1)return i[1];return"resolve"===this.opts.width?(t=this.opts.element.css("width")).indexOf("%")>0?t:0===this.opts.element.outerWidth(!1)?"auto":this.opts.element.outerWidth(!1)+"px":null}return e.isFunction(this.opts.width)?this.opts.width():this.opts.width}.call(this);null!==t&&this.container.css("width",t)}}),{createContainer:function(){return e(document.createElement("div")).attr({class:"select2-container"}).html(["<a href='javascript:void(0)' class='select2-choice' tabindex='-1'>"," <span class='select2-chosen'> </span><abbr class='select2-search-choice-close'></abbr>"," <span class='select2-arrow' role='presentation'><b role='presentation'></b></span>","</a>","<label for='' class='select2-offscreen'></label>","<input class='select2-focusser select2-offscreen' type='text' aria-haspopup='true' role='button' />","<div class='select2-drop select2-display-none'>"," <div class='select2-search'>"," <label for='' class='select2-offscreen'></label>"," <input type='text' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' class='select2-input' role='combobox' aria-expanded='true'"," aria-autocomplete='list' />"," </div>"," <ul class='select2-results' role='listbox'>"," </ul>","</div>"].join(""))},enableInterface:function(){this.parent.enableInterface.apply(this,arguments)&&this.focusser.prop("disabled",!this.isInterfaceEnabled())},opening:function(){var t,s,i;this.opts.minimumResultsForSearch>=0&&this.showSearch(!0),this.parent.opening.apply(this,arguments),!1!==this.showSearchInput&&this.search.val(this.focusser.val()),this.opts.shouldFocusInput(this)&&(this.search.focus(),(t=this.search.get(0)).createTextRange?((s=t.createTextRange()).collapse(!1),s.select()):t.setSelectionRange&&(i=this.search.val().length,t.setSelectionRange(i,i))),this.prefillNextSearchTerm(),this.focusser.prop("disabled",!0).val(""),this.updateResults(!0),this.opts.element.trigger(e.Event("select2-open"))},close:function(){this.opened()&&(this.parent.close.apply(this,arguments),this.focusser.prop("disabled",!1),this.opts.shouldFocusInput(this)&&this.focusser.focus())},focus:function(){this.opened()?this.close():(this.focusser.prop("disabled",!1),this.opts.shouldFocusInput(this)&&this.focusser.focus())},isFocused:function(){return this.container.hasClass("select2-container-active")},cancel:function(){this.parent.cancel.apply(this,arguments),this.focusser.prop("disabled",!1),this.opts.shouldFocusInput(this)&&this.focusser.focus()},destroy:function(){e("label[for='"+this.focusser.attr("id")+"']").attr("for",this.opts.element.attr("id")),this.parent.destroy.apply(this,arguments),I.call(this,"selection","focusser")},initContainer:function(){var t,i,n=this.container,o=this.dropdown,a=D();this.opts.minimumResultsForSearch<0?this.showSearch(!1):this.showSearch(!0),this.selection=t=n.find(".select2-choice"),this.focusser=n.find(".select2-focusser"),t.find(".select2-chosen").attr("id","select2-chosen-"+a),this.focusser.attr("aria-labelledby","select2-chosen-"+a),this.results.attr("id","select2-results-"+a),this.search.attr("aria-owns","select2-results-"+a),this.focusser.attr("id","s2id_autogen"+a),i=e("label[for='"+this.opts.element.attr("id")+"']"),this.opts.element.on("focus.select2",this.bind(function(){this.focus()})),this.focusser.prev().text(i.text()).attr("for",this.focusser.attr("id"));var l=this.opts.element.attr("title");this.opts.element.attr("title",l||i.text()),this.focusser.attr("tabindex",this.elementTabIndex),this.search.attr("id",this.focusser.attr("id")+"_search"),this.search.prev().text(e("label[for='"+this.focusser.attr("id")+"']").text()).attr("for",this.search.attr("id")),this.search.on("keydown",this.bind(function(e){if(this.isInterfaceEnabled()&&229!=e.keyCode)if(e.which!==F.PAGE_UP&&e.which!==F.PAGE_DOWN)switch(e.which){case F.UP:case F.DOWN:return this.moveHighlight(e.which===F.UP?-1:1),void g(e);case F.ENTER:return this.selectHighlighted(),void g(e);case F.TAB:return void this.selectHighlighted({noFocus:!0});case F.ESC:return this.cancel(e),void g(e)}else g(e)})),this.search.on("blur",this.bind(function(e){document.activeElement===this.body.get(0)&&window.setTimeout(this.bind(function(){this.opened()&&this.results&&this.results.length>1&&this.search.focus()}),0)})),this.focusser.on("keydown",this.bind(function(e){if(this.isInterfaceEnabled()&&e.which!==F.TAB&&!F.isControl(e)&&!F.isFunctionKey(e)&&e.which!==F.ESC){if(!1!==this.opts.openOnEnter||e.which!==F.ENTER){if(e.which==F.DOWN||e.which==F.UP||e.which==F.ENTER&&this.opts.openOnEnter){if(e.altKey||e.ctrlKey||e.shiftKey||e.metaKey)return;return this.open(),void g(e)}return e.which==F.DELETE||e.which==F.BACKSPACE?(this.opts.allowClear&&this.clear(),void g(e)):void 0}g(e)}})),c(this.focusser),this.focusser.on("keyup-change input",this.bind(function(e){if(this.opts.minimumResultsForSearch>=0){if(e.stopPropagation(),this.opened())return;this.open()}})),t.on("mousedown touchstart","abbr",this.bind(function(e){this.isInterfaceEnabled()&&(this.clear(),m(e),this.close(),this.selection&&this.selection.focus())})),t.on("mousedown touchstart",this.bind(function(i){s(t),this.container.hasClass("select2-container-active")||this.opts.element.trigger(e.Event("select2-focus")),this.opened()?this.close():this.isInterfaceEnabled()&&this.open(),g(i)})),o.on("mousedown touchstart",this.bind(function(){this.opts.shouldFocusInput(this)&&this.search.focus()})),t.on("focus",this.bind(function(e){g(e)})),this.focusser.on("focus",this.bind(function(){this.container.hasClass("select2-container-active")||this.opts.element.trigger(e.Event("select2-focus")),this.container.addClass("select2-container-active")})).on("blur",this.bind(function(){this.opened()||(this.container.removeClass("select2-container-active"),this.opts.element.trigger(e.Event("select2-blur")))})),this.search.on("focus",this.bind(function(){this.container.hasClass("select2-container-active")||this.opts.element.trigger(e.Event("select2-focus")),this.container.addClass("select2-container-active")})),this.initContainerWidth(),this.opts.element.hide(),this.setPlaceholder()},clear:function(t){var s=this.selection.data("select2-data");if(s){var i=e.Event("select2-clearing");if(this.opts.element.trigger(i),i.isDefaultPrevented())return;var n=this.getPlaceholderOption();this.opts.element.val(n?n.val():""),this.selection.find(".select2-chosen").empty(),this.selection.removeData("select2-data"),this.setPlaceholder(),!1!==t&&(this.opts.element.trigger({type:"select2-removed",val:this.id(s),choice:s}),this.triggerChange({removed:s}))}},initSelection:function(){if(this.isPlaceholderOptionSelected())this.updateSelection(null),this.close(),this.setPlaceholder();else{var e=this;this.opts.initSelection.call(null,this.opts.element,function(s){s!==t&&null!==s&&(e.updateSelection(s),e.close(),e.setPlaceholder(),e.lastSearchTerm=e.search.val())})}},isPlaceholderOptionSelected:function(){var e;return this.getPlaceholder()!==t&&((e=this.getPlaceholderOption())!==t&&e.prop("selected")||""===this.opts.element.val()||this.opts.element.val()===t||null===this.opts.element.val())},prepareOpts:function(){var t=this.parent.prepareOpts.apply(this,arguments),s=this;return"select"===t.element.get(0).tagName.toLowerCase()?t.initSelection=function(e,t){var i=e.find("option").filter(function(){return this.selected&&!this.disabled});t(s.optionToData(i))}:"data"in t&&(t.initSelection=t.initSelection||function(s,i){var n=s.val(),o=null;t.query({matcher:function(e,s,i){var l=a(n,t.id(i));return l&&(o=i),l},callback:e.isFunction(i)?function(){i(o)}:e.noop})}),t},getPlaceholder:function(){return this.select&&this.getPlaceholderOption()===t?t:this.parent.getPlaceholder.apply(this,arguments)},setPlaceholder:function(){var e=this.getPlaceholder();if(this.isPlaceholderOptionSelected()&&e!==t){if(this.select&&this.getPlaceholderOption()===t)return;this.selection.find(".select2-chosen").html(this.opts.escapeMarkup(e)),this.selection.addClass("select2-default"),this.container.removeClass("select2-allowclear")}},postprocessResults:function(e,t,s){var i=0,n=this;if(this.findHighlightableChoices().each2(function(e,t){if(a(n.id(t.data("select2-data")),n.opts.element.val()))return i=e,!1}),!1!==s&&(!0===t&&i>=0?this.highlight(i):this.highlight(0)),!0===t){var o=this.opts.minimumResultsForSearch;o>=0&&this.showSearch(O(e.results)>=o)}},showSearch:function(t){this.showSearchInput!==t&&(this.showSearchInput=t,this.dropdown.find(".select2-search").toggleClass("select2-search-hidden",!t),this.dropdown.find(".select2-search").toggleClass("select2-offscreen",!t),e(this.dropdown,this.container).toggleClass("select2-with-searchbox",t))},onSelect:function(e,t){if(this.triggerSelect(e)){var s=this.opts.element.val(),i=this.data();this.opts.element.val(this.id(e)),this.updateSelection(e),this.opts.element.trigger({type:"select2-selected",val:this.id(e),choice:e}),this.lastSearchTerm=this.search.val(),this.close(),t&&t.noFocus||!this.opts.shouldFocusInput(this)||this.focusser.focus(),a(s,this.id(e))||this.triggerChange({added:e,removed:i})}},updateSelection:function(e){var s,i,n=this.selection.find(".select2-chosen");this.selection.data("select2-data",e),n.empty(),null!==e&&(s=this.opts.formatSelection(e,n,this.opts.escapeMarkup)),s!==t&&n.append(s),(i=this.opts.formatSelectionCssClass(e,n))!==t&&n.addClass(i),this.selection.removeClass("select2-default"),this.opts.allowClear&&this.getPlaceholder()!==t&&this.container.addClass("select2-allowclear")},val:function(){var e,s=!1,i=null,n=this,o=this.data();if(0===arguments.length)return this.opts.element.val();if(e=arguments[0],arguments.length>1&&(s=arguments[1],this.opts.debug&&console&&console.warn&&console.warn('Select2: The second option to `select2("val")` is not supported in Select2 4.0.0. The `change` event will always be triggered in 4.0.0.')),this.select)this.opts.debug&&console&&console.warn&&console.warn('Select2: Setting the value on a <select> using `select2("val")` is no longer supported in 4.0.0. You can use the `.val(newValue).trigger("change")` method provided by jQuery instead.'),this.select.val(e).find("option").filter(function(){return this.selected}).each2(function(e,t){return i=n.optionToData(t),!1}),this.updateSelection(i),this.setPlaceholder(),s&&this.triggerChange({added:i,removed:o});else{if(!e&&0!==e)return void this.clear(s);if(this.opts.initSelection===t)throw new Error("cannot call val() if initSelection() is not defined");this.opts.element.val(e),this.opts.initSelection(this.opts.element,function(e){n.opts.element.val(e?n.id(e):""),n.updateSelection(e),n.setPlaceholder(),s&&n.triggerChange({added:e,removed:o})})}},clearSearch:function(){this.search.val(""),this.focusser.val("")},data:function(e){var s,i=!1;if(0===arguments.length)return(s=this.selection.data("select2-data"))==t&&(s=null),s;this.opts.debug&&console&&console.warn&&console.warn('Select2: The `select2("data")` method can no longer set selected values in 4.0.0, consider using the `.val()` method instead.'),arguments.length>1&&(i=arguments[1]),e?(s=this.data(),this.opts.element.val(e?this.id(e):""),this.updateSelection(e),i&&this.triggerChange({added:e,removed:s})):this.clear(i)}}),A=P(k,{createContainer:function(){return e(document.createElement("div")).attr({class:"select2-container select2-container-multi"}).html(["<ul class='select2-choices'>"," <li class='select2-search-field'>"," <label for='' class='select2-offscreen'></label>"," <input type='text' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' class='select2-input'>"," </li>","</ul>","<div class='select2-drop select2-drop-multi select2-display-none'>"," <ul class='select2-results'>"," </ul>","</div>"].join(""))},prepareOpts:function(){var t=this.parent.prepareOpts.apply(this,arguments),s=this;return"select"===t.element.get(0).tagName.toLowerCase()?t.initSelection=function(e,t){var i=[];e.find("option").filter(function(){return this.selected&&!this.disabled}).each2(function(e,t){i.push(s.optionToData(t))}),t(i)}:"data"in t&&(t.initSelection=t.initSelection||function(s,i){var n=l(s.val(),t.separator,t.transformVal),o=[];t.query({matcher:function(s,i,l){var r=e.grep(n,function(e){return a(e,t.id(l))}).length;return r&&o.push(l),r},callback:e.isFunction(i)?function(){for(var e=[],s=0;s<n.length;s++)for(var l=n[s],r=0;r<o.length;r++){var c=o[r];if(a(l,t.id(c))){e.push(c),o.splice(r,1);break}}i(e)}:e.noop})}),t},selectChoice:function(e){var t=this.container.find(".select2-search-choice-focus");t.length&&e&&e[0]==t[0]||(t.length&&this.opts.element.trigger("choice-deselected",t),t.removeClass("select2-search-choice-focus"),e&&e.length&&(this.close(),e.addClass("select2-search-choice-focus"),this.opts.element.trigger("choice-selected",e)))},destroy:function(){e("label[for='"+this.search.attr("id")+"']").attr("for",this.opts.element.attr("id")),this.parent.destroy.apply(this,arguments),I.call(this,"searchContainer","selection")},initContainer:function(){var t,s=".select2-choices";this.searchContainer=this.container.find(".select2-search-field"),this.selection=t=this.container.find(s);var i=this;this.selection.on("click",".select2-container:not(.select2-container-disabled) .select2-search-choice:not(.select2-locked)",function(t){i.search[0].focus(),i.selectChoice(e(this))}),this.search.attr("id","s2id_autogen"+D()),this.search.prev().text(e("label[for='"+this.opts.element.attr("id")+"']").text()).attr("for",this.search.attr("id")),this.opts.element.on("focus.select2",this.bind(function(){this.focus()})),this.search.on("input paste",this.bind(function(){this.search.attr("placeholder")&&0==this.search.val().length||this.isInterfaceEnabled()&&(this.opened()||this.open())})),this.search.attr("tabindex",this.elementTabIndex),this.keydowns=0,this.search.on("keydown",this.bind(function(e){if(this.isInterfaceEnabled()){++this.keydowns;var s=t.find(".select2-search-choice-focus"),i=s.prev(".select2-search-choice:not(.select2-locked)"),n=s.next(".select2-search-choice:not(.select2-locked)"),o=f(this.search);if(s.length&&(e.which==F.LEFT||e.which==F.RIGHT||e.which==F.BACKSPACE||e.which==F.DELETE||e.which==F.ENTER)){var a=s;return e.which==F.LEFT&&i.length?a=i:e.which==F.RIGHT?a=n.length?n:null:e.which===F.BACKSPACE?this.unselect(s.first())&&(this.search.width(10),a=i.length?i:n):e.which==F.DELETE?this.unselect(s.first())&&(this.search.width(10),a=n.length?n:null):e.which==F.ENTER&&(a=null),this.selectChoice(a),g(e),void(a&&a.length||this.open())}if((e.which===F.BACKSPACE&&1==this.keydowns||e.which==F.LEFT)&&0==o.offset&&!o.length)return this.selectChoice(t.find(".select2-search-choice:not(.select2-locked)").last()),void g(e);if(this.selectChoice(null),this.opened())switch(e.which){case F.UP:case F.DOWN:return this.moveHighlight(e.which===F.UP?-1:1),void g(e);case F.ENTER:return this.selectHighlighted(),void g(e);case F.TAB:return this.selectHighlighted({noFocus:!0}),void this.close();case F.ESC:return this.cancel(e),void g(e)}if(e.which!==F.TAB&&!F.isControl(e)&&!F.isFunctionKey(e)&&e.which!==F.BACKSPACE&&e.which!==F.ESC){if(e.which===F.ENTER){if(!1===this.opts.openOnEnter)return;if(e.altKey||e.ctrlKey||e.shiftKey||e.metaKey)return}this.open(),e.which!==F.PAGE_UP&&e.which!==F.PAGE_DOWN||g(e),e.which===F.ENTER&&g(e)}}})),this.search.on("keyup",this.bind(function(e){this.keydowns=0,this.resizeSearch()})),this.search.on("blur",this.bind(function(t){this.container.removeClass("select2-container-active"),this.search.removeClass("select2-focused"),this.selectChoice(null),this.opened()||this.clearSearch(),t.stopImmediatePropagation(),this.opts.element.trigger(e.Event("select2-blur"))})),this.container.on("click",s,this.bind(function(t){this.isInterfaceEnabled()&&(e(t.target).closest(".select2-search-choice").length>0||(this.selectChoice(null),this.clearPlaceholder(),this.container.hasClass("select2-container-active")||this.opts.element.trigger(e.Event("select2-focus")),this.open(),this.focusSearch(),t.preventDefault()))})),this.container.on("focus",s,this.bind(function(){this.isInterfaceEnabled()&&(this.container.hasClass("select2-container-active")||this.opts.element.trigger(e.Event("select2-focus")),this.container.addClass("select2-container-active"),this.dropdown.addClass("select2-drop-active"),this.clearPlaceholder())})),this.initContainerWidth(),this.opts.element.hide(),this.clearSearch()},enableInterface:function(){this.parent.enableInterface.apply(this,arguments)&&this.search.prop("disabled",!this.isInterfaceEnabled())},initSelection:function(){if(""===this.opts.element.val()&&""===this.opts.element.text()&&(this.updateSelection([]),this.close(),this.clearSearch()),this.select||""!==this.opts.element.val()){var e=this;this.opts.initSelection.call(null,this.opts.element,function(s){s!==t&&null!==s&&(e.updateSelection(s),e.close(),e.clearSearch())})}},clearSearch:function(){var e=this.getPlaceholder(),s=this.getMaxSearchWidth();e!==t&&0===this.getVal().length&&!1===this.search.hasClass("select2-focused")?(this.search.val(e).addClass("select2-default"),this.search.width(s>0?s:this.container.css("width"))):this.search.val("").width(10)},clearPlaceholder:function(){this.search.hasClass("select2-default")&&this.search.val("").removeClass("select2-default")},opening:function(){this.clearPlaceholder(),this.resizeSearch(),this.parent.opening.apply(this,arguments),this.focusSearch(),this.prefillNextSearchTerm(),this.updateResults(!0),this.opts.shouldFocusInput(this)&&this.search.focus(),this.opts.element.trigger(e.Event("select2-open"))},close:function(){this.opened()&&this.parent.close.apply(this,arguments)},focus:function(){this.close(),this.search.focus()},isFocused:function(){return this.search.hasClass("select2-focused")},updateSelection:function(t){var s={},i=[],n=this;e(t).each(function(){n.id(this)in s||(s[n.id(this)]=0,i.push(this))}),this.selection.find(".select2-search-choice").remove(),this.addSelectedChoice(i),n.postprocessResults()},tokenize:function(){var e=this.search.val();null!=(e=this.opts.tokenizer.call(this,e,this.data(),this.bind(this.onSelect),this.opts))&&e!=t&&(this.search.val(e),e.length>0&&this.open())},onSelect:function(e,t){this.triggerSelect(e)&&""!==e.text&&(this.addSelectedChoice(e),this.opts.element.trigger({type:"selected",val:this.id(e),choice:e}),this.lastSearchTerm=this.search.val(),this.clearSearch(),this.updateResults(),!this.select&&this.opts.closeOnSelect||this.postprocessResults(e,!1,!0===this.opts.closeOnSelect),this.opts.closeOnSelect?(this.close(),this.search.width(10)):this.countSelectableResults()>0?(this.search.width(10),this.resizeSearch(),this.getMaximumSelectionSize()>0&&this.val().length>=this.getMaximumSelectionSize()?this.updateResults(!0):this.prefillNextSearchTerm()&&this.updateResults(),this.positionDropdown()):(this.close(),this.search.width(10)),this.triggerChange({added:e}),t&&t.noFocus||this.focusSearch())},cancel:function(){this.close(),this.focusSearch()},addSelectedChoice:function(t){var s=this.getVal(),i=this;e(t).each(function(){s.push(i.createChoice(this))}),this.setVal(s)},createChoice:function(s){var i,n,o=!s.locked,a=e("<li class='select2-search-choice'> <div></div> <a href='#' class='select2-search-choice-close' tabindex='-1'></a></li>"),l=e("<li class='select2-search-choice select2-locked'><div></div></li>"),r=o?a:l,c=this.id(s);return(i=this.opts.formatSelection(s,r.find("div"),this.opts.escapeMarkup))!=t&&r.find("div").replaceWith(e("<div></div>").html(i)),(n=this.opts.formatSelectionCssClass(s,r.find("div")))!=t&&r.addClass(n),o&&r.find(".select2-search-choice-close").on("mousedown",g).on("click dblclick",this.bind(function(t){this.isInterfaceEnabled()&&(this.unselect(e(t.target)),this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus"),g(t),this.close(),this.focusSearch())})).on("focus",this.bind(function(){this.isInterfaceEnabled()&&(this.container.addClass("select2-container-active"),this.dropdown.addClass("select2-drop-active"))})),r.data("select2-data",s),r.insertBefore(this.searchContainer),c},unselect:function(t){var s,i,o=this.getVal();if(0===(t=t.closest(".select2-search-choice")).length)throw"Invalid argument: "+t+". Must be .select2-search-choice";if(s=t.data("select2-data")){var a=e.Event("select2-removing");if(a.val=this.id(s),a.choice=s,this.opts.element.trigger(a),a.isDefaultPrevented())return!1;for(;(i=n(this.id(s),o))>=0;)o.splice(i,1),this.setVal(o),this.select&&this.postprocessResults();return t.remove(),this.opts.element.trigger({type:"select2-removed",val:this.id(s),choice:s}),this.triggerChange({removed:s}),!0}},postprocessResults:function(e,t,s){var i=this.getVal(),o=this.results.find(".select2-result"),a=this.results.find(".select2-result-with-children"),l=this;o.each2(function(e,t){n(l.id(t.data("select2-data")),i)>=0&&(t.addClass("select2-selected"),t.find(".select2-result-selectable").addClass("select2-selected"))}),a.each2(function(e,t){t.is(".select2-result-selectable")||0!==t.find(".select2-result-selectable:not(.select2-selected)").length||t.addClass("select2-selected")}),-1==this.highlight()&&!1!==s&&!0===this.opts.closeOnSelect&&l.highlight(0),!this.opts.createSearchChoice&&!o.filter(".select2-result:not(.select2-selected)").length>0&&(!e||e&&!e.more&&0===this.results.find(".select2-no-results").length)&&E(l.opts.formatNoMatches,"formatNoMatches")&&this.results.append("<li class='select2-no-results'>"+T(l.opts.formatNoMatches,l.opts.element,l.search.val())+"</li>")},getMaxSearchWidth:function(){return this.selection.width()-r(this.search)},resizeSearch:function(){var e,t,s,i,n=r(this.search);e=v(this.search)+10,t=this.search.offset().left,(i=(s=this.selection.width())-(t-this.selection.offset().left)-n)<e&&(i=s-n),i<40&&(i=s-n),i<=0&&(i=e),this.search.width(Math.floor(i))},getVal:function(){var e;return this.select?null===(e=this.select.val())?[]:e:(e=this.opts.element.val(),l(e,this.opts.separator,this.opts.transformVal))},setVal:function(t){if(this.select)this.select.val(t);else{var s=[],i={};e(t).each(function(){this in i||(s.push(this),i[this]=0)}),this.opts.element.val(0===s.length?"":s.join(this.opts.separator))}},buildChangeDetails:function(e,t){for(var t=t.slice(0),e=e.slice(0),s=0;s<t.length;s++)for(var i=0;i<e.length;i++)if(a(this.opts.id(t[s]),this.opts.id(e[i]))){t.splice(s,1),s--,e.splice(i,1);break}return{added:t,removed:e}},val:function(s,i){var n,o=this;if(0===arguments.length)return this.getVal();if((n=this.data()).length||(n=[]),!s&&0!==s)return this.opts.element.val(""),this.updateSelection([]),this.clearSearch(),void(i&&this.triggerChange({added:this.data(),removed:n}));if(this.setVal(s),this.select)this.opts.initSelection(this.select,this.bind(this.updateSelection)),i&&this.triggerChange(this.buildChangeDetails(n,this.data()));else{if(this.opts.initSelection===t)throw new Error("val() cannot be called if initSelection() is not defined");this.opts.initSelection(this.opts.element,function(t){var s=e.map(t,o.id);o.setVal(s),o.updateSelection(t),o.clearSearch(),i&&o.triggerChange(o.buildChangeDetails(n,o.data()))})}this.clearSearch()},onSortStart:function(){if(this.select)throw new Error("Sorting of elements is not supported when attached to <select>. Attach to <input type='hidden'/> instead.");this.search.width(0),this.searchContainer.hide()},onSortEnd:function(){var t=[],s=this;this.searchContainer.show(),this.searchContainer.appendTo(this.searchContainer.parent()),this.resizeSearch(),this.selection.find(".select2-search-choice").each(function(){t.push(s.opts.id(e(this).data("select2-data")))}),this.setVal(t),this.triggerChange()},data:function(t,s){var i,n,o=this;if(0===arguments.length)return this.selection.children(".select2-search-choice").map(function(){return e(this).data("select2-data")}).get();n=this.data(),t||(t=[]),i=e.map(t,function(e){return o.opts.id(e)}),this.setVal(i),this.updateSelection(t),this.clearSearch(),s&&this.triggerChange(this.buildChangeDetails(n,this.data()))}}),e.fn.select2=function(){var s,i,o,a,l,r=Array.prototype.slice.call(arguments,0),c=["val","destroy","opened","open","close","focus","isFocused","container","dropdown","onSortStart","onSortEnd","enable","disable","readonly","positionDropdown","data","search"],h=["opened","isFocused","container","dropdown"],u=["val","data"],d={search:"externalSearch"};return this.each(function(){if(0===r.length||"object"==typeof r[0])(s=0===r.length?{}:e.extend({},r[0])).element=e(this),"select"===s.element.get(0).tagName.toLowerCase()?l=s.element.prop("multiple"):(l=s.multiple||!1,"tags"in s&&(s.multiple=l=!0)),(i=l?new window.Select2.class.multi:new window.Select2.class.single).init(s);else{if("string"!=typeof r[0])throw"Invalid arguments to select2 plugin: "+r;if(n(r[0],c)<0)throw"Unknown method: "+r[0];if(a=t,(i=e(this).data("select2"))===t)return;if("container"===(o=r[0])?a=i.container:"dropdown"===o?a=i.dropdown:(d[o]&&(o=d[o]),a=i[o].apply(i,r.slice(1))),n(r[0],h)>=0||n(r[0],u)>=0&&1==r.length)return!1}}),a===t?this:a},e.fn.select2.defaults={debug:!1,width:"copy",loadMorePadding:0,closeOnSelect:!0,openOnEnter:!0,containerCss:{},dropdownCss:{},containerCssClass:"",dropdownCssClass:"",formatResult:function(e,t,s,i){var n=[];return w(this.text(e),s.term,n,i),n.join("")},transformVal:function(t){return e.trim(t)},formatSelection:function(e,s,i){return e?i(this.text(e)):t},sortResults:function(e,t,s){return e},formatResultCssClass:function(e){return e.css},formatSelectionCssClass:function(e,s){return t},minimumResultsForSearch:0,minimumInputLength:0,maximumInputLength:null,maximumSelectionSize:0,id:function(e){return e==t?null:e.id},text:function(t){return t&&this.data&&this.data.text?e.isFunction(this.data.text)?this.data.text(t):t[this.data.text]:t.text},matcher:function(e,t){return i(""+t).toUpperCase().indexOf(i(""+e).toUpperCase())>=0},separator:",",tokenSeparators:[],tokenizer:function(e,s,i,n){var o,l,r,c,h,u=e,d=!1;if(!n.createSearchChoice||!n.tokenSeparators||n.tokenSeparators.length<1)return t;for(;;){for(l=-1,r=0,c=n.tokenSeparators.length;r<c&&(h=n.tokenSeparators[r],!((l=e.indexOf(h))>=0));r++);if(l<0)break;if(o=e.substring(0,l),e=e.substring(l+h.length),o.length>0&&(o=n.createSearchChoice.call(this,o,s))!==t&&null!==o&&n.id(o)!==t&&null!==n.id(o)){for(d=!1,r=0,c=s.length;r<c;r++)if(a(n.id(o),n.id(s[r]))){d=!0;break}d||i(o)}}return u!==e?e:void 0},escapeMarkup:S,blurOnChange:!1,selectOnBlur:!1,adaptContainerCssClass:function(e){return e},adaptDropdownCssClass:function(e){return null},nextSearchTerm:function(e,s){return t},searchInputPlaceholder:"",createSearchChoicePosition:"top",shouldFocusInput:function(e){return!("ontouchstart"in window||navigator.msMaxTouchPoints>0)||!(e.opts.minimumResultsForSearch<0)}},e.fn.select2.locales=[],e.fn.select2.locales.en={formatMatches:function(e){return 1===e?"One result is available, press enter to select it.":e+" results are available, use up and down arrow keys to navigate."},formatNoMatches:function(){return"No matches found"},formatAjaxError:function(e,t,s){return"Loading failed"},formatInputTooShort:function(e,t){var s=t-e.length;return"Please enter "+s+" or more character"+(1==s?"":"s")},formatInputTooLong:function(e,t){var s=e.length-t;return"Please delete "+s+" character"+(1==s?"":"s")},formatSelectionTooBig:function(e){return"You can only select "+e+" item"+(1==e?"":"s")},formatLoadMore:function(e){return"Loading more results…"},formatSearching:function(){return"Searching…"}},e.extend(e.fn.select2.defaults,e.fn.select2.locales.en),e.fn.select2.ajaxDefaults={transport:e.ajax,params:{type:"GET",cache:!1,dataType:"json"}},window.Select2={query:{ajax:C,local:y,tags:x},util:{debounce:u,markMatch:w,escapeMarkup:S,stripDiacritics:i},class:{abstract:k,single:R,multi:A}}}}(jQuery);
+!function(n){void 0===n.fn.each2&&n.extend(n.fn,{each2:function(e){for(var t=n([0]),s=-1,i=this.length;++s<i&&(t.context=t[0]=this[s])&&!1!==e.call(t[0],s,t););return this}})}(jQuery),function(C,S){"use strict";if(window.Select2===S){var e,t,s,y,o,n,x,i,c={x:0,y:0},l={TAB:9,ENTER:13,ESC:27,SPACE:32,LEFT:37,UP:38,RIGHT:39,DOWN:40,SHIFT:16,CTRL:17,ALT:18,PAGE_UP:33,PAGE_DOWN:34,HOME:36,END:35,BACKSPACE:8,DELETE:46,isArrow:function(e){switch(e=e.which?e.which:e){case l.LEFT:case l.RIGHT:case l.UP:case l.DOWN:return!0}return!1},isControl:function(e){switch(e.which){case l.SHIFT:case l.CTRL:case l.ALT:return!0}return!!e.metaKey},isFunctionKey:function(e){return 112<=(e=e.which?e.which:e)&&e<=123}},h="<div class='select2-measure-scrollbar'></div>",a={"Ⓐ":"A","A":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","B":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ɓ":"B","Ⓒ":"C","C":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","Ç":"C","Ḉ":"C","Ƈ":"C","Ȼ":"C","Ꜿ":"C","Ⓓ":"D","D":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ƌ":"D","Ɗ":"D","Ɖ":"D","Ꝺ":"D","DZ":"DZ","DŽ":"DZ","Dz":"Dz","Dž":"Dz","Ⓔ":"E","E":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","Ⓕ":"F","F":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","G":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","Ⓗ":"H","H":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","I":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","J":"J","Ĵ":"J","Ɉ":"J","Ⓚ":"K","K":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","L":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","LJ":"LJ","Lj":"Lj","Ⓜ":"M","M":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","Ⓝ":"N","N":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ƞ":"N","Ɲ":"N","Ꞑ":"N","Ꞥ":"N","NJ":"NJ","Nj":"Nj","Ⓞ":"O","O":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","P":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Q":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","R":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R","Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꝛ":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","S":"S","ẞ":"S","Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S","Ꞅ":"S","Ⓣ":"T","T":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T","Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"TZ","Ⓤ":"U","U":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ǜ":"U","Ǘ":"U","Ǖ":"U","Ǚ":"U","Ủ":"U","Ů":"U","Ű":"U","Ǔ":"U","Ȕ":"U","Ȗ":"U","Ư":"U","Ừ":"U","Ứ":"U","Ữ":"U","Ử":"U","Ự":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","Ṵ":"U","Ʉ":"U","Ⓥ":"V","V":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","W":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","X":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Y":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Z":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","a":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","b":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","c":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","ⓓ":"d","d":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","ꝺ":"d","dz":"dz","dž":"dz","ⓔ":"e","e":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ɛ":"e","ǝ":"e","ⓕ":"f","f":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","g":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ᵹ":"g","ꝿ":"g","ⓗ":"h","h":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","i":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","j":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","k":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","l":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","lj":"lj","ⓜ":"m","m":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","n":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ʼn":"n","ꞑ":"n","ꞥ":"n","nj":"nj","ⓞ":"o","o":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ɔ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","p":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","q":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","r":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","s":"s","ß":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ⓣ":"t","t":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","u":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","v":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","w":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","x":"x","ẋ":"x","ẍ":"x","ⓨ":"y","y":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","z":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ω":"ω","ς":"σ"};n=C(document),i=1,y=function(){return i++},t=D(e=D(Object,{bind:function(e){var t=this;return function(){e.apply(t,arguments)}},init:function(e){var o,t,s,i,n,a=".select2-results";this.opts=e=this.prepareOpts(e),this.id=e.id,e.element.data("select2")!==S&&null!==e.element.data("select2")&&e.element.data("select2").destroy(),this.container=this.createContainer(),this.liveRegion=C(".select2-hidden-accessible"),0==this.liveRegion.length&&(this.liveRegion=C("<span>",{role:"status","aria-live":"polite"}).addClass("select2-hidden-accessible").appendTo(document.body)),this.containerId="s2id_"+(e.element.attr("id")||"autogen"+y()),this.containerEventName=this.containerId.replace(/([.])/g,"_").replace(/([;&,\-\.\+\*\~':"\!\^#$%@\[\]\(\)=>\|])/g,"\\$1"),this.container.attr("id",this.containerId),this.container.attr("title",e.element.attr("title")),this.body=C(document.body),w(this.container,this.opts.element,this.opts.adaptContainerCssClass),this.container.attr("style",e.element.attr("style")),this.container.css(R(e.containerCss,this.opts.element)),this.container.addClass(R(e.containerCssClass,this.opts.element)),this.elementTabIndex=this.opts.element.attr("tabindex"),this.opts.element.data("select2",this).attr("tabindex","-1").before(this.container).on("click.select2",b),this.container.data("select2",this),this.dropdown=this.container.find(".select2-drop"),w(this.dropdown,this.opts.element,this.opts.adaptDropdownCssClass),this.dropdown.addClass(R(e.dropdownCssClass,this.opts.element)),this.dropdown.data("select2",this),this.dropdown.on("click",b),this.results=o=this.container.find(a),this.search=t=this.container.find("input.select2-input"),this.queryCount=0,this.resultsPage=0,this.context=null,this.initContainer(),this.container.on("click",b),this.results.on("mousemove",function(e){var t=c;t!==S&&t.x===e.pageX&&t.y===e.pageY||C(e.target).trigger("mousemove-filtered",e)}),this.dropdown.on("mousemove-filtered",a,this.bind(this.highlightUnderEvent)),this.dropdown.on("touchstart touchmove touchend",a,this.bind(function(e){this._touchEvent=!0,this.highlightUnderEvent(e)})),this.dropdown.on("touchmove",a,this.bind(this.touchMoved)),this.dropdown.on("touchstart touchend",a,this.bind(this.clearTouchMoved)),this.dropdown.on("click",this.bind(function(e){this._touchEvent&&(this._touchEvent=!1,this.selectHighlighted())})),s=80,i=this.results,n=v(s,function(e){i.trigger("scroll-debounced",e)}),i.on("scroll",function(e){0<=d(e.target,i.get())&&n(e)}),this.dropdown.on("scroll-debounced",a,this.bind(this.loadMoreIfNeeded)),C(this.container).on("change",".select2-input",function(e){e.stopPropagation()}),C(this.dropdown).on("change",".select2-input",function(e){e.stopPropagation()}),C.fn.mousewheel&&o.mousewheel(function(e,t,s,i){var n=o.scrollTop();0<i&&n-i<=0?(o.scrollTop(0),b(e)):i<0&&o.get(0).scrollHeight-o.scrollTop()+i<=o.height()&&(o.scrollTop(o.get(0).scrollHeight-o.height()),b(e))}),m(t),t.on("keyup-change input paste",this.bind(this.updateResults)),t.on("focus",function(){t.addClass("select2-focused")}),t.on("blur",function(){t.removeClass("select2-focused")}),this.dropdown.on("mouseup",a,this.bind(function(e){0<C(e.target).closest(".select2-result-selectable").length&&(this.highlightUnderEvent(e),this.selectHighlighted(e))})),this.dropdown.on("click mouseup mousedown touchstart touchend focusin",function(e){e.stopPropagation()}),this.lastSearchTerm=S,C.isFunction(this.opts.initSelection)&&(this.initSelection(),this.monitorSource()),null!==e.maximumInputLength&&this.search.attr("maxlength",e.maximumInputLength);var l=e.element.prop("disabled");l===S&&(l=!1),this.enable(!l);var r=e.element.prop("readonly");r===S&&(r=!1),this.readonly(r),x=x||function(){var e=C(h);e.appendTo(document.body);var t={width:e.width()-e[0].clientWidth,height:e.height()-e[0].clientHeight};return e.remove(),t}(),this.autofocus=e.element.prop("autofocus"),e.element.prop("autofocus",!1),this.autofocus&&this.focus(),this.search.attr("placeholder",e.searchInputPlaceholder)},destroy:function(){var e=this.opts.element,t=e.data("select2"),s=this;this.close(),e.length&&e[0].detachEvent&&s._sync&&e.each(function(){s._sync&&this.detachEvent("onpropertychange",s._sync)}),this.propertyObserver&&(this.propertyObserver.disconnect(),this.propertyObserver=null),this._sync=null,t!==S&&(t.container.remove(),t.liveRegion.remove(),t.dropdown.remove(),e.removeData("select2").off(".select2"),e.is("input[type='hidden']")?e.css("display",""):(e.show().prop("autofocus",this.autofocus||!1),this.elementTabIndex?e.attr({tabindex:this.elementTabIndex}):e.removeAttr("tabindex"),e.show())),A.call(this,"container","liveRegion","dropdown","results","search")},optionToData:function(e){return e.is("option")?{id:e.prop("value"),text:e.text(),element:e.get(),css:e.attr("class"),disabled:e.prop("disabled"),locked:p(e.attr("locked"),"locked")||p(e.data("locked"),!0)}:e.is("optgroup")?{text:e.attr("label"),children:[],element:e.get(),css:e.attr("class")}:void 0},prepareOpts:function(b){var a,e,t,s,w=this;if("select"===(a=b.element).get(0).tagName.toLowerCase()&&(this.select=e=b.element),e&&C.each(["id","multiple","ajax","query","createSearchChoice","initSelection","data","tags"],function(){if(this in b)throw new Error("Option '"+this+"' is not allowed for Select2 when attached to a <select> element.")}),b.debug=b.debug||C.fn.select2.defaults.debug,b.debug&&console&&console.warn&&(null!=b.id&&console.warn("Select2: The `id` option has been removed in Select2 4.0.0, consider renaming your `id` property or mapping the property before your data makes it to Select2. You can read more at https://select2.github.io/announcements-4.0.html#changed-id"),null!=b.text&&console.warn("Select2: The `text` option has been removed in Select2 4.0.0, consider renaming your `text` property or mapping the property before your data makes it to Select2. You can read more at https://select2.github.io/announcements-4.0.html#changed-id"),null!=b.sortResults&&console.warn("Select2: the `sortResults` option has been renamed to `sorter` in Select2 4.0.0. "),null!=b.selectOnBlur&&console.warn("Select2: The `selectOnBlur` option has been renamed to `selectOnClose` in Select2 4.0.0."),null!=b.ajax&&null!=b.ajax.results&&console.warn("Select2: The `ajax.results` option has been renamed to `ajax.processResults` in Select2 4.0.0."),null!=b.formatNoResults&&console.warn("Select2: The `formatNoResults` option has been renamed to `language.noResults` in Select2 4.0.0."),null!=b.formatSearching&&console.warn("Select2: The `formatSearching` option has been renamed to `language.searching` in Select2 4.0.0."),null!=b.formatInputTooShort&&console.warn("Select2: The `formatInputTooShort` option has been renamed to `language.inputTooShort` in Select2 4.0.0."),null!=b.formatInputTooLong&&console.warn("Select2: The `formatInputTooLong` option has been renamed to `language.inputTooLong` in Select2 4.0.0."),null!=b.formatLoading&&console.warn("Select2: The `formatLoading` option has been renamed to `language.loadingMore` in Select2 4.0.0."),null!=b.formatSelectionTooBig&&console.warn("Select2: The `formatSelectionTooBig` option has been renamed to `language.maximumSelected` in Select2 4.0.0."),b.element.data("select2Tags")&&console.warn("Select2: The `data-select2-tags` attribute has been renamed to `data-tags` in Select2 4.0.0.")),null!=b.element.data("tags")){var i=b.element.data("tags");C.isArray(i)||(i=[]),b.element.data("select2Tags",i)}if(null!=b.sorter&&(b.sortResults=b.sorter),null!=b.selectOnClose&&(b.selectOnBlur=b.selectOnClose),null!=b.ajax&&C.isFunction(b.ajax.processResults)&&(b.ajax.results=b.ajax.processResults),null!=b.language){var n=b.language;C.isFunction(n.noMatches)&&(b.formatNoMatches=n.noMatches),C.isFunction(n.searching)&&(b.formatSearching=n.searching),C.isFunction(n.inputTooShort)&&(b.formatInputTooShort=n.inputTooShort),C.isFunction(n.inputTooLong)&&(b.formatInputTooLong=n.inputTooLong),C.isFunction(n.loadingMore)&&(b.formatLoading=n.loadingMore),C.isFunction(n.maximumSelected)&&(b.formatSelectionTooBig=n.maximumSelected)}if("function"!=typeof(b=C.extend({},{populateResults:function(e,t,f){var g,m=this.opts.id,v=this.liveRegion;(g=function(e,t,s){var i,n,o,a,l,r,c,h,u,d,p=[];for(i=0,n=(e=b.sortResults(e,t,f)).length;i<n;i+=1)a=!(l=!0===(o=e[i]).disabled)&&m(o)!==S,r=o.children&&0<o.children.length,(c=C("<li></li>")).addClass("select2-results-dept-"+s),c.addClass("select2-result"),c.addClass(a?"select2-result-selectable":"select2-result-unselectable"),l&&c.addClass("select2-disabled"),r&&c.addClass("select2-result-with-children"),c.addClass(w.opts.formatResultCssClass(o)),c.attr("role","presentation"),(h=C(document.createElement("div"))).addClass("select2-result-label"),h.attr("id","select2-result-label-"+y()),h.attr("role","option"),(d=b.formatResult(o,h,f,w.opts.escapeMarkup))!==S&&(h.html(d),c.append(h)),r&&((u=C("<ul></ul>")).addClass("select2-result-sub"),g(o.children,u,s+1),c.append(u)),c.data("select2-data",o),p.push(c[0]);t.append(p),v.text(b.formatMatches(e.length))})(t,e,0)}},C.fn.select2.defaults,b)).id&&(t=b.id,b.id=function(e){return e[t]}),C.isArray(b.element.data("select2Tags"))){if("tags"in b)throw"tags specified as both an attribute 'data-select2-tags' and in options of Select2 "+b.element.attr("id");b.tags=b.element.data("select2Tags")}if(e?(b.query=this.bind(function(i){var e,t,n,s={results:[],more:!1},o=i.term;n=function(e,t){var s;e.is("option")?i.matcher(o,e.text(),e)&&t.push(w.optionToData(e)):e.is("optgroup")&&(s=w.optionToData(e),e.children().each2(function(e,t){n(t,s.children)}),0<s.children.length&&t.push(s))},e=a.children(),this.getPlaceholder()!==S&&0<e.length&&(t=this.getPlaceholderOption())&&(e=e.not(t)),e.each2(function(e,t){n(t,s.results)}),i.callback(s)}),b.id=function(e){return e.id}):"query"in b||("ajax"in b?((s=b.element.data("ajax-url"))&&0<s.length&&(b.ajax.url=s),b.query=O.call(b.element,b.ajax)):"data"in b?b.query=I(b.data):"tags"in b&&(b.query=P(b.tags),b.createSearchChoice===S&&(b.createSearchChoice=function(e){return{id:C.trim(e),text:C.trim(e)}}),b.initSelection===S&&(b.initSelection=function(e,t){var s=[];C(f(e.val(),b.separator,b.transformVal)).each(function(){var e={id:this,text:this},t=b.tags;C.isFunction(t)&&(t=t()),C(t).each(function(){if(p(this.id,e.id))return e=this,!1}),s.push(e)}),t(s)}))),"function"!=typeof b.query)throw"query function not defined for Select2 "+b.element.attr("id");if("top"===b.createSearchChoicePosition)b.createSearchChoicePosition=function(e,t){e.unshift(t)};else if("bottom"===b.createSearchChoicePosition)b.createSearchChoicePosition=function(e,t){e.push(t)};else if("function"!=typeof b.createSearchChoicePosition)throw"invalid createSearchChoicePosition option must be 'top', 'bottom' or a custom function";return b},monitorSource:function(){var e,s=this.opts.element,t=this;s.on("change.select2",this.bind(function(e){!0!==this.opts.element.data("select2-change-triggered")&&this.initSelection()})),this._sync=this.bind(function(){var e=s.prop("disabled");e===S&&(e=!1),this.enable(!e);var t=s.prop("readonly");t===S&&(t=!1),this.readonly(t),this.container&&(w(this.container,this.opts.element,this.opts.adaptContainerCssClass),this.container.addClass(R(this.opts.containerCssClass,this.opts.element))),this.dropdown&&(w(this.dropdown,this.opts.element,this.opts.adaptDropdownCssClass),this.dropdown.addClass(R(this.opts.dropdownCssClass,this.opts.element)))}),s.length&&s[0].attachEvent&&s.each(function(){this.attachEvent("onpropertychange",t._sync)}),(e=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver)!==S&&(this.propertyObserver&&(delete this.propertyObserver,this.propertyObserver=null),this.propertyObserver=new e(function(e){C.each(e,t._sync)}),this.propertyObserver.observe(s.get(0),{attributes:!0,subtree:!1}))},triggerSelect:function(e){var t=C.Event("select2-selecting",{val:this.id(e),object:e,choice:e});return this.opts.element.trigger(t),!t.isDefaultPrevented()},triggerChange:function(e){e=e||{},e=C.extend({},e,{type:"change",val:this.val()}),this.opts.element.data("select2-change-triggered",!0),this.opts.element.trigger(e),this.opts.element.data("select2-change-triggered",!1),this.opts.element.click(),this.opts.blurOnChange&&this.opts.element.blur()},isInterfaceEnabled:function(){return!0===this.enabledInterface},enableInterface:function(){var e=this._enabled&&!this._readonly,t=!e;return e!==this.enabledInterface&&(this.container.toggleClass("select2-container-disabled",t),this.close(),this.enabledInterface=e,!0)},enable:function(e){e===S&&(e=!0),this._enabled!==e&&(this._enabled=e,this.opts.element.prop("disabled",!e),this.enableInterface())},disable:function(){this.enable(!1)},readonly:function(e){e===S&&(e=!1),this._readonly!==e&&(this._readonly=e,this.opts.element.prop("readonly",e),this.enableInterface())},opened:function(){return!!this.container&&this.container.hasClass("select2-dropdown-open")},positionDropdown:function(){var e,t,s,i,n,o=this.dropdown,a=this.container,l=a.offset(),r=a.outerHeight(!1),c=a.outerWidth(!1),h=o.outerHeight(!1),u=C(window),d=u.width(),p=u.height(),f=u.scrollLeft()+d,g=u.scrollTop()+p,m=l.top+r,v=l.left,b=m+h<=g,w=l.top-h>=u.scrollTop(),S=o.outerWidth(!1);o.hasClass("select2-drop-above")?(t=!0,!w&&b&&(t=!(s=!0))):(t=!1,!b&&w&&(t=s=!0)),s&&(o.hide(),l=this.container.offset(),r=this.container.outerHeight(!1),c=this.container.outerWidth(!1),h=o.outerHeight(!1),f=u.scrollLeft()+d,g=u.scrollTop()+p,m=l.top+r,v=l.left,S=o.outerWidth(!1),o.show(),this.focusSearch()),this.opts.dropdownAutoWidth?(n=C(".select2-results",o)[0],o.addClass("select2-drop-auto-width"),o.css("width",""),c<(S=o.outerWidth(!1)+(n.scrollHeight===n.clientHeight?0:x.width))?c=S:S=c,h=o.outerHeight(!1)):this.container.removeClass("select2-drop-auto-width"),"static"!==this.body.css("position")&&(m-=(e=this.body.offset()).top,v-=e.left),!(v+S<=f)&&l.left+f+a.outerWidth(!1)>S&&(v=l.left+this.container.outerWidth(!1)-S),i={left:v,width:c},t?(this.container.addClass("select2-drop-above"),o.addClass("select2-drop-above"),h=o.outerHeight(!1),i.top=l.top-h,i.bottom="auto"):(i.top=m,i.bottom="auto",this.container.removeClass("select2-drop-above"),o.removeClass("select2-drop-above")),i=C.extend(i,R(this.opts.dropdownCss,this.opts.element)),o.css(i)},shouldOpen:function(){var e;return!this.opened()&&(!1!==this._enabled&&!0!==this._readonly&&(e=C.Event("select2-opening"),this.opts.element.trigger(e),!e.isDefaultPrevented()))},clearDropdownAlignmentPreference:function(){this.container.removeClass("select2-drop-above"),this.dropdown.removeClass("select2-drop-above")},open:function(){return!!this.shouldOpen()&&(this.opening(),n.on("mousemove.select2Event",function(e){c.x=e.pageX,c.y=e.pageY}),!0)},opening:function(){var i,e=this.containerEventName,t="scroll."+e,s="resize."+e,n="orientationchange."+e;this.container.addClass("select2-dropdown-open").addClass("select2-container-active"),this.clearDropdownAlignmentPreference(),this.dropdown[0]!==this.body.children().last()[0]&&this.dropdown.detach().appendTo(this.body),0===(i=C("#select2-drop-mask")).length&&((i=C(document.createElement("div"))).attr("id","select2-drop-mask").attr("class","select2-drop-mask"),i.hide(),i.appendTo(this.body),i.on("mousedown touchstart click",function(e){r(i);var t,s=C("#select2-drop");0<s.length&&((t=s.data("select2")).opts.selectOnBlur&&t.selectHighlighted({noFocus:!0}),t.close(),e.preventDefault(),e.stopPropagation())})),this.dropdown.prev()[0]!==i[0]&&this.dropdown.before(i),C("#select2-drop").removeAttr("id"),this.dropdown.attr("id","select2-drop"),i.show(),this.positionDropdown(),this.dropdown.show(),this.positionDropdown(),this.dropdown.addClass("select2-drop-active");var o=this;this.container.parents().add(window).each(function(){C(this).on(s+" "+t+" "+n,function(e){o.opened()&&o.positionDropdown()})})},close:function(){if(this.opened()){var e=this.containerEventName,t="scroll."+e,s="resize."+e,i="orientationchange."+e;this.container.parents().add(window).each(function(){C(this).off(t).off(s).off(i)}),this.clearDropdownAlignmentPreference(),C("#select2-drop-mask").hide(),this.dropdown.removeAttr("id"),this.dropdown.hide(),this.container.removeClass("select2-dropdown-open").removeClass("select2-container-active"),this.results.empty(),n.off("mousemove.select2Event"),this.clearSearch(),this.search.removeClass("select2-active"),this.search.removeAttr("aria-activedescendant"),this.opts.element.trigger(C.Event("select2-close"))}},externalSearch:function(e){this.open(),this.search.val(e),this.updateResults(!1)},clearSearch:function(){},prefillNextSearchTerm:function(){if(""!==this.search.val())return!1;var e=this.opts.nextSearchTerm(this.data(),this.lastSearchTerm);return e!==S&&(this.search.val(e),this.search.select(),!0)},getMaximumSelectionSize:function(){return R(this.opts.maximumSelectionSize,this.opts.element)},ensureHighlightVisible:function(){var e,t,s,i,n,o,a,l,r=this.results;(t=this.highlight())<0||0!=t&&(e=this.findHighlightableChoices().find(".select2-result-label"),i=(l=((s=C(e[t])).offset()||{}).top||0)+s.outerHeight(!0),t===e.length-1&&0<(a=r.find("li.select2-more-results")).length&&(i=a.offset().top+a.outerHeight(!0)),(n=r.offset().top+r.outerHeight(!1))<i&&r.scrollTop(r.scrollTop()+(i-n)),(o=l-r.offset().top)<0&&"none"!=s.css("display")&&r.scrollTop(r.scrollTop()+o))},findHighlightableChoices:function(){return this.results.find(".select2-result-selectable:not(.select2-disabled):not(.select2-selected)")},moveHighlight:function(e){for(var t=this.findHighlightableChoices(),s=this.highlight();-1<s&&s<t.length;){var i=C(t[s+=e]);if(i.hasClass("select2-result-selectable")&&!i.hasClass("select2-disabled")&&!i.hasClass("select2-selected")){this.highlight(s);break}}},highlight:function(e){var t,s,i=this.findHighlightableChoices();if(0===arguments.length)return d(i.filter(".select2-highlighted")[0],i.get());e>=i.length&&(e=i.length-1),e<0&&(e=0),this.removeHighlight(),(t=C(i[e])).addClass("select2-highlighted"),this.search.attr("aria-activedescendant",t.find(".select2-result-label").attr("id")),this.ensureHighlightVisible(),this.liveRegion.text(t.text()),(s=t.data("select2-data"))&&this.opts.element.trigger({type:"select2-highlight",val:this.id(s),choice:s})},removeHighlight:function(){this.results.find(".select2-highlighted").removeClass("select2-highlighted")},touchMoved:function(){this._touchMoved=!0},clearTouchMoved:function(){this._touchMoved=!1},countSelectableResults:function(){return this.findHighlightableChoices().length},highlightUnderEvent:function(e){var t=C(e.target).closest(".select2-result-selectable");if(0<t.length&&!t.is(".select2-highlighted")){var s=this.findHighlightableChoices();this.highlight(s.index(t))}else 0==t.length&&this.removeHighlight()},loadMoreIfNeeded:function(){var t=this.results,s=t.find("li.select2-more-results"),i=this.resultsPage+1,n=this,o=this.search.val(),a=this.context;0!==s.length&&s.offset().top-t.offset().top-t.height()<=this.opts.loadMorePadding&&(s.addClass("select2-active"),this.opts.query({element:this.opts.element,term:o,page:i,context:a,matcher:this.opts.matcher,callback:this.bind(function(e){n.opened()&&(n.opts.populateResults.call(this,t,e.results,{term:o,page:i,context:a}),n.postprocessResults(e,!1,!1),!0===e.more?(s.detach().appendTo(t).html(n.opts.escapeMarkup(R(n.opts.formatLoadMore,n.opts.element,i+1))),window.setTimeout(function(){n.loadMoreIfNeeded()},10)):s.remove(),n.positionDropdown(),n.resultsPage=i,n.context=e.context,this.opts.element.trigger({type:"select2-loaded",items:e}))})}))},tokenize:function(){},updateResults:function(s){var e,t,i,n=this.search,o=this.results,a=this.opts,l=this,r=n.val(),c=C.data(this.container,"select2-last-term");if((!0===s||!c||!p(r,c))&&(C.data(this.container,"select2-last-term",r),!0===s||!1!==this.showSearchInput&&this.opened())){i=++this.queryCount;var h=this.getMaximumSelectionSize();if(!(1<=h&&(e=this.data(),C.isArray(e)&&e.length>=h&&k(a.formatSelectionTooBig,"formatSelectionTooBig"))))return n.val().length<a.minimumInputLength?(k(a.formatInputTooShort,"formatInputTooShort")?d("<li class='select2-no-results'>"+R(a.formatInputTooShort,a.element,n.val(),a.minimumInputLength)+"</li>"):d(""),void(s&&this.showSearch&&this.showSearch(!0))):void(a.maximumInputLength&&n.val().length>a.maximumInputLength?k(a.formatInputTooLong,"formatInputTooLong")?d("<li class='select2-no-results'>"+R(a.formatInputTooLong,a.element,n.val(),a.maximumInputLength)+"</li>"):d(""):(a.formatSearching&&0===this.findHighlightableChoices().length&&d("<li class='select2-searching'>"+R(a.formatSearching,a.element)+"</li>"),n.addClass("select2-active"),this.removeHighlight(),(t=this.tokenize())!=S&&null!=t&&n.val(t),this.resultsPage=1,a.query({element:a.element,term:n.val(),page:this.resultsPage,context:null,matcher:a.matcher,callback:this.bind(function(e){var t;if(i==this.queryCount)if(this.opened())if(e.hasError!==S&&k(a.formatAjaxError,"formatAjaxError"))d("<li class='select2-ajax-error'>"+R(a.formatAjaxError,a.element,e.jqXHR,e.textStatus,e.errorThrown)+"</li>");else{if(this.context=e.context===S?null:e.context,this.opts.createSearchChoice&&""!==n.val()&&(t=this.opts.createSearchChoice.call(l,n.val(),e.results))!==S&&null!==t&&l.id(t)!==S&&null!==l.id(t)&&0===C(e.results).filter(function(){return p(l.id(this),l.id(t))}).length&&this.opts.createSearchChoicePosition(e.results,t),0===e.results.length&&k(a.formatNoMatches,"formatNoMatches"))return d("<li class='select2-no-results'>"+R(a.formatNoMatches,a.element,n.val())+"</li>"),void(this.showSearch&&this.showSearch(n.val()));o.empty(),l.opts.populateResults.call(this,o,e.results,{term:n.val(),page:this.resultsPage,context:null}),!0===e.more&&k(a.formatLoadMore,"formatLoadMore")&&(o.append("<li class='select2-more-results'>"+a.escapeMarkup(R(a.formatLoadMore,a.element,this.resultsPage))+"</li>"),window.setTimeout(function(){l.loadMoreIfNeeded()},10)),this.postprocessResults(e,s),u(),this.opts.element.trigger({type:"select2-loaded",items:e})}else this.search.removeClass("select2-active")})})));d("<li class='select2-selection-limit'>"+R(a.formatSelectionTooBig,a.element,h)+"</li>")}function u(){n.removeClass("select2-active"),l.positionDropdown(),o.find(".select2-no-results,.select2-selection-limit,.select2-searching").length?l.liveRegion.text(o.text()):l.liveRegion.text(l.opts.formatMatches(o.find('.select2-result-selectable:not(".select2-selected")').length))}function d(e){o.html(e),u()}},cancel:function(){this.close()},blur:function(){this.opts.selectOnBlur&&this.selectHighlighted({noFocus:!0}),this.close(),this.container.removeClass("select2-container-active"),this.search[0]===document.activeElement&&this.search.blur(),this.clearSearch(),this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus")},focusSearch:function(){var i;(i=this.search)[0]!==document.activeElement&&window.setTimeout(function(){var e,t=i[0],s=i.val().length;i.focus(),(0<t.offsetWidth||0<t.offsetHeight)&&t===document.activeElement&&(t.setSelectionRange?t.setSelectionRange(s,s):t.createTextRange&&((e=t.createTextRange()).collapse(!1),e.select()))},0)},selectHighlighted:function(e){if(this._touchMoved)this.clearTouchMoved();else{var t=this.highlight(),s=this.results.find(".select2-highlighted").closest(".select2-result").data("select2-data");s?(this.highlight(t),this.onSelect(s,e)):e&&e.noFocus&&this.close()}},getPlaceholder:function(){var e;return this.opts.element.attr("placeholder")||this.opts.element.attr("data-placeholder")||this.opts.element.data("placeholder")||this.opts.placeholder||((e=this.getPlaceholderOption())!==S?e.text():S)},getPlaceholderOption:function(){if(this.select){var e=this.select.children("option").first();if(this.opts.placeholderOption!==S)return"first"===this.opts.placeholderOption&&e||"function"==typeof this.opts.placeholderOption&&this.opts.placeholderOption(this.select);if(""===C.trim(e.text())&&""===e.val())return e}},initContainerWidth:function(){var e=function(){var e,t,s,i,n;if("off"===this.opts.width)return null;if("element"===this.opts.width)return 0===this.opts.element.outerWidth(!1)?"auto":this.opts.element.outerWidth(!1)+"px";if("copy"===this.opts.width||"resolve"===this.opts.width){if("string"==typeof(e=this.opts.element.attr("style")))for(i=0,n=(t=e.split(";")).length;i<n;i+=1)if(null!==(s=t[i].replace(/\s/g,"").match(/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i))&&1<=s.length)return s[1];return"resolve"===this.opts.width?0<(e=this.opts.element.css("width")).indexOf("%")?e:0===this.opts.element.outerWidth(!1)?"auto":this.opts.element.outerWidth(!1)+"px":null}return C.isFunction(this.opts.width)?this.opts.width():this.opts.width}.call(this);null!==e&&this.container.css("width",e)}}),{createContainer:function(){return C(document.createElement("div")).attr({class:"select2-container"}).html(["<a href='javascript:void(0)' class='select2-choice' tabindex='-1'>"," <span class='select2-chosen'> </span><abbr class='select2-search-choice-close'></abbr>"," <span class='select2-arrow' role='presentation'><b role='presentation'></b></span>","</a>","<label for='' class='select2-offscreen'></label>","<input class='select2-focusser select2-offscreen' type='text' aria-haspopup='true' role='button' />","<div class='select2-drop select2-display-none'>"," <div class='select2-search'>"," <label for='' class='select2-offscreen'></label>"," <input type='text' autocomplete='none' autocorrect='off' autocapitalize='off' spellcheck='false' class='select2-input' role='combobox' aria-expanded='true'"," aria-autocomplete='list' />"," </div>"," <ul class='select2-results' role='listbox'>"," </ul>","</div>"].join(""))},enableInterface:function(){this.parent.enableInterface.apply(this,arguments)&&this.focusser.prop("disabled",!this.isInterfaceEnabled())},opening:function(){var e,t,s;0<=this.opts.minimumResultsForSearch&&this.showSearch(!0),this.parent.opening.apply(this,arguments),!1!==this.showSearchInput&&this.search.val(this.focusser.val()),this.opts.shouldFocusInput(this)&&(this.search.focus(),(e=this.search.get(0)).createTextRange?((t=e.createTextRange()).collapse(!1),t.select()):e.setSelectionRange&&(s=this.search.val().length,e.setSelectionRange(s,s))),this.prefillNextSearchTerm(),this.focusser.prop("disabled",!0).val(""),this.updateResults(!0),this.opts.element.trigger(C.Event("select2-open"))},close:function(){this.opened()&&(this.parent.close.apply(this,arguments),this.focusser.prop("disabled",!1),this.opts.shouldFocusInput(this)&&this.focusser.focus())},focus:function(){this.opened()?this.close():(this.focusser.prop("disabled",!1),this.opts.shouldFocusInput(this)&&this.focusser.focus())},isFocused:function(){return this.container.hasClass("select2-container-active")},cancel:function(){this.parent.cancel.apply(this,arguments),this.focusser.prop("disabled",!1),this.opts.shouldFocusInput(this)&&this.focusser.focus()},destroy:function(){C("label[for='"+this.focusser.attr("id")+"']").attr("for",this.opts.element.attr("id")),this.parent.destroy.apply(this,arguments),A.call(this,"selection","focusser")},initContainer:function(){var t,e,s=this.container,i=this.dropdown,n=y();this.opts.minimumResultsForSearch<0?this.showSearch(!1):this.showSearch(!0),this.selection=t=s.find(".select2-choice"),this.focusser=s.find(".select2-focusser"),t.find(".select2-chosen").attr("id","select2-chosen-"+n),this.focusser.attr("aria-labelledby","select2-chosen-"+n),this.results.attr("id","select2-results-"+n),this.search.attr("aria-owns","select2-results-"+n),this.focusser.attr("id","s2id_autogen"+n),e=C("label[for='"+this.opts.element.attr("id")+"']"),this.opts.element.on("focus.select2",this.bind(function(){this.focus()})),this.focusser.prev().text(e.text()).attr("for",this.focusser.attr("id"));var o=this.opts.element.attr("title");this.opts.element.attr("title",o||e.text()),this.focusser.attr("tabindex",this.elementTabIndex),this.search.attr("id",this.focusser.attr("id")+"_search"),this.search.prev().text(C("label[for='"+this.focusser.attr("id")+"']").text()).attr("for",this.search.attr("id")),this.search.on("keydown",this.bind(function(e){if(this.isInterfaceEnabled()&&229!=e.keyCode)if(e.which!==l.PAGE_UP&&e.which!==l.PAGE_DOWN)switch(e.which){case l.UP:case l.DOWN:return this.moveHighlight(e.which===l.UP?-1:1),void b(e);case l.ENTER:return this.selectHighlighted(),void b(e);case l.TAB:return void this.selectHighlighted({noFocus:!0});case l.ESC:return this.cancel(e),void b(e)}else b(e)})),this.search.on("blur",this.bind(function(e){document.activeElement===this.body.get(0)&&window.setTimeout(this.bind(function(){this.opened()&&this.results&&1<this.results.length&&this.search.focus()}),0)})),this.focusser.on("keydown",this.bind(function(e){if(this.isInterfaceEnabled()&&e.which!==l.TAB&&!l.isControl(e)&&!l.isFunctionKey(e)&&e.which!==l.ESC){if(!1!==this.opts.openOnEnter||e.which!==l.ENTER){if(e.which==l.DOWN||e.which==l.UP||e.which==l.ENTER&&this.opts.openOnEnter){if(e.altKey||e.ctrlKey||e.shiftKey||e.metaKey)return;return this.open(),void b(e)}return e.which==l.DELETE||e.which==l.BACKSPACE?(this.opts.allowClear&&this.clear(),void b(e)):void 0}b(e)}})),m(this.focusser),this.focusser.on("keyup-change input",this.bind(function(e){if(0<=this.opts.minimumResultsForSearch){if(e.stopPropagation(),this.opened())return;this.open()}})),t.on("mousedown touchstart","abbr",this.bind(function(e){var t;this.isInterfaceEnabled()&&(this.clear(),(t=e).preventDefault(),t.stopImmediatePropagation(),this.close(),this.selection&&this.selection.focus())})),t.on("mousedown touchstart",this.bind(function(e){r(t),this.container.hasClass("select2-container-active")||this.opts.element.trigger(C.Event("select2-focus")),this.opened()?this.close():this.isInterfaceEnabled()&&this.open(),b(e)})),i.on("mousedown touchstart",this.bind(function(){this.opts.shouldFocusInput(this)&&this.search.focus()})),t.on("focus",this.bind(function(e){b(e)})),this.focusser.on("focus",this.bind(function(){this.container.hasClass("select2-container-active")||this.opts.element.trigger(C.Event("select2-focus")),this.container.addClass("select2-container-active")})).on("blur",this.bind(function(){this.opened()||(this.container.removeClass("select2-container-active"),this.opts.element.trigger(C.Event("select2-blur")))})),this.search.on("focus",this.bind(function(){this.container.hasClass("select2-container-active")||this.opts.element.trigger(C.Event("select2-focus")),this.container.addClass("select2-container-active")})),this.initContainerWidth(),this.opts.element.hide(),this.setPlaceholder()},clear:function(e){var t=this.selection.data("select2-data");if(t){var s=C.Event("select2-clearing");if(this.opts.element.trigger(s),s.isDefaultPrevented())return;var i=this.getPlaceholderOption();this.opts.element.val(i?i.val():""),this.selection.find(".select2-chosen").empty(),this.selection.removeData("select2-data"),this.setPlaceholder(),!1!==e&&(this.opts.element.trigger({type:"select2-removed",val:this.id(t),choice:t}),this.triggerChange({removed:t}))}},initSelection:function(){if(this.isPlaceholderOptionSelected())this.updateSelection(null),this.close(),this.setPlaceholder();else{var t=this;this.opts.initSelection.call(null,this.opts.element,function(e){e!==S&&null!==e&&(t.updateSelection(e),t.close(),t.setPlaceholder(),t.lastSearchTerm=t.search.val())})}},isPlaceholderOptionSelected:function(){var e;return this.getPlaceholder()!==S&&((e=this.getPlaceholderOption())!==S&&e.prop("selected")||""===this.opts.element.val()||this.opts.element.val()===S||null===this.opts.element.val())},prepareOpts:function(){var a=this.parent.prepareOpts.apply(this,arguments),i=this;return"select"===a.element.get(0).tagName.toLowerCase()?a.initSelection=function(e,t){var s=e.find("option").filter(function(){return this.selected&&!this.disabled});t(i.optionToData(s))}:"data"in a&&(a.initSelection=a.initSelection||function(e,t){var n=e.val(),o=null;a.query({matcher:function(e,t,s){var i=p(n,a.id(s));return i&&(o=s),i},callback:C.isFunction(t)?function(){t(o)}:C.noop})}),a},getPlaceholder:function(){return this.select&&this.getPlaceholderOption()===S?S:this.parent.getPlaceholder.apply(this,arguments)},setPlaceholder:function(){var e=this.getPlaceholder();if(this.isPlaceholderOptionSelected()&&e!==S){if(this.select&&this.getPlaceholderOption()===S)return;this.selection.find(".select2-chosen").html(this.opts.escapeMarkup(e)),this.selection.addClass("select2-default"),this.container.removeClass("select2-allowclear")}},postprocessResults:function(e,t,s){var i=0,n=this;if(this.findHighlightableChoices().each2(function(e,t){if(p(n.id(t.data("select2-data")),n.opts.element.val()))return i=e,!1}),!1!==s&&(!0===t&&0<=i?this.highlight(i):this.highlight(0)),!0===t){var o=this.opts.minimumResultsForSearch;0<=o&&this.showSearch(function s(e){var i=0;return C.each(e,function(e,t){t.children?i+=s(t.children):i++}),i}(e.results)>=o)}},showSearch:function(e){this.showSearchInput!==e&&(this.showSearchInput=e,this.dropdown.find(".select2-search").toggleClass("select2-search-hidden",!e),this.dropdown.find(".select2-search").toggleClass("select2-offscreen",!e),C(this.dropdown,this.container).toggleClass("select2-with-searchbox",e))},onSelect:function(e,t){if(this.triggerSelect(e)){var s=this.opts.element.val(),i=this.data();this.opts.element.val(this.id(e)),this.updateSelection(e),this.opts.element.trigger({type:"select2-selected",val:this.id(e),choice:e}),this.lastSearchTerm=this.search.val(),this.close(),t&&t.noFocus||!this.opts.shouldFocusInput(this)||this.focusser.focus(),p(s,this.id(e))||this.triggerChange({added:e,removed:i})}},updateSelection:function(e){var t,s,i=this.selection.find(".select2-chosen");this.selection.data("select2-data",e),i.empty(),null!==e&&(t=this.opts.formatSelection(e,i,this.opts.escapeMarkup)),t!==S&&i.append(t),(s=this.opts.formatSelectionCssClass(e,i))!==S&&i.addClass(s),this.selection.removeClass("select2-default"),this.opts.allowClear&&this.getPlaceholder()!==S&&this.container.addClass("select2-allowclear")},val:function(){var e,t=!1,s=null,i=this,n=this.data();if(0===arguments.length)return this.opts.element.val();if(e=arguments[0],1<arguments.length&&(t=arguments[1],this.opts.debug&&console&&console.warn&&console.warn('Select2: The second option to `select2("val")` is not supported in Select2 4.0.0. The `change` event will always be triggered in 4.0.0.')),this.select)this.opts.debug&&console&&console.warn&&console.warn('Select2: Setting the value on a <select> using `select2("val")` is no longer supported in 4.0.0. You can use the `.val(newValue).trigger("change")` method provided by jQuery instead.'),this.select.val(e).find("option").filter(function(){return this.selected}).each2(function(e,t){return s=i.optionToData(t),!1}),this.updateSelection(s),this.setPlaceholder(),t&&this.triggerChange({added:s,removed:n});else{if(!e&&0!==e)return void this.clear(t);if(this.opts.initSelection===S)throw new Error("cannot call val() if initSelection() is not defined");this.opts.element.val(e),this.opts.initSelection(this.opts.element,function(e){i.opts.element.val(e?i.id(e):""),i.updateSelection(e),i.setPlaceholder(),t&&i.triggerChange({added:e,removed:n})})}},clearSearch:function(){this.search.val(""),this.focusser.val("")},data:function(e){var t,s=!1;if(0===arguments.length)return(t=this.selection.data("select2-data"))==S&&(t=null),t;this.opts.debug&&console&&console.warn&&console.warn('Select2: The `select2("data")` method can no longer set selected values in 4.0.0, consider using the `.val()` method instead.'),1<arguments.length&&(s=arguments[1]),e?(t=this.data(),this.opts.element.val(e?this.id(e):""),this.updateSelection(e),s&&this.triggerChange({added:e,removed:t})):this.clear(s)}}),s=D(e,{createContainer:function(){return C(document.createElement("div")).attr({class:"select2-container select2-container-multi"}).html(["<ul class='select2-choices'>"," <li class='select2-search-field'>"," <label for='' class='select2-offscreen'></label>"," <input type='text' autocomplete='none' autocorrect='off' autocapitalize='off' spellcheck='false' class='select2-input'>"," </li>","</ul>","<div class='select2-drop select2-drop-multi select2-display-none'>"," <ul class='select2-results'>"," </ul>","</div>"].join(""))},prepareOpts:function(){var r=this.parent.prepareOpts.apply(this,arguments),i=this;return"select"===r.element.get(0).tagName.toLowerCase()?r.initSelection=function(e,t){var s=[];e.find("option").filter(function(){return this.selected&&!this.disabled}).each2(function(e,t){s.push(i.optionToData(t))}),t(s)}:"data"in r&&(r.initSelection=r.initSelection||function(e,o){var a=f(e.val(),r.separator,r.transformVal),l=[];r.query({matcher:function(e,t,s){var i=C.grep(a,function(e){return p(e,r.id(s))}).length;return i&&l.push(s),i},callback:C.isFunction(o)?function(){for(var e=[],t=0;t<a.length;t++)for(var s=a[t],i=0;i<l.length;i++){var n=l[i];if(p(s,r.id(n))){e.push(n),l.splice(i,1);break}}o(e)}:C.noop})}),r},selectChoice:function(e){var t=this.container.find(".select2-search-choice-focus");t.length&&e&&e[0]==t[0]||(t.length&&this.opts.element.trigger("choice-deselected",t),t.removeClass("select2-search-choice-focus"),e&&e.length&&(this.close(),e.addClass("select2-search-choice-focus"),this.opts.element.trigger("choice-selected",e)))},destroy:function(){C("label[for='"+this.search.attr("id")+"']").attr("for",this.opts.element.attr("id")),this.parent.destroy.apply(this,arguments),A.call(this,"searchContainer","selection")},initContainer:function(){var a,e=".select2-choices";this.searchContainer=this.container.find(".select2-search-field"),this.selection=a=this.container.find(e);var t=this;this.selection.on("click",".select2-container:not(.select2-container-disabled) .select2-search-choice:not(.select2-locked)",function(e){t.search[0].focus(),t.selectChoice(C(this))}),this.search.attr("id","s2id_autogen"+y()),this.search.prev().text(C("label[for='"+this.opts.element.attr("id")+"']").text()).attr("for",this.search.attr("id")),this.opts.element.on("focus.select2",this.bind(function(){this.focus()})),this.search.on("input paste",this.bind(function(){this.search.attr("placeholder")&&0==this.search.val().length||this.isInterfaceEnabled()&&(this.opened()||this.open())})),this.search.attr("tabindex",this.elementTabIndex),this.keydowns=0,this.search.on("keydown",this.bind(function(e){if(this.isInterfaceEnabled()){++this.keydowns;var t=a.find(".select2-search-choice-focus"),s=t.prev(".select2-search-choice:not(.select2-locked)"),i=t.next(".select2-search-choice:not(.select2-locked)"),n=function(e){var t=0,s=0;if("selectionStart"in(e=C(e)[0]))t=e.selectionStart,s=e.selectionEnd-t;else if("selection"in document){e.focus();var i=document.selection.createRange();s=document.selection.createRange().text.length,i.moveStart("character",-e.value.length),t=i.text.length-s}return{offset:t,length:s}}(this.search);if(t.length&&(e.which==l.LEFT||e.which==l.RIGHT||e.which==l.BACKSPACE||e.which==l.DELETE||e.which==l.ENTER)){var o=t;return e.which==l.LEFT&&s.length?o=s:e.which==l.RIGHT?o=i.length?i:null:e.which===l.BACKSPACE?this.unselect(t.first())&&(this.search.width(10),o=s.length?s:i):e.which==l.DELETE?this.unselect(t.first())&&(this.search.width(10),o=i.length?i:null):e.which==l.ENTER&&(o=null),this.selectChoice(o),b(e),void(o&&o.length||this.open())}if((e.which===l.BACKSPACE&&1==this.keydowns||e.which==l.LEFT)&&0==n.offset&&!n.length)return this.selectChoice(a.find(".select2-search-choice:not(.select2-locked)").last()),void b(e);if(this.selectChoice(null),this.opened())switch(e.which){case l.UP:case l.DOWN:return this.moveHighlight(e.which===l.UP?-1:1),void b(e);case l.ENTER:return this.selectHighlighted(),void b(e);case l.TAB:return this.selectHighlighted({noFocus:!0}),void this.close();case l.ESC:return this.cancel(e),void b(e)}if(e.which!==l.TAB&&!l.isControl(e)&&!l.isFunctionKey(e)&&e.which!==l.BACKSPACE&&e.which!==l.ESC){if(e.which===l.ENTER){if(!1===this.opts.openOnEnter)return;if(e.altKey||e.ctrlKey||e.shiftKey||e.metaKey)return}this.open(),e.which!==l.PAGE_UP&&e.which!==l.PAGE_DOWN||b(e),e.which===l.ENTER&&b(e)}}})),this.search.on("keyup",this.bind(function(e){this.keydowns=0,this.resizeSearch()})),this.search.on("blur",this.bind(function(e){this.container.removeClass("select2-container-active"),this.search.removeClass("select2-focused"),this.selectChoice(null),this.opened()||this.clearSearch(),e.stopImmediatePropagation(),this.opts.element.trigger(C.Event("select2-blur"))})),this.container.on("click",e,this.bind(function(e){this.isInterfaceEnabled()&&(0<C(e.target).closest(".select2-search-choice").length||(this.selectChoice(null),this.clearPlaceholder(),this.container.hasClass("select2-container-active")||this.opts.element.trigger(C.Event("select2-focus")),this.open(),this.focusSearch(),e.preventDefault()))})),this.container.on("focus",e,this.bind(function(){this.isInterfaceEnabled()&&(this.container.hasClass("select2-container-active")||this.opts.element.trigger(C.Event("select2-focus")),this.container.addClass("select2-container-active"),this.dropdown.addClass("select2-drop-active"),this.clearPlaceholder())})),this.initContainerWidth(),this.opts.element.hide(),this.clearSearch()},enableInterface:function(){this.parent.enableInterface.apply(this,arguments)&&this.search.prop("disabled",!this.isInterfaceEnabled())},initSelection:function(){if(""===this.opts.element.val()&&""===this.opts.element.text()&&(this.updateSelection([]),this.close(),this.clearSearch()),this.select||""!==this.opts.element.val()){var t=this;this.opts.initSelection.call(null,this.opts.element,function(e){e!==S&&null!==e&&(t.updateSelection(e),t.close(),t.clearSearch())})}},clearSearch:function(){var e=this.getPlaceholder(),t=this.getMaxSearchWidth();e!==S&&0===this.getVal().length&&!1===this.search.hasClass("select2-focused")?(this.search.val(e).addClass("select2-default"),this.search.width(0<t?t:this.container.css("width"))):this.search.val("").width(10)},clearPlaceholder:function(){this.search.hasClass("select2-default")&&this.search.val("").removeClass("select2-default")},opening:function(){this.clearPlaceholder(),this.resizeSearch(),this.parent.opening.apply(this,arguments),this.focusSearch(),this.prefillNextSearchTerm(),this.updateResults(!0),this.opts.shouldFocusInput(this)&&this.search.focus(),this.opts.element.trigger(C.Event("select2-open"))},close:function(){this.opened()&&this.parent.close.apply(this,arguments)},focus:function(){this.close(),this.search.focus()},isFocused:function(){return this.search.hasClass("select2-focused")},updateSelection:function(e){var t={},s=[],i=this;C(e).each(function(){i.id(this)in t||(t[i.id(this)]=0,s.push(this))}),this.selection.find(".select2-search-choice").remove(),this.addSelectedChoice(s),i.postprocessResults()},tokenize:function(){var e=this.search.val();null!=(e=this.opts.tokenizer.call(this,e,this.data(),this.bind(this.onSelect),this.opts))&&e!=S&&(this.search.val(e),0<e.length&&this.open())},onSelect:function(e,t){this.triggerSelect(e)&&""!==e.text&&(this.addSelectedChoice(e),this.opts.element.trigger({type:"selected",val:this.id(e),choice:e}),this.lastSearchTerm=this.search.val(),this.clearSearch(),this.updateResults(),!this.select&&this.opts.closeOnSelect||this.postprocessResults(e,!1,!0===this.opts.closeOnSelect),this.opts.closeOnSelect?(this.close(),this.search.width(10)):0<this.countSelectableResults()?(this.search.width(10),this.resizeSearch(),0<this.getMaximumSelectionSize()&&this.val().length>=this.getMaximumSelectionSize()?this.updateResults(!0):this.prefillNextSearchTerm()&&this.updateResults(),this.positionDropdown()):(this.close(),this.search.width(10)),this.triggerChange({added:e}),t&&t.noFocus||this.focusSearch())},cancel:function(){this.close(),this.focusSearch()},addSelectedChoice:function(e){var t=this.getVal(),s=this;C(e).each(function(){t.push(s.createChoice(this))}),this.setVal(t)},createChoice:function(e){var t,s,i=!e.locked,n=C("<li class='select2-search-choice'> <div></div> <a href='#' class='select2-search-choice-close' tabindex='-1'></a></li>"),o=C("<li class='select2-search-choice select2-locked'><div></div></li>"),a=i?n:o,l=this.id(e);return(t=this.opts.formatSelection(e,a.find("div"),this.opts.escapeMarkup))!=S&&a.find("div").replaceWith(C("<div></div>").html(t)),(s=this.opts.formatSelectionCssClass(e,a.find("div")))!=S&&a.addClass(s),i&&a.find(".select2-search-choice-close").on("mousedown",b).on("click dblclick",this.bind(function(e){this.isInterfaceEnabled()&&(this.unselect(C(e.target)),this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus"),b(e),this.close(),this.focusSearch())})).on("focus",this.bind(function(){this.isInterfaceEnabled()&&(this.container.addClass("select2-container-active"),this.dropdown.addClass("select2-drop-active"))})),a.data("select2-data",e),a.insertBefore(this.searchContainer),l},unselect:function(e){var t,s,i=this.getVal();if(0===(e=e.closest(".select2-search-choice")).length)throw"Invalid argument: "+e+". Must be .select2-search-choice";if(t=e.data("select2-data")){var n=C.Event("select2-removing");if(n.val=this.id(t),n.choice=t,this.opts.element.trigger(n),n.isDefaultPrevented())return!1;for(;0<=(s=d(this.id(t),i));)i.splice(s,1),this.setVal(i),this.select&&this.postprocessResults();return e.remove(),this.opts.element.trigger({type:"select2-removed",val:this.id(t),choice:t}),this.triggerChange({removed:t}),!0}},postprocessResults:function(e,t,s){var i=this.getVal(),n=this.results.find(".select2-result"),o=this.results.find(".select2-result-with-children"),a=this;n.each2(function(e,t){0<=d(a.id(t.data("select2-data")),i)&&(t.addClass("select2-selected"),t.find(".select2-result-selectable").addClass("select2-selected"))}),o.each2(function(e,t){t.is(".select2-result-selectable")||0!==t.find(".select2-result-selectable:not(.select2-selected)").length||t.addClass("select2-selected")}),-1==this.highlight()&&!1!==s&&!0===this.opts.closeOnSelect&&a.highlight(0),!this.opts.createSearchChoice&&0<!n.filter(".select2-result:not(.select2-selected)").length&&(!e||e&&!e.more&&0===this.results.find(".select2-no-results").length)&&k(a.opts.formatNoMatches,"formatNoMatches")&&this.results.append("<li class='select2-no-results'>"+R(a.opts.formatNoMatches,a.opts.element,a.search.val())+"</li>")},getMaxSearchWidth:function(){return this.selection.width()-g(this.search)},resizeSearch:function(){var e,t,s,i,n=g(this.search);e=function(e){if(!o){var t=e[0].currentStyle||window.getComputedStyle(e[0],null);(o=C(document.createElement("div")).css({position:"absolute",left:"-10000px",top:"-10000px",display:"none",fontSize:t.fontSize,fontFamily:t.fontFamily,fontStyle:t.fontStyle,fontWeight:t.fontWeight,letterSpacing:t.letterSpacing,textTransform:t.textTransform,whiteSpace:"nowrap"})).attr("class","select2-sizer"),C(document.body).append(o)}return o.text(e.val()),o.width()}(this.search)+10,t=this.search.offset().left,(i=(s=this.selection.width())-(t-this.selection.offset().left)-n)<e&&(i=s-n),i<40&&(i=s-n),i<=0&&(i=e),this.search.width(Math.floor(i))},getVal:function(){var e;return this.select?null===(e=this.select.val())?[]:e:f(e=this.opts.element.val(),this.opts.separator,this.opts.transformVal)},setVal:function(e){if(this.select)this.select.val(e);else{var t=[],s={};C(e).each(function(){this in s||(t.push(this),s[this]=0)}),this.opts.element.val(0===t.length?"":t.join(this.opts.separator))}},buildChangeDetails:function(e,t){t=t.slice(0),e=e.slice(0);for(var s=0;s<t.length;s++)for(var i=0;i<e.length;i++)if(p(this.opts.id(t[s]),this.opts.id(e[i]))){t.splice(s,1),s--,e.splice(i,1);break}return{added:t,removed:e}},val:function(e,s){var i,n=this;if(0===arguments.length)return this.getVal();if((i=this.data()).length||(i=[]),!e&&0!==e)return this.opts.element.val(""),this.updateSelection([]),this.clearSearch(),void(s&&this.triggerChange({added:this.data(),removed:i}));if(this.setVal(e),this.select)this.opts.initSelection(this.select,this.bind(this.updateSelection)),s&&this.triggerChange(this.buildChangeDetails(i,this.data()));else{if(this.opts.initSelection===S)throw new Error("val() cannot be called if initSelection() is not defined");this.opts.initSelection(this.opts.element,function(e){var t=C.map(e,n.id);n.setVal(t),n.updateSelection(e),n.clearSearch(),s&&n.triggerChange(n.buildChangeDetails(i,n.data()))})}this.clearSearch()},onSortStart:function(){if(this.select)throw new Error("Sorting of elements is not supported when attached to <select>. Attach to <input type='hidden'/> instead.");this.search.width(0),this.searchContainer.hide()},onSortEnd:function(){var e=[],t=this;this.searchContainer.show(),this.searchContainer.appendTo(this.searchContainer.parent()),this.resizeSearch(),this.selection.find(".select2-search-choice").each(function(){e.push(t.opts.id(C(this).data("select2-data")))}),this.setVal(e),this.triggerChange()},data:function(e,t){var s,i,n=this;if(0===arguments.length)return this.selection.children(".select2-search-choice").map(function(){return C(this).data("select2-data")}).get();i=this.data(),e||(e=[]),s=C.map(e,function(e){return n.opts.id(e)}),this.setVal(s),this.updateSelection(e),this.clearSearch(),t&&this.triggerChange(this.buildChangeDetails(i,this.data()))}}),C.fn.select2=function(){var e,t,s,i,n,o=Array.prototype.slice.call(arguments,0),a=["val","destroy","opened","open","close","focus","isFocused","container","dropdown","onSortStart","onSortEnd","enable","disable","readonly","positionDropdown","data","search"],l=["opened","isFocused","container","dropdown"],r=["val","data"],c={search:"externalSearch"};return this.each(function(){if(0===o.length||"object"==typeof o[0])(e=0===o.length?{}:C.extend({},o[0])).element=C(this),"select"===e.element.get(0).tagName.toLowerCase()?n=e.element.prop("multiple"):(n=e.multiple||!1,"tags"in e&&(e.multiple=n=!0)),(t=n?new window.Select2.class.multi:new window.Select2.class.single).init(e);else{if("string"!=typeof o[0])throw"Invalid arguments to select2 plugin: "+o;if(d(o[0],a)<0)throw"Unknown method: "+o[0];if(i=S,(t=C(this).data("select2"))===S)return;if("container"===(s=o[0])?i=t.container:"dropdown"===s?i=t.dropdown:(c[s]&&(s=c[s]),i=t[s].apply(t,o.slice(1))),0<=d(o[0],l)||0<=d(o[0],r)&&1==o.length)return!1}}),i===S?this:i},C.fn.select2.defaults={debug:!1,width:"copy",loadMorePadding:0,closeOnSelect:!0,openOnEnter:!0,containerCss:{},dropdownCss:{},containerCssClass:"",dropdownCssClass:"",formatResult:function(e,t,s,i){var n=[];return E(this.text(e),s.term,n,i),n.join("")},transformVal:function(e){return C.trim(e)},formatSelection:function(e,t,s){return e?s(this.text(e)):S},sortResults:function(e,t,s){return e},formatResultCssClass:function(e){return e.css},formatSelectionCssClass:function(e,t){return S},minimumResultsForSearch:0,minimumInputLength:0,maximumInputLength:null,maximumSelectionSize:0,id:function(e){return e==S?null:e.id},text:function(e){return e&&this.data&&this.data.text?C.isFunction(this.data.text)?this.data.text(e):e[this.data.text]:e.text},matcher:function(e,t){return 0<=u(""+t).toUpperCase().indexOf(u(""+e).toUpperCase())},separator:",",tokenSeparators:[],tokenizer:function(e,t,s,i){var n,o,a,l,r,c=e,h=!1;if(!i.createSearchChoice||!i.tokenSeparators||i.tokenSeparators.length<1)return S;for(;;){for(o=-1,a=0,l=i.tokenSeparators.length;a<l&&(r=i.tokenSeparators[a],!(0<=(o=e.indexOf(r))));a++);if(o<0)break;if(n=e.substring(0,o),e=e.substring(o+r.length),0<n.length&&(n=i.createSearchChoice.call(this,n,t))!==S&&null!==n&&i.id(n)!==S&&null!==i.id(n)){for(h=!1,a=0,l=t.length;a<l;a++)if(p(i.id(n),i.id(t[a]))){h=!0;break}h||s(n)}}return c!==e?e:void 0},escapeMarkup:T,blurOnChange:!1,selectOnBlur:!1,adaptContainerCssClass:function(e){return e},adaptDropdownCssClass:function(e){return null},nextSearchTerm:function(e,t){return S},searchInputPlaceholder:"",createSearchChoicePosition:"top",shouldFocusInput:function(e){return!("ontouchstart"in window||0<navigator.msMaxTouchPoints)||!(e.opts.minimumResultsForSearch<0)}},C.fn.select2.locales=[],C.fn.select2.locales.en={formatMatches:function(e){return 1===e?"One result is available, press enter to select it.":e+" results are available, use up and down arrow keys to navigate."},formatNoMatches:function(){return"No matches found"},formatAjaxError:function(e,t,s){return"Loading failed"},formatInputTooShort:function(e,t){var s=t-e.length;return"Please enter "+s+" or more character"+(1==s?"":"s")},formatInputTooLong:function(e,t){var s=e.length-t;return"Please delete "+s+" character"+(1==s?"":"s")},formatSelectionTooBig:function(e){return"You can only select "+e+" item"+(1==e?"":"s")},formatLoadMore:function(e){return"Loading more results…"},formatSearching:function(){return"Searching…"}},C.extend(C.fn.select2.defaults,C.fn.select2.locales.en),C.fn.select2.ajaxDefaults={transport:C.ajax,params:{type:"GET",cache:!1,dataType:"json"}},window.Select2={query:{ajax:O,local:I,tags:P},util:{debounce:v,markMatch:E,escapeMarkup:T,stripDiacritics:u},class:{abstract:e,single:t,multi:s}}}function r(e){var t=C(document.createTextNode(""));e.before(t),t.before(e),t.remove()}function u(e){return e.replace(/[^\u0000-\u007E]/g,function(e){return a[e]||e})}function d(e,t){for(var s=0,i=t.length;s<i;s+=1)if(p(e,t[s]))return s;return-1}function p(e,t){return e===t||e!==S&&t!==S&&(null!==e&&null!==t&&(e.constructor===String?e+""==t+"":t.constructor===String&&t+""==e+""))}function f(e,t,s){var i,n,o;if(null===e||e.length<1)return[];for(n=0,o=(i=e.split(t)).length;n<o;n+=1)i[n]=s(i[n]);return i}function g(e){return e.outerWidth(!1)-e.width()}function m(t){var s="keyup-change-value";t.on("keydown",function(){C.data(t,s)===S&&C.data(t,s,t.val())}),t.on("keyup",function(){var e=C.data(t,s);e!==S&&t.val()!==e&&(C.removeData(t,s),t.trigger("keyup-change"))})}function v(t,s,i){var n;return i=i||S,function(){var e=arguments;window.clearTimeout(n),n=window.setTimeout(function(){s.apply(i,e)},t)}}function b(e){e.preventDefault(),e.stopPropagation()}function w(e,t,s){var i,n,o=[];(i=C.trim(e.attr("class")))&&C((i=""+i).split(/\s+/)).each2(function(){0===this.indexOf("select2-")&&o.push(this)}),(i=C.trim(t.attr("class")))&&C((i=""+i).split(/\s+/)).each2(function(){0!==this.indexOf("select2-")&&(n=s(this))&&o.push(n)}),e.attr("class",o.join(" "))}function E(e,t,s,i){var n=u(e.toUpperCase()).indexOf(u(t.toUpperCase())),o=t.length;n<0?s.push(i(e)):(s.push(i(e.substring(0,n))),s.push("<span class='select2-match'>"),s.push(i(e.substring(n,n+o))),s.push("</span>"),s.push(i(e.substring(n+o,e.length))))}function T(e){var t={"\\":"\","&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};return String(e).replace(/[&<>"'\/\\]/g,function(e){return t[e]})}function O(a){var e,l=null,t=a.quietMillis||100,r=a.url,c=this;return function(o){window.clearTimeout(e),e=window.setTimeout(function(){var e=a.data,t=r,s=a.transport||C.fn.select2.ajaxDefaults.transport,i={type:a.type||"GET",cache:a.cache||!1,jsonpCallback:a.jsonpCallback||S,dataType:a.dataType||"json"},n=C.extend({},C.fn.select2.ajaxDefaults.params,i);e=e?e.call(c,o.term,o.page,o.context):null,t="function"==typeof t?t.call(c,o.term,o.page,o.context):t,l&&"function"==typeof l.abort&&l.abort(),a.params&&(C.isFunction(a.params)?C.extend(n,a.params.call(c)):C.extend(n,a.params)),C.extend(n,{url:t,dataType:a.dataType,data:e,success:function(e){var t=a.results(e,o.page,o);o.callback(t)},error:function(e,t,s){var i={hasError:!0,jqXHR:e,textStatus:t,errorThrown:s};o.callback(i)}}),l=s.call(c,n)},t)}}function I(e){var t,s,i=e,l=function(e){return""+e.text};C.isArray(i)&&(i={results:s=i}),!1===C.isFunction(i)&&(s=i,i=function(){return s});var n=i();return n.text&&(l=n.text,C.isFunction(l)||(t=n.text,l=function(e){return e[t]})),function(n){var o,a=n.term,s={results:[]};""!==a?(o=function(e,t){var s,i;if((e=e[0]).children){for(i in s={},e)e.hasOwnProperty(i)&&(s[i]=e[i]);s.children=[],C(e.children).each2(function(e,t){o(t,s.children)}),(s.children.length||n.matcher(a,l(s),e))&&t.push(s)}else n.matcher(a,l(e),e)&&t.push(e)},C(i().results).each2(function(e,t){o(t,s.results)}),n.callback(s)):n.callback(i())}}function P(t){var o=C.isFunction(t);return function(s){var i=s.term,n={results:[]},e=o?t(s):t;C.isArray(e)&&(C(e).each(function(){var e=this.text!==S,t=e?this.text:this;(""===i||s.matcher(i,t))&&n.results.push(e?this:{id:this,text:this})}),s.callback(n))}}function k(e,t){if(C.isFunction(e))return!0;if(!e)return!1;if("string"==typeof e)return!0;throw new Error(t+" must be a string, function, or falsy value")}function R(e,t){if(C.isFunction(e)){var s=Array.prototype.slice.call(arguments,2);return e.apply(t,s)}return e}function A(){var s=this;C.each(arguments,function(e,t){s[t].remove(),s[t]=null})}function D(e,t){var s=function(){};return((s.prototype=new e).constructor=s).prototype.parent=e.prototype,s.prototype=C.extend(s.prototype,t),s}}(jQuery);