(function(a){if(typeof a.fn.each2=="undefined"){a.extend(a.fn,{each2:function(f){var d=a([0]),e=-1,b=this.length;while(++e=112&&O<=123}},B="
",d={"\u24B6":"A","\uFF21":"A","\u00C0":"A","\u00C1":"A","\u00C2":"A","\u1EA6":"A","\u1EA4":"A","\u1EAA":"A","\u1EA8":"A","\u00C3":"A","\u0100":"A","\u0102":"A","\u1EB0":"A","\u1EAE":"A","\u1EB4":"A","\u1EB2":"A","\u0226":"A","\u01E0":"A","\u00C4":"A","\u01DE":"A","\u1EA2":"A","\u00C5":"A","\u01FA":"A","\u01CD":"A","\u0200":"A","\u0202":"A","\u1EA0":"A","\u1EAC":"A","\u1EB6":"A","\u1E00":"A","\u0104":"A","\u023A":"A","\u2C6F":"A","\uA732":"AA","\u00C6":"AE","\u01FC":"AE","\u01E2":"AE","\uA734":"AO","\uA736":"AU","\uA738":"AV","\uA73A":"AV","\uA73C":"AY","\u24B7":"B","\uFF22":"B","\u1E02":"B","\u1E04":"B","\u1E06":"B","\u0243":"B","\u0182":"B","\u0181":"B","\u24B8":"C","\uFF23":"C","\u0106":"C","\u0108":"C","\u010A":"C","\u010C":"C","\u00C7":"C","\u1E08":"C","\u0187":"C","\u023B":"C","\uA73E":"C","\u24B9":"D","\uFF24":"D","\u1E0A":"D","\u010E":"D","\u1E0C":"D","\u1E10":"D","\u1E12":"D","\u1E0E":"D","\u0110":"D","\u018B":"D","\u018A":"D","\u0189":"D","\uA779":"D","\u01F1":"DZ","\u01C4":"DZ","\u01F2":"Dz","\u01C5":"Dz","\u24BA":"E","\uFF25":"E","\u00C8":"E","\u00C9":"E","\u00CA":"E","\u1EC0":"E","\u1EBE":"E","\u1EC4":"E","\u1EC2":"E","\u1EBC":"E","\u0112":"E","\u1E14":"E","\u1E16":"E","\u0114":"E","\u0116":"E","\u00CB":"E","\u1EBA":"E","\u011A":"E","\u0204":"E","\u0206":"E","\u1EB8":"E","\u1EC6":"E","\u0228":"E","\u1E1C":"E","\u0118":"E","\u1E18":"E","\u1E1A":"E","\u0190":"E","\u018E":"E","\u24BB":"F","\uFF26":"F","\u1E1E":"F","\u0191":"F","\uA77B":"F","\u24BC":"G","\uFF27":"G","\u01F4":"G","\u011C":"G","\u1E20":"G","\u011E":"G","\u0120":"G","\u01E6":"G","\u0122":"G","\u01E4":"G","\u0193":"G","\uA7A0":"G","\uA77D":"G","\uA77E":"G","\u24BD":"H","\uFF28":"H","\u0124":"H","\u1E22":"H","\u1E26":"H","\u021E":"H","\u1E24":"H","\u1E28":"H","\u1E2A":"H","\u0126":"H","\u2C67":"H","\u2C75":"H","\uA78D":"H","\u24BE":"I","\uFF29":"I","\u00CC":"I","\u00CD":"I","\u00CE":"I","\u0128":"I","\u012A":"I","\u012C":"I","\u0130":"I","\u00CF":"I","\u1E2E":"I","\u1EC8":"I","\u01CF":"I","\u0208":"I","\u020A":"I","\u1ECA":"I","\u012E":"I","\u1E2C":"I","\u0197":"I","\u24BF":"J","\uFF2A":"J","\u0134":"J","\u0248":"J","\u24C0":"K","\uFF2B":"K","\u1E30":"K","\u01E8":"K","\u1E32":"K","\u0136":"K","\u1E34":"K","\u0198":"K","\u2C69":"K","\uA740":"K","\uA742":"K","\uA744":"K","\uA7A2":"K","\u24C1":"L","\uFF2C":"L","\u013F":"L","\u0139":"L","\u013D":"L","\u1E36":"L","\u1E38":"L","\u013B":"L","\u1E3C":"L","\u1E3A":"L","\u0141":"L","\u023D":"L","\u2C62":"L","\u2C60":"L","\uA748":"L","\uA746":"L","\uA780":"L","\u01C7":"LJ","\u01C8":"Lj","\u24C2":"M","\uFF2D":"M","\u1E3E":"M","\u1E40":"M","\u1E42":"M","\u2C6E":"M","\u019C":"M","\u24C3":"N","\uFF2E":"N","\u01F8":"N","\u0143":"N","\u00D1":"N","\u1E44":"N","\u0147":"N","\u1E46":"N","\u0145":"N","\u1E4A":"N","\u1E48":"N","\u0220":"N","\u019D":"N","\uA790":"N","\uA7A4":"N","\u01CA":"NJ","\u01CB":"Nj","\u24C4":"O","\uFF2F":"O","\u00D2":"O","\u00D3":"O","\u00D4":"O","\u1ED2":"O","\u1ED0":"O","\u1ED6":"O","\u1ED4":"O","\u00D5":"O","\u1E4C":"O","\u022C":"O","\u1E4E":"O","\u014C":"O","\u1E50":"O","\u1E52":"O","\u014E":"O","\u022E":"O","\u0230":"O","\u00D6":"O","\u022A":"O","\u1ECE":"O","\u0150":"O","\u01D1":"O","\u020C":"O","\u020E":"O","\u01A0":"O","\u1EDC":"O","\u1EDA":"O","\u1EE0":"O","\u1EDE":"O","\u1EE2":"O","\u1ECC":"O","\u1ED8":"O","\u01EA":"O","\u01EC":"O","\u00D8":"O","\u01FE":"O","\u0186":"O","\u019F":"O","\uA74A":"O","\uA74C":"O","\u01A2":"OI","\uA74E":"OO","\u0222":"OU","\u24C5":"P","\uFF30":"P","\u1E54":"P","\u1E56":"P","\u01A4":"P","\u2C63":"P","\uA750":"P","\uA752":"P","\uA754":"P","\u24C6":"Q","\uFF31":"Q","\uA756":"Q","\uA758":"Q","\u024A":"Q","\u24C7":"R","\uFF32":"R","\u0154":"R","\u1E58":"R","\u0158":"R","\u0210":"R","\u0212":"R","\u1E5A":"R","\u1E5C":"R","\u0156":"R","\u1E5E":"R","\u024C":"R","\u2C64":"R","\uA75A":"R","\uA7A6":"R","\uA782":"R","\u24C8":"S","\uFF33":"S","\u1E9E":"S","\u015A":"S","\u1E64":"S","\u015C":"S","\u1E60":"S","\u0160":"S","\u1E66":"S","\u1E62":"S","\u1E68":"S","\u0218":"S","\u015E":"S","\u2C7E":"S","\uA7A8":"S","\uA784":"S","\u24C9":"T","\uFF34":"T","\u1E6A":"T","\u0164":"T","\u1E6C":"T","\u021A":"T","\u0162":"T","\u1E70":"T","\u1E6E":"T","\u0166":"T","\u01AC":"T","\u01AE":"T","\u023E":"T","\uA786":"T","\uA728":"TZ","\u24CA":"U","\uFF35":"U","\u00D9":"U","\u00DA":"U","\u00DB":"U","\u0168":"U","\u1E78":"U","\u016A":"U","\u1E7A":"U","\u016C":"U","\u00DC":"U","\u01DB":"U","\u01D7":"U","\u01D5":"U","\u01D9":"U","\u1EE6":"U","\u016E":"U","\u0170":"U","\u01D3":"U","\u0214":"U","\u0216":"U","\u01AF":"U","\u1EEA":"U","\u1EE8":"U","\u1EEE":"U","\u1EEC":"U","\u1EF0":"U","\u1EE4":"U","\u1E72":"U","\u0172":"U","\u1E76":"U","\u1E74":"U","\u0244":"U","\u24CB":"V","\uFF36":"V","\u1E7C":"V","\u1E7E":"V","\u01B2":"V","\uA75E":"V","\u0245":"V","\uA760":"VY","\u24CC":"W","\uFF37":"W","\u1E80":"W","\u1E82":"W","\u0174":"W","\u1E86":"W","\u1E84":"W","\u1E88":"W","\u2C72":"W","\u24CD":"X","\uFF38":"X","\u1E8A":"X","\u1E8C":"X","\u24CE":"Y","\uFF39":"Y","\u1EF2":"Y","\u00DD":"Y","\u0176":"Y","\u1EF8":"Y","\u0232":"Y","\u1E8E":"Y","\u0178":"Y","\u1EF6":"Y","\u1EF4":"Y","\u01B3":"Y","\u024E":"Y","\u1EFE":"Y","\u24CF":"Z","\uFF3A":"Z","\u0179":"Z","\u1E90":"Z","\u017B":"Z","\u017D":"Z","\u1E92":"Z","\u1E94":"Z","\u01B5":"Z","\u0224":"Z","\u2C7F":"Z","\u2C6B":"Z","\uA762":"Z","\u24D0":"a","\uFF41":"a","\u1E9A":"a","\u00E0":"a","\u00E1":"a","\u00E2":"a","\u1EA7":"a","\u1EA5":"a","\u1EAB":"a","\u1EA9":"a","\u00E3":"a","\u0101":"a","\u0103":"a","\u1EB1":"a","\u1EAF":"a","\u1EB5":"a","\u1EB3":"a","\u0227":"a","\u01E1":"a","\u00E4":"a","\u01DF":"a","\u1EA3":"a","\u00E5":"a","\u01FB":"a","\u01CE":"a","\u0201":"a","\u0203":"a","\u1EA1":"a","\u1EAD":"a","\u1EB7":"a","\u1E01":"a","\u0105":"a","\u2C65":"a","\u0250":"a","\uA733":"aa","\u00E6":"ae","\u01FD":"ae","\u01E3":"ae","\uA735":"ao","\uA737":"au","\uA739":"av","\uA73B":"av","\uA73D":"ay","\u24D1":"b","\uFF42":"b","\u1E03":"b","\u1E05":"b","\u1E07":"b","\u0180":"b","\u0183":"b","\u0253":"b","\u24D2":"c","\uFF43":"c","\u0107":"c","\u0109":"c","\u010B":"c","\u010D":"c","\u00E7":"c","\u1E09":"c","\u0188":"c","\u023C":"c","\uA73F":"c","\u2184":"c","\u24D3":"d","\uFF44":"d","\u1E0B":"d","\u010F":"d","\u1E0D":"d","\u1E11":"d","\u1E13":"d","\u1E0F":"d","\u0111":"d","\u018C":"d","\u0256":"d","\u0257":"d","\uA77A":"d","\u01F3":"dz","\u01C6":"dz","\u24D4":"e","\uFF45":"e","\u00E8":"e","\u00E9":"e","\u00EA":"e","\u1EC1":"e","\u1EBF":"e","\u1EC5":"e","\u1EC3":"e","\u1EBD":"e","\u0113":"e","\u1E15":"e","\u1E17":"e","\u0115":"e","\u0117":"e","\u00EB":"e","\u1EBB":"e","\u011B":"e","\u0205":"e","\u0207":"e","\u1EB9":"e","\u1EC7":"e","\u0229":"e","\u1E1D":"e","\u0119":"e","\u1E19":"e","\u1E1B":"e","\u0247":"e","\u025B":"e","\u01DD":"e","\u24D5":"f","\uFF46":"f","\u1E1F":"f","\u0192":"f","\uA77C":"f","\u24D6":"g","\uFF47":"g","\u01F5":"g","\u011D":"g","\u1E21":"g","\u011F":"g","\u0121":"g","\u01E7":"g","\u0123":"g","\u01E5":"g","\u0260":"g","\uA7A1":"g","\u1D79":"g","\uA77F":"g","\u24D7":"h","\uFF48":"h","\u0125":"h","\u1E23":"h","\u1E27":"h","\u021F":"h","\u1E25":"h","\u1E29":"h","\u1E2B":"h","\u1E96":"h","\u0127":"h","\u2C68":"h","\u2C76":"h","\u0265":"h","\u0195":"hv","\u24D8":"i","\uFF49":"i","\u00EC":"i","\u00ED":"i","\u00EE":"i","\u0129":"i","\u012B":"i","\u012D":"i","\u00EF":"i","\u1E2F":"i","\u1EC9":"i","\u01D0":"i","\u0209":"i","\u020B":"i","\u1ECB":"i","\u012F":"i","\u1E2D":"i","\u0268":"i","\u0131":"i","\u24D9":"j","\uFF4A":"j","\u0135":"j","\u01F0":"j","\u0249":"j","\u24DA":"k","\uFF4B":"k","\u1E31":"k","\u01E9":"k","\u1E33":"k","\u0137":"k","\u1E35":"k","\u0199":"k","\u2C6A":"k","\uA741":"k","\uA743":"k","\uA745":"k","\uA7A3":"k","\u24DB":"l","\uFF4C":"l","\u0140":"l","\u013A":"l","\u013E":"l","\u1E37":"l","\u1E39":"l","\u013C":"l","\u1E3D":"l","\u1E3B":"l","\u017F":"l","\u0142":"l","\u019A":"l","\u026B":"l","\u2C61":"l","\uA749":"l","\uA781":"l","\uA747":"l","\u01C9":"lj","\u24DC":"m","\uFF4D":"m","\u1E3F":"m","\u1E41":"m","\u1E43":"m","\u0271":"m","\u026F":"m","\u24DD":"n","\uFF4E":"n","\u01F9":"n","\u0144":"n","\u00F1":"n","\u1E45":"n","\u0148":"n","\u1E47":"n","\u0146":"n","\u1E4B":"n","\u1E49":"n","\u019E":"n","\u0272":"n","\u0149":"n","\uA791":"n","\uA7A5":"n","\u01CC":"nj","\u24DE":"o","\uFF4F":"o","\u00F2":"o","\u00F3":"o","\u00F4":"o","\u1ED3":"o","\u1ED1":"o","\u1ED7":"o","\u1ED5":"o","\u00F5":"o","\u1E4D":"o","\u022D":"o","\u1E4F":"o","\u014D":"o","\u1E51":"o","\u1E53":"o","\u014F":"o","\u022F":"o","\u0231":"o","\u00F6":"o","\u022B":"o","\u1ECF":"o","\u0151":"o","\u01D2":"o","\u020D":"o","\u020F":"o","\u01A1":"o","\u1EDD":"o","\u1EDB":"o","\u1EE1":"o","\u1EDF":"o","\u1EE3":"o","\u1ECD":"o","\u1ED9":"o","\u01EB":"o","\u01ED":"o","\u00F8":"o","\u01FF":"o","\u0254":"o","\uA74B":"o","\uA74D":"o","\u0275":"o","\u01A3":"oi","\u0223":"ou","\uA74F":"oo","\u24DF":"p","\uFF50":"p","\u1E55":"p","\u1E57":"p","\u01A5":"p","\u1D7D":"p","\uA751":"p","\uA753":"p","\uA755":"p","\u24E0":"q","\uFF51":"q","\u024B":"q","\uA757":"q","\uA759":"q","\u24E1":"r","\uFF52":"r","\u0155":"r","\u1E59":"r","\u0159":"r","\u0211":"r","\u0213":"r","\u1E5B":"r","\u1E5D":"r","\u0157":"r","\u1E5F":"r","\u024D":"r","\u027D":"r","\uA75B":"r","\uA7A7":"r","\uA783":"r","\u24E2":"s","\uFF53":"s","\u00DF":"s","\u015B":"s","\u1E65":"s","\u015D":"s","\u1E61":"s","\u0161":"s","\u1E67":"s","\u1E63":"s","\u1E69":"s","\u0219":"s","\u015F":"s","\u023F":"s","\uA7A9":"s","\uA785":"s","\u1E9B":"s","\u24E3":"t","\uFF54":"t","\u1E6B":"t","\u1E97":"t","\u0165":"t","\u1E6D":"t","\u021B":"t","\u0163":"t","\u1E71":"t","\u1E6F":"t","\u0167":"t","\u01AD":"t","\u0288":"t","\u2C66":"t","\uA787":"t","\uA729":"tz","\u24E4":"u","\uFF55":"u","\u00F9":"u","\u00FA":"u","\u00FB":"u","\u0169":"u","\u1E79":"u","\u016B":"u","\u1E7B":"u","\u016D":"u","\u00FC":"u","\u01DC":"u","\u01D8":"u","\u01D6":"u","\u01DA":"u","\u1EE7":"u","\u016F":"u","\u0171":"u","\u01D4":"u","\u0215":"u","\u0217":"u","\u01B0":"u","\u1EEB":"u","\u1EE9":"u","\u1EEF":"u","\u1EED":"u","\u1EF1":"u","\u1EE5":"u","\u1E73":"u","\u0173":"u","\u1E77":"u","\u1E75":"u","\u0289":"u","\u24E5":"v","\uFF56":"v","\u1E7D":"v","\u1E7F":"v","\u028B":"v","\uA75F":"v","\u028C":"v","\uA761":"vy","\u24E6":"w","\uFF57":"w","\u1E81":"w","\u1E83":"w","\u0175":"w","\u1E87":"w","\u1E85":"w","\u1E98":"w","\u1E89":"w","\u2C73":"w","\u24E7":"x","\uFF58":"x","\u1E8B":"x","\u1E8D":"x","\u24E8":"y","\uFF59":"y","\u1EF3":"y","\u00FD":"y","\u0177":"y","\u1EF9":"y","\u0233":"y","\u1E8F":"y","\u00FF":"y","\u1EF7":"y","\u1E99":"y","\u1EF5":"y","\u01B4":"y","\u024F":"y","\u1EFF":"y","\u24E9":"z","\uFF5A":"z","\u017A":"z","\u1E91":"z","\u017C":"z","\u017E":"z","\u1E93":"z","\u1E95":"z","\u01B6":"z","\u0225":"z","\u0240":"z","\u2C6C":"z","\uA763":"z"}; v=D(document);a=(function(){var O=1;return function(){return O++}}());function e(R){var P,Q,O,S;if(!R||R.length<1){return R}P="";for(Q=0,O=R.length;Q=0){P(R)}})}function I(O){if(O[0]===document.activeElement){return}window.setTimeout(function(){var Q=O[0],R=O.val().length,P;O.focus();if(O.is(":visible")&&Q===document.activeElement){if(Q.setSelectionRange){Q.setSelectionRange(R,R)}else{if(Q.createTextRange){P=Q.createTextRange();P.collapse(false);P.select()}}}},0)}function f(O){O=D(O)[0];var R=0;var P=0;if("selectionStart" in O){R=O.selectionStart;P=O.selectionEnd-R}else{if("selection" in document){O.focus();var Q=document.selection.createRange(); P=document.selection.createRange().text.length;Q.moveStart("character",-O.value.length);R=Q.text.length-P}}return{offset:R,length:P}}function A(O){O.preventDefault();O.stopPropagation()}function b(O){O.preventDefault();O.stopImmediatePropagation()}function n(P){if(!p){var O=P[0].currentStyle||window.getComputedStyle(P[0],null);p=D(document.createElement("div")).css({position:"absolute",left:"-10000px",top:"-10000px",display:"none",fontSize:O.fontSize,fontFamily:O.fontFamily,fontStyle:O.fontStyle,fontWeight:O.fontWeight,letterSpacing:O.letterSpacing,textTransform:O.textTransform,whiteSpace:"nowrap"});p.attr("class","select2-sizer");D("body").append(p)}p.text(P.val());return p.width()}function j(P,T,O){var R,S=[],Q;R=P.attr("class");if(R){R=""+R;D(R.split(" ")).each2(function(){if(this.indexOf("select2-")===0){S.push(this)}})}R=T.attr("class");if(R){R=""+R;D(R.split(" ")).each2(function(){if(this.indexOf("select2-")!==0){Q=O(this);if(Q){S.push(Q)}}})}P.attr("class",S.join(" "))}function u(T,S,Q,O){var R=e(T.toUpperCase()).indexOf(e(S.toUpperCase())),P=S.length;if(R<0){Q.push(O(T));return}Q.push(O(T.substring(0,R)));Q.push("");Q.push(O(T.substring(R,R+P)));Q.push("");Q.push(O(T.substring(R+P,T.length)))}function G(O){var P={"\\":"\","&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};return String(O).replace(/[&<>"'\/\\]/g,function(Q){return P[Q]})}function E(P){var S,Q=null,T=P.quietMillis||100,R=P.url,O=this;return function(U){window.clearTimeout(S);S=window.setTimeout(function(){var X=P.data,W=R,Z=P.transport||D.fn.select2.ajaxDefaults.transport,V={type:P.type||"GET",cache:P.cache||false,jsonpCallback:P.jsonpCallback||m,dataType:P.dataType||"json"},Y=D.extend({},D.fn.select2.ajaxDefaults.params,V);X=X?X.call(O,U.term,U.page,U.context):null;W=(typeof W==="function")?W.call(O,U.term,U.page,U.context):W;if(Q){Q.abort()}if(P.params){if(D.isFunction(P.params)){D.extend(Y,P.params.call(O))}else{D.extend(Y,P.params)}}D.extend(Y,{url:W,dataType:P.dataType,data:X,success:function(ab){var aa=P.results(ab,U.page); U.callback(aa)}});Q=Z.call(O,Y)},T)}}function H(P){var S=P,R,Q,T=function(U){return""+U.text};if(D.isArray(S)){Q=S;S={results:Q}}if(D.isFunction(S)===false){Q=S;S=function(){return Q}}var O=S();if(O.text){T=O.text;if(!D.isFunction(T)){R=O.text;T=function(U){return U[R]}}}return function(W){var V=W.term,U={results:[]},X;if(V===""){W.callback(S());return}X=function(Z,ab){var aa,Y;Z=Z[0];if(Z.children){aa={};for(Y in Z){if(Z.hasOwnProperty(Y)){aa[Y]=Z[Y]}}aa.children=[];D(Z.children).each2(function(ac,ad){X(ad,aa.children)});if(aa.children.length||W.matcher(V,T(aa),Z)){ab.push(aa)}}else{if(W.matcher(V,T(Z),Z)){ab.push(Z)}}};D(S().results).each2(function(Z,Y){X(Y,U.results)});W.callback(U)}}function z(P){var O=D.isFunction(P);return function(S){var R=S.term,Q={results:[]};D(O?P():P).each(function(){var T=this.text!==m,U=T?this.text:this;if(R===""||S.matcher(R,U)){Q.results.push(T?this:{id:this,text:this})}});S.callback(Q)}}function y(O,P){if(D.isFunction(O)){return true}if(!O){return false}throw new Error(P+" must be a function or a falsy value")}function C(O){return D.isFunction(O)?O():O}function r(O){var P=0;D.each(O,function(Q,R){if(R.children){P+=r(R.children)}else{P++}});return P}function g(W,X,U,O){var P=W,Y=false,R,V,S,Q,T;if(!O.createSearchChoice||!O.tokenSeparators||O.tokenSeparators.length<1){return m}while(true){V=-1;for(S=0,Q=O.tokenSeparators.length;S=0){break}}if(V<0){break}R=W.substring(0,V);W=W.substring(V+T.length);if(R.length>0){R=O.createSearchChoice.call(this,R,X);if(R!==m&&R!==null&&O.id(R)!==m&&O.id(R)!==null){Y=false;for(S=0,Q=X.length;S\|])/g,"\\$1");this.container.attr("id",this.containerId);this.body=s(function(){return S.element.closest("body")});j(this.container,this.opts.element,this.opts.adaptContainerCssClass);this.container.attr("style",S.element.attr("style"));this.container.css(C(S.containerCss));this.container.addClass(C(S.containerCssClass));this.elementTabIndex=this.opts.element.attr("tabindex");this.opts.element.data("select2",this).attr("tabindex","-1").before(this.container).on("click.select2",A);this.container.data("select2",this);this.dropdown=this.container.find(".select2-drop");j(this.dropdown,this.opts.element,this.opts.adaptDropdownCssClass);this.dropdown.addClass(C(S.dropdownCssClass));this.dropdown.data("select2",this);this.dropdown.on("click",A);this.results=Q=this.container.find(T);this.search=P=this.container.find("input.select2-input");this.queryCount=0;this.resultsPage=0;this.context=null;this.initContainer();this.container.on("click",A);J(this.results);this.dropdown.on("mousemove-filtered touchstart touchmove touchend",T,this.bind(this.highlightUnderEvent));l(80,this.results);this.dropdown.on("scroll-debounced",T,this.bind(this.loadMoreIfNeeded));D(this.container).on("change",".select2-input",function(U){U.stopPropagation()});D(this.dropdown).on("change",".select2-input",function(U){U.stopPropagation()});if(D.fn.mousewheel){Q.mousewheel(function(X,Y,V,U){var W=Q.scrollTop();if(U>0&&W-U<=0){Q.scrollTop(0);A(X)}else{if(U<0&&Q.get(0).scrollHeight-Q.scrollTop()+U<=Q.height()){Q.scrollTop(Q.get(0).scrollHeight-Q.height());A(X)}}})}F(P);P.on("keyup-change input paste",this.bind(this.updateResults));P.on("focus",function(){P.addClass("select2-focused")});P.on("blur",function(){P.removeClass("select2-focused")});this.dropdown.on("mouseup",T,this.bind(function(U){if(D(U.target).closest(".select2-result-selectable").length>0){this.highlightUnderEvent(U); this.selectHighlighted(U)}}));this.dropdown.on("click mouseup mousedown",function(U){U.stopPropagation()});if(D.isFunction(this.opts.initSelection)){this.initSelection();this.monitorSource()}if(S.maximumInputLength!==null){this.search.attr("maxlength",S.maximumInputLength)}var R=S.element.prop("disabled");if(R===m){R=false}this.enable(!R);var O=S.element.prop("readonly");if(O===m){O=false}this.readonly(O);w=w||M();this.autofocus=S.element.prop("autofocus");S.element.prop("autofocus",false);if(this.autofocus){this.focus()}this.nextSearchTerm=m},destroy:function(){var P=this.opts.element,O=P.data("select2");this.close();if(this.propertyObserver){delete this.propertyObserver;this.propertyObserver=null}if(O!==m){O.container.remove();O.dropdown.remove();P.removeClass("select2-offscreen").removeData("select2").off(".select2").prop("autofocus",this.autofocus||false);if(this.elementTabIndex){P.attr({tabindex:this.elementTabIndex})}else{P.removeAttr("tabindex")}P.show()}},optionToData:function(O){if(O.is("option")){return{id:O.prop("value"),text:O.text(),element:O.get(),css:O.attr("class"),disabled:O.prop("disabled"),locked:t(O.attr("locked"),"locked")||t(O.data("locked"),true)}}else{if(O.is("optgroup")){return{text:O.attr("label"),children:[],element:O.get(),css:O.attr("class")}}}},prepareOpts:function(T){var R,P,O,S,Q=this;R=T.element;if(R.get(0).tagName.toLowerCase()==="select"){this.select=P=T.element}if(P){D.each(["id","multiple","ajax","query","createSearchChoice","initSelection","data","tags"],function(){if(this in T){throw new Error("Option '"+this+"' is not allowed for Select2 when attached to a ","
"," ","
    ","
","
"].join(""));return O},enableInterface:function(){if(this.parent.enableInterface.apply(this,arguments)){this.focusser.prop("disabled",!this.isInterfaceEnabled())}},opening:function(){var Q,P,O;if(this.opts.minimumResultsForSearch>=0){this.showSearch(true)}this.parent.opening.apply(this,arguments);if(this.showSearchInput!==false){this.search.val(this.focusser.val())}this.search.focus();Q=this.search.get(0);if(Q.createTextRange){P=Q.createTextRange();P.collapse(false);P.select()}else{if(Q.setSelectionRange){O=this.search.val().length;Q.setSelectionRange(O,O)}}if(this.search.val()===""){if(this.nextSearchTerm!=m){this.search.val(this.nextSearchTerm);this.search.select()}}this.focusser.prop("disabled",true).val("");this.updateResults(true);this.opts.element.trigger(D.Event("select2-open"))},close:function(O){if(!this.opened()){return}this.parent.close.apply(this,arguments);O=O||{focus:true};this.focusser.removeAttr("disabled");if(O.focus){this.focusser.focus()}},focus:function(){if(this.opened()){this.close()}else{this.focusser.removeAttr("disabled");this.focusser.focus()}},isFocused:function(){return this.container.hasClass("select2-container-active")},cancel:function(){this.parent.cancel.apply(this,arguments);this.focusser.removeAttr("disabled");this.focusser.focus()},destroy:function(){D("label[for='"+this.focusser.attr("id")+"']").attr("for",this.opts.element.attr("id")); this.parent.destroy.apply(this,arguments)},initContainer:function(){var P,O=this.container,Q=this.dropdown;if(this.opts.minimumResultsForSearch<0){this.showSearch(false)}else{this.showSearch(true)}this.selection=P=O.find(".select2-choice");this.focusser=O.find(".select2-focusser");this.focusser.attr("id","s2id_autogen"+a());D("label[for='"+this.opts.element.attr("id")+"']").attr("for",this.focusser.attr("id"));this.focusser.attr("tabindex",this.elementTabIndex);this.search.on("keydown",this.bind(function(R){if(!this.isInterfaceEnabled()){return}if(R.which===K.PAGE_UP||R.which===K.PAGE_DOWN){A(R);return}switch(R.which){case K.UP:case K.DOWN:this.moveHighlight((R.which===K.UP)?-1:1);A(R);return;case K.ENTER:this.selectHighlighted();A(R);return;case K.TAB:this.selectHighlighted({noFocus:true});return;case K.ESC:this.cancel(R);A(R);return}}));this.search.on("blur",this.bind(function(R){if(document.activeElement===this.body().get(0)){window.setTimeout(this.bind(function(){this.search.focus()}),0)}}));this.focusser.on("keydown",this.bind(function(R){if(!this.isInterfaceEnabled()){return}if(R.which===K.TAB||K.isControl(R)||K.isFunctionKey(R)||R.which===K.ESC){return}if(this.opts.openOnEnter===false&&R.which===K.ENTER){A(R);return}if(R.which==K.DOWN||R.which==K.UP||(R.which==K.ENTER&&this.opts.openOnEnter)){if(R.altKey||R.ctrlKey||R.shiftKey||R.metaKey){return}this.open();A(R);return}if(R.which==K.DELETE||R.which==K.BACKSPACE){if(this.opts.allowClear){this.clear()}A(R);return}}));F(this.focusser);this.focusser.on("keyup-change input",this.bind(function(R){if(this.opts.minimumResultsForSearch>=0){R.stopPropagation();if(this.opened()){return}this.open()}}));P.on("mousedown","abbr",this.bind(function(R){if(!this.isInterfaceEnabled()){return}this.clear();b(R);this.close();this.selection.focus()}));P.on("mousedown",this.bind(function(R){if(!this.container.hasClass("select2-container-active")){this.opts.element.trigger(D.Event("select2-focus"))}if(this.opened()){this.close()}else{if(this.isInterfaceEnabled()){this.open()}}A(R)})); Q.on("mousedown",this.bind(function(){this.search.focus()}));P.on("focus",this.bind(function(R){A(R)}));this.focusser.on("focus",this.bind(function(){if(!this.container.hasClass("select2-container-active")){this.opts.element.trigger(D.Event("select2-focus"))}this.container.addClass("select2-container-active")})).on("blur",this.bind(function(){if(!this.opened()){this.container.removeClass("select2-container-active");this.opts.element.trigger(D.Event("select2-blur"))}}));this.search.on("focus",this.bind(function(){if(!this.container.hasClass("select2-container-active")){this.opts.element.trigger(D.Event("select2-focus"))}this.container.addClass("select2-container-active")}));this.initContainerWidth();this.opts.element.addClass("select2-offscreen");this.setPlaceholder()},clear:function(Q){var R=this.selection.data("select2-data");if(R){var P=D.Event("select2-clearing");this.opts.element.trigger(P);if(P.isDefaultPrevented()){return}var O=this.getPlaceholderOption();this.opts.element.val(O?O.val():"");this.selection.find(".select2-chosen").empty();this.selection.removeData("select2-data");this.setPlaceholder();if(Q!==false){this.opts.element.trigger({type:"select2-removed",val:this.id(R),choice:R});this.triggerChange({removed:R})}}},initSelection:function(){var P;if(this.isPlaceholderOptionSelected()){this.updateSelection(null);this.close();this.setPlaceholder()}else{var O=this;this.opts.initSelection.call(null,this.opts.element,function(Q){if(Q!==m&&Q!==null){O.updateSelection(Q);O.close();O.setPlaceholder()}})}},isPlaceholderOptionSelected:function(){var O;if(!this.getPlaceholder()){return false}return((O=this.getPlaceholderOption())!==m&&O.prop("selected"))||(this.opts.element.val()==="")||(this.opts.element.val()===m)||(this.opts.element.val()===null)},prepareOpts:function(){var P=this.parent.prepareOpts.apply(this,arguments),O=this;if(P.element.get(0).tagName.toLowerCase()==="select"){P.initSelection=function(Q,S){var R=Q.find("option").filter(function(){return this.selected});S(O.optionToData(R))}}else{if("data" in P){P.initSelection=P.initSelection||function(R,T){var S=R.val(); var Q=null;P.query({matcher:function(U,X,V){var W=t(S,P.id(V));if(W){Q=V}return W},callback:!D.isFunction(T)?D.noop:function(){T(Q)}})}}}return P},getPlaceholder:function(){if(this.select){if(this.getPlaceholderOption()===m){return m}}return this.parent.getPlaceholder.apply(this,arguments)},setPlaceholder:function(){var O=this.getPlaceholder();if(this.isPlaceholderOptionSelected()&&O!==m){if(this.select&&this.getPlaceholderOption()===m){return}this.selection.find(".select2-chosen").html(this.opts.escapeMarkup(O));this.selection.addClass("select2-default");this.container.removeClass("select2-allowclear")}},postprocessResults:function(T,P,S){var R=0,O=this,U=true;this.findHighlightableChoices().each2(function(V,W){if(t(O.id(W.data("select2-data")),O.opts.element.val())){R=V;return false}});if(S!==false){if(P===true&&R>=0){this.highlight(R)}else{this.highlight(0)}}if(P===true){var Q=this.opts.minimumResultsForSearch;if(Q>=0){this.showSearch(r(T.results)>=Q)}}},showSearch:function(O){if(this.showSearchInput===O){return}this.showSearchInput=O;this.dropdown.find(".select2-search").toggleClass("select2-search-hidden",!O);this.dropdown.find(".select2-search").toggleClass("select2-offscreen",!O);D(this.dropdown,this.container).toggleClass("select2-with-searchbox",O)},onSelect:function(Q,P){if(!this.triggerSelect(Q)){return}var O=this.opts.element.val(),R=this.data();this.opts.element.val(this.id(Q));this.updateSelection(Q);this.opts.element.trigger({type:"select2-selected",val:this.id(Q),choice:Q});this.nextSearchTerm=this.opts.nextSearchTerm(Q,this.search.val());this.close();if(!P||!P.noFocus){this.focusser.focus()}if(!t(O,this.id(Q))){this.triggerChange({added:Q,removed:R})}},updateSelection:function(R){var P=this.selection.find(".select2-chosen"),Q,O;this.selection.data("select2-data",R);P.empty();if(R!==null){Q=this.opts.formatSelection(R,P,this.opts.escapeMarkup)}if(Q!==m){P.append(Q)}O=this.opts.formatSelectionCssClass(R,P);if(O!==m){P.addClass(O)}this.selection.removeClass("select2-default");if(this.opts.allowClear&&this.getPlaceholder()!==m){this.container.addClass("select2-allowclear") }},val:function(){var S,P=false,Q=null,O=this,R=this.data();if(arguments.length===0){return this.opts.element.val()}S=arguments[0];if(arguments.length>1){P=arguments[1]}if(this.select){this.select.val(S).find("option").filter(function(){return this.selected}).each2(function(T,U){Q=O.optionToData(U);return false});this.updateSelection(Q);this.setPlaceholder();if(P){this.triggerChange({added:Q,removed:R})}}else{if(!S&&S!==0){this.clear(P);return}if(this.opts.initSelection===m){throw new Error("cannot call val() if initSelection() is not defined")}this.opts.element.val(S);this.opts.initSelection(this.opts.element,function(T){O.opts.element.val(!T?"":O.id(T));O.updateSelection(T);O.setPlaceholder();if(P){O.triggerChange({added:T,removed:R})}})}},clearSearch:function(){this.search.val("");this.focusser.val("")},data:function(Q){var P,O=false;if(arguments.length===0){P=this.selection.data("select2-data");if(P==m){P=null}return P}else{if(arguments.length>1){O=arguments[1]}if(!Q){this.clear(O)}else{P=this.data();this.opts.element.val(!Q?"":this.id(Q));this.updateSelection(Q);if(O){this.triggerChange({added:Q,removed:P})}}}}});c=L(N,{createContainer:function(){var O=D(document.createElement("div")).attr({"class":"select2-container select2-container-multi"}).html(["
    ","
  • "," ","
  • ","
","
","
    ","
","
"].join(""));return O},prepareOpts:function(){var P=this.parent.prepareOpts.apply(this,arguments),O=this;if(P.element.get(0).tagName.toLowerCase()==="select"){P.initSelection=function(Q,S){var R=[];Q.find("option").filter(function(){return this.selected}).each2(function(T,U){R.push(O.optionToData(U))});S(R)}}else{if("data" in P){P.initSelection=P.initSelection||function(Q,T){var R=i(Q.val(),P.separator);var S=[];P.query({matcher:function(U,X,V){var W=D.grep(R,function(Y){return t(Y,P.id(V)) }).length;if(W){S.push(V)}return W},callback:!D.isFunction(T)?D.noop:function(){var U=[];for(var X=0;X0){return}this.selectChoice(null);this.clearPlaceholder();if(!this.container.hasClass("select2-container-active")){this.opts.element.trigger(D.Event("select2-focus"))}this.open();this.focusSearch();R.preventDefault()}));this.container.on("focus",O,this.bind(function(){if(!this.isInterfaceEnabled()){return}if(!this.container.hasClass("select2-container-active")){this.opts.element.trigger(D.Event("select2-focus"))}this.container.addClass("select2-container-active");this.dropdown.addClass("select2-drop-active");this.clearPlaceholder()}));this.initContainerWidth();this.opts.element.addClass("select2-offscreen");this.clearSearch()},enableInterface:function(){if(this.parent.enableInterface.apply(this,arguments)){this.search.prop("disabled",!this.isInterfaceEnabled()) }},initSelection:function(){var P;if(this.opts.element.val()===""&&this.opts.element.text()===""){this.updateSelection([]);this.close();this.clearSearch()}if(this.select||this.opts.element.val()!==""){var O=this;this.opts.initSelection.call(null,this.opts.element,function(Q){if(Q!==m&&Q!==null){O.updateSelection(Q);O.close();O.clearSearch()}})}},clearSearch:function(){var P=this.getPlaceholder(),O=this.getMaxSearchWidth();if(P!==m&&this.getVal().length===0&&this.search.hasClass("select2-focused")===false){this.search.val(P).addClass("select2-default");this.search.width(O>0?O:this.container.css("width"))}else{this.search.val("").width(10)}},clearPlaceholder:function(){if(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.updateResults(true);this.search.focus();this.opts.element.trigger(D.Event("select2-open"))},close:function(){if(!this.opened()){return}this.parent.close.apply(this,arguments)},focus:function(){this.close();this.search.focus()},isFocused:function(){return this.search.hasClass("select2-focused")},updateSelection:function(R){var Q=[],P=[],O=this;D(R).each(function(){if(q(O.id(this),Q)<0){Q.push(O.id(this));P.push(this)}});R=P;this.selection.find(".select2-search-choice").remove();D(R).each(function(){O.addSelectedChoice(this)});O.postprocessResults()},tokenize:function(){var O=this.search.val();O=this.opts.tokenizer.call(this,O,this.data(),this.bind(this.onSelect),this.opts);if(O!=null&&O!=m){this.search.val(O);if(O.length>0){this.open()}}},onSelect:function(P,O){if(!this.triggerSelect(P)){return}this.addSelectedChoice(P);this.opts.element.trigger({type:"selected",val:this.id(P),choice:P});if(this.select||!this.opts.closeOnSelect){this.postprocessResults(P,false,this.opts.closeOnSelect===true)}if(this.opts.closeOnSelect){this.close();this.search.width(10)}else{if(this.countSelectableResults()>0){this.search.width(10);this.resizeSearch(); if(this.getMaximumSelectionSize()>0&&this.val().length>=this.getMaximumSelectionSize()){this.updateResults(true)}this.positionDropdown()}else{this.close();this.search.width(10)}}this.triggerChange({added:P});if(!O||!O.noFocus){this.focusSearch()}},cancel:function(){this.close();this.focusSearch()},addSelectedChoice:function(S){var U=!S.locked,Q=D("
  • "),V=D("
  • ");var R=U?Q:V,O=this.id(S),P=this.getVal(),T,W;T=this.opts.formatSelection(S,R.find("div"),this.opts.escapeMarkup);if(T!=m){R.find("div").replaceWith("
    "+T+"
    ")}W=this.opts.formatSelectionCssClass(S,R.find("div"));if(W!=m){R.addClass(W)}if(U){R.find(".select2-search-choice-close").on("mousedown",A).on("click dblclick",this.bind(function(X){if(!this.isInterfaceEnabled()){return}D(X.target).closest(".select2-search-choice").fadeOut("fast",this.bind(function(){this.unselect(D(X.target));this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus");this.close();this.focusSearch()})).dequeue();A(X)})).on("focus",this.bind(function(){if(!this.isInterfaceEnabled()){return}this.container.addClass("select2-container-active");this.dropdown.addClass("select2-drop-active")}))}R.data("select2-data",S);R.insertBefore(this.searchContainer);P.push(O);this.setVal(P)},unselect:function(Q){var S=this.getVal(),R,P;Q=Q.closest(".select2-search-choice");if(Q.length===0){throw"Invalid argument: "+Q+". Must be .select2-search-choice"}R=Q.data("select2-data");if(!R){return}while((P=q(this.id(R),S))>=0){S.splice(P,1);this.setVal(S);if(this.select){this.postprocessResults()}}var O=D.Event("select2-removing");O.val=this.id(R);O.choice=R;this.opts.element.trigger(O);if(O.isDefaultPrevented()){return}Q.remove();this.opts.element.trigger({type:"select2-removed",val:this.id(R),choice:R});this.triggerChange({removed:R})},postprocessResults:function(S,P,R){var T=this.getVal(),U=this.results.find(".select2-result"),Q=this.results.find(".select2-result-with-children"),O=this; U.each2(function(W,V){var X=O.id(V.data("select2-data"));if(q(X,T)>=0){V.addClass("select2-selected");V.find(".select2-result-selectable").addClass("select2-selected")}});Q.each2(function(W,V){if(!V.is(".select2-result-selectable")&&V.find(".select2-result-selectable:not(.select2-selected)").length===0){V.addClass("select2-selected")}});if(this.highlight()==-1&&R!==false){O.highlight(0)}if(!this.opts.createSearchChoice&&!U.filter(".select2-result:not(.select2-selected)").length>0){if(!S||S&&!S.more&&this.results.find(".select2-no-results").length===0){if(y(O.opts.formatNoMatches,"formatNoMatches")){this.results.append("
  • "+O.opts.formatNoMatches(O.search.val())+"
  • ")}}}},getMaxSearchWidth:function(){return this.selection.width()-h(this.search)},resizeSearch:function(){var T,R,Q,O,P,S=h(this.search);T=n(this.search)+10;R=this.search.offset().left;Q=this.selection.width();O=this.selection.offset().left;P=Q-(R-O)-S;if(P0){Q--}O.splice(P,1);P--}}}return{added:R,removed:O}},val:function(R,P){var Q,O=this;if(arguments.length===0){return this.getVal()}Q=this.data();if(!Q.length){Q=[]}if(!R&&R!==0){this.opts.element.val("");this.updateSelection([]);this.clearSearch();if(P){this.triggerChange({added:this.data(),removed:Q})}return}this.setVal(R);if(this.select){this.opts.initSelection(this.select,this.bind(this.updateSelection));if(P){this.triggerChange(this.buildChangeDetails(Q,this.data()))}}else{if(this.opts.initSelection===m){throw new Error("val() cannot be called if initSelection() is not defined") }this.opts.initSelection(this.opts.element,function(T){var S=D.map(T,O.id);O.setVal(S);O.updateSelection(T);O.clearSearch();if(P){O.triggerChange(O.buildChangeDetails(Q,O.data()))}})}this.clearSearch()},onSortStart:function(){if(this.select){throw new Error("Sorting of elements is not supported when attached to instead.")}this.search.width(0);this.searchContainer.hide()},onSortEnd:function(){var P=[],O=this;this.searchContainer.show();this.searchContainer.appendTo(this.searchContainer.parent());this.resizeSearch();this.selection.find(".select2-search-choice").each(function(){P.push(O.opts.id(D(this).data("select2-data")))});this.setVal(P);this.triggerChange()},data:function(Q,R){var P=this,S,O;if(arguments.length===0){return this.selection.find(".select2-search-choice").map(function(){return D(this).data("select2-data")}).get()}else{O=this.data();if(!Q){Q=[]}S=D.map(Q,function(T){return P.opts.id(T)});this.setVal(S);this.updateSelection(Q);this.clearSearch();if(R){this.triggerChange(this.buildChangeDetails(O,this.data()))}}}});D.fn.select2=function(){var T=Array.prototype.slice.call(arguments,0),P,S,O,V,X,W=["val","destroy","opened","open","close","focus","isFocused","container","dropdown","onSortStart","onSortEnd","enable","disable","readonly","positionDropdown","data","search"],U=["opened","isFocused","container","dropdown"],Q=["val","data"],R={search:"externalSearch"};this.each(function(){if(T.length===0||typeof(T[0])==="object"){P=T.length===0?{}:D.extend({},T[0]);P.element=D(this);if(P.element.get(0).tagName.toLowerCase()==="select"){X=P.element.prop("multiple")}else{X=P.multiple||false;if("tags" in P){P.multiple=X=true}}S=X?new c():new x();S.init(P)}else{if(typeof(T[0])==="string"){if(q(T[0],W)<0){throw"Unknown method: "+T[0]}V=m;S=D(this).data("select2");if(S===m){return}O=T[0];if(O==="container"){V=S.container}else{if(O==="dropdown"){V=S.dropdown}else{if(R[O]){O=R[O]}V=S[O].apply(S,T.slice(1))}}if(q(T[0],U)>=0||(q(T[0],Q)&&T.length==1)){return false}}else{throw"Invalid arguments to select2 plugin: "+T }}});return(V===m)?this:V};D.fn.select2.defaults={width:"copy",loadMorePadding:0,closeOnSelect:true,openOnEnter:true,containerCss:{},dropdownCss:{},containerCssClass:"",dropdownCssClass:"",formatResult:function(P,Q,S,O){var R=[];u(P.text,S.term,R,O);return R.join("")},formatSelection:function(Q,P,O){return Q?O(Q.text):m},sortResults:function(P,O,Q){return P},formatResultCssClass:function(O){return m},formatSelectionCssClass:function(P,O){return m},formatNoMatches:function(){return"No matches found"},formatInputTooShort:function(O,P){var Q=P-O.length;return"Please enter "+Q+" more character"+(Q==1?"":"s")},formatInputTooLong:function(P,O){var Q=P.length-O;return"Please delete "+Q+" character"+(Q==1?"":"s")},formatSelectionTooBig:function(O){return"You can only select "+O+" item"+(O==1?"":"s")},formatLoadMore:function(O){return"Loading more results..."},formatSearching:function(){return"Searching..."},minimumResultsForSearch:0,minimumInputLength:0,maximumInputLength:null,maximumSelectionSize:0,id:function(O){return O.id},matcher:function(O,P){return e(""+P).toUpperCase().indexOf(e(""+O).toUpperCase())>=0},separator:",",tokenSeparators:[],tokenizer:g,escapeMarkup:G,blurOnChange:false,selectOnBlur:false,adaptContainerCssClass:function(O){return O},adaptDropdownCssClass:function(O){return null},nextSearchTerm:function(O,P){return m}};D.fn.select2.ajaxDefaults={transport:D.ajax,params:{type:"GET",cache:false,dataType:"json"}};window.Select2={query:{ajax:E,local:H,tags:z},util:{debounce:k,markMatch:u,escapeMarkup:G,stripDiacritics:e},"class":{"abstract":N,single:x,multi:c}}}(jQuery));(function(a){a.extend(a.fn.select2.defaults,{formatNoMatches:function(){return"没有找到匹配项"},formatInputTooShort:function(b,c){var d=c-b.length;return"请再输入"+d+"个字符"},formatInputTooLong:function(c,b){var d=c.length-b;return"请删掉"+d+"个字符"},formatSelectionTooBig:function(b){return"你只能选择最多"+b+"项"},formatLoadMore:function(b){return"加载结果中..."},formatSearching:function(){return"搜索中..."}})})(jQuery);