PageSourceSearch

https://career.leightonasia.com/assets/selectize.min-39919ed8.js

js leightonasia.com collected 2026-10-02 11:07:04 UTC 46,286 bytes, 3 lines download raw bytes

1import h from"jquery";import g from"sifter";import y from"microplugin";var O="undefined"!==typeof globalThis?globalThis:"undefined"!==typeof self?self:global;var C={};!function(h,g){C=g()}(C,(function(){var a=function(h,g){(this||O).items=h,(this||O).settings=g||{diacritics:!0}};a.prototype.tokenize=function(h){if(!(h=e(String(h||"").toLowerCase()))||!h.length)return[];var y,$,C,x,I=[],S=h.split(/ +/);for(y=0,$=S.length;y<$;y++){if(C=f(S[y]),(this||O).settings.diacritics)for(x in g)g.hasOwnProperty(x)&&(C=C.replace(new RegExp(x,"g"),g[x]));I.push({string:S[y],regex:new RegExp(C,"i")})}return I},a.prototype.iterator=function(g,y){var $;$=h(g)?Array.prototype.forEach||function(h){for(var g=0,y=(this||O).length;g<y;g++)h((this||O)[g],g,this||O)}:function(h){for(var g in this||O)this.hasOwnProperty(g)&&h((this||O)[g],g,this||O)},$.apply(g,[y])},a.prototype.getScoreFunction=function(h,g){var y,$,C,x,I;y=this||O,h=y.prepareSearch(h,g),C=h.tokens,$=h.options.fields,x=C.length,I=h.options.nesting;var i=function(h,g){var y,O;return h?(h=String(h||""),-1===(O=h.search(g.regex))?0:(y=g.string.length/h.length,0===O&&(y+=.5),y)):0},S=function(){var h=$.length;return h?1===h?function(h,g){return i(d(g,$[0],I),h)}:function(g,y){for(var O=0,C=0;O<h;O++)C+=i(d(y,$[O],I),g);return C/h}:function(){return 0}}();return x?1===x?function(h){return S(C[0],h)}:"and"===h.options.conjunction?function(h){for(var g,y=0,O=0;y<x;y++){if((g=S(C[y],h))<=0)return 0;O+=g}return O/x}:function(h){for(var g=0,y=0;g<x;g++)y+=S(C[g],h);return y/x}:function(){return 0}},a.prototype.getSortFunction=function(h,g){var y,$,C,x,I,S,_,F,D,A,P;if(C=this||O,h=C.prepareSearch(h,g),P=!h.query&&g.sort_empty||g.sort,D=function(h,y){return"$score"===h?y.score:d(C.items[y.id],h,g.nesting)},I=[],P)for(y=0,$=P.length;y<$;y++)(h.query||"$score"!==P[y].field)&&I.push(P[y]);if(h.query){for(A=!0,y=0,$=I.length;y<$;y++)if("$score"===I[y].field){A=!1;break}A&&I.unshift({field:"$score",direction:"desc"})}else for(y=0,$=I.length;y<$;y++)if("$score"===I[y].field){I.splice(y,1);break}for(F=[],y=0,$=I.length;y<$;y++)F.push("desc"===I[y].direction?-1:1);return S=I.length,S?1===S?(x=I[0].field,_=F[0],function(h,g){return _*b(D(x,h),D(x,g))}):function(h,g){var y,O,$;for(y=0;y<S;y++)if($=I[y].field,O=F[y]*b(D($,h),D($,g)))return O;return 0}:null},a.prototype.prepareSearch=function(g,y){if("object"==typeof g)return g;y=c({},y);var O=y.fields,$=y.sort,C=y.sort_empty;return O&&!h(O)&&(y.fields=[O]),$&&!h($)&&(y.sort=[$]),C&&!h(C)&&(y.sort_empty=[C]),{options:y,query:String(g||"").toLowerCase(),tokens:this.tokenize(g),total:0,items:[]}},a.prototype.search=function(h,g){var y,$,C,x,I=this||O;return $=this.prepareSearch(h,g),g=$.options,h=$.query,x=g.score||I.getScoreFunction($),h.length?I.iterator(I.items,(function(h,O){y=x(h),(!1===g.filter||y>0)&&$.items.push({score:y,id:O})})):I.iterator(I.items,(function(h,g){$.items.push({score:1,id:g})})),C=I.getSortFunction($,g),C&&$.items.sort(C),$.total=$.items.length,"number"==typeof g.limit&&($.items=$.items.slice(0,g.limit)),$};var b=function(h,g){return"number"==typeof h&&"number"==typeof g?h>g?1:h<g?-1:0:(h=y(String(h||"")),g=y(String(g||"")),h>g?1:g>h?-1:0)},c=function(h,g){var y,O,$,C;for(y=1,O=arguments.length;y<O;y++)if(C=arguments[y])for($ in C)C.hasOwnProperty($)&&(h[$]=C[$]);return h},d=function(h,g,y){if(h&&g){if(!y)return h[g];for(var O=g.split(".");O.length&&(h=h[O.shift()]););return h}},e=function(h){return(h+"").replace(/^\s+|\s+$|/g,"")},f=function(h){return(h+"").replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1")},h=Array.isArray||"undefined"!=typeof $&&$.isArray||function(h){return"[object Array]"===Object.prototype.toString.call(h)},g={a:"[aḀḁĂăÂâǍǎȺⱥȦȧẠạÄäÀàÁáĀāÃãÅåąĄÃąĄ]",b:"[b␢βΒB฿𐌁ᛒ]",c:"[cĆćĈĉČčĊċC̄c̄ÇçḈḉȻȼƇƈɕᴄCc]",d:"[dĎďḊḋḐḑḌḍḒḓḎḏĐđD̦d̦ƉɖƊɗƋƌᵭᶁᶑȡᴅDdð]",e:"[eÉéÈèÊêḘḙĚěĔĕẼẽḚḛẺẻĖėËëĒēȨȩĘęᶒɆɇȄȅẾếỀềỄễỂểḜḝḖḗḔḕȆȇẸẹỆệⱸᴇEeɘǝƏƐε]",f:"[fƑƒḞḟ]",g:"[gɢ₲ǤǥĜĝĞğĢģƓɠĠġ]",h:"[hĤĥĦħḨḩẖẖḤḥḢḣɦʰǶƕ]",i:"[iÍíÌìĬĭÎîǏǐÏïḮḯĨĩĮįĪīỈỉȈȉȊȋỊịḬḭƗɨɨ̆ᵻᶖİiIıɪIi]",j:"[jȷĴĵɈɉʝɟʲ]",k:"[kƘƙꝀꝁḰḱǨǩḲḳḴḵκϰ₭]",l:"[lŁłĽľĻļĹĺḶḷḸḹḼḽḺḻĿŀȽƚⱠⱡⱢɫɬᶅɭȴʟLl]",n:"[nŃńǸǹŇňÑñṄṅŅņṆṇṊṋṈṉN̈n̈ƝɲȠƞᵰᶇɳȵɴNnŊŋ]",o:"[oØøÖöÓóÒòÔôǑǒŐőŎŏȮȯỌọƟɵƠơỎỏŌō
1ÕõǪǫȌȍՕօ]",p:"[pṔṕṖṗⱣᵽƤƥᵱ]",q:"[qꝖꝗʠɊɋꝘꝙq̃]",r:"[rŔŕɌɍŘřŖŗṘṙȐȑȒȓṚṛⱤɽ]",s:"[sŚśṠṡṢṣꞨꞩŜŝŠšŞşȘșS̈s̈]",t:"[tŤťṪṫŢţṬṭƮʈȚțṰṱṮṯƬƭ]",u:"[uŬŭɄʉỤụÜüÚúÙùÛûǓǔŰűŬŭƯưỦủŪūŨũŲųȔȕ∪]",v:"[vṼṽṾṿƲʋꝞꝟⱱʋ]",w:"[wẂẃẀẁŴŵẄẅẆẇẈẉ]",x:"[xẌẍẊẋχ]",y:"[yÝýỲỳŶŷŸÿỸỹẎẏỴỵɎɏƳƴ]",z:"[zŹźẐẑŽžŻżẒẓẔẕƵƶ]"},y=function(){var h,y,O,$,C="",x={};for(O in g)if(g.hasOwnProperty(O))for($=g[O].substring(2,g[O].length-1),C+=$,h=0,y=$.length;h<y;h++)x[$.charAt(h)]=O;var I=new RegExp("["+C+"]","g");return function(h){return h.replace(I,(function(h){return x[h]})).toLowerCase()}}();return a})),function(h,g){C=g()}(C,(function(){var h={};h.mixin=function(h){h.plugins={},h.prototype.initializePlugins=function(h){var y,$,C,x=this||O,I=[];if(x.plugins={names:[],settings:{},requested:{},loaded:{}},g.isArray(h))for(y=0,$=h.length;y<$;y++)"string"==typeof h[y]?I.push(h[y]):(x.plugins.settings[h[y].name]=h[y].options,I.push(h[y].name));else if(h)for(C in h)h.hasOwnProperty(C)&&(x.plugins.settings[C]=h[C],I.push(C));for(;I.length;)x.require(I.shift())},h.prototype.loadPlugin=function(g){var y=this||O,$=y.plugins,C=h.plugins[g];if(!h.plugins.hasOwnProperty(g))throw new Error('Unable to find "'+g+'" plugin');$.requested[g]=!0,$.loaded[g]=C.fn.apply(y,[y.plugins.settings[g]||{}]),$.names.push(g)},h.prototype.require=function(h){var g=this||O,y=g.plugins;if(!g.plugins.loaded.hasOwnProperty(h)){if(y.requested[h])throw new Error('Plugin has circular dependency ("'+h+'")');g.loadPlugin(h)}return y.loaded[h]},h.define=function(g,y){h.plugins[g]={name:g,fn:y}}};var g={isArray:Array.isArray||function(h){return"[object Array]"===Object.prototype.toString.call(h)}};return h})),function(O,$){C=$(h,g,y)}(C,(function(h,g,y){var d=function(h,g){if("string"!=typeof g||g.length){var y="string"==typeof g?new RegExp(g,"i"):g,d=function(h){var g=0;if(3===h.nodeType){var O=h.data.search(y);if(O>=0&&h.data.length>0){var $=h.data.match(y),C=document.createElement("span");C.className="highlight";var x=h.splitText(O),I=(x.splitText($[0].length),x.cloneNode(!0));C.appendChild(I),x.parentNode.replaceChild(C,x),g=1}}else if(1===h.nodeType&&h.childNodes&&!/(script|style)/i.test(h.tagName)&&("highlight"!==h.className||"SPAN"!==h.tagName))for(var S=0;S<h.childNodes.length;++S)S+=d(h.childNodes[S]);return g};return h.each((function(){d(this||O)}))}};h.fn.removeHighlight=function(){return this.find("span.highlight").each((function(){(this||O).parentNode.firstChild.nodeName;var h=(this||O).parentNode;h.replaceChild((this||O).firstChild,this||O),h.normalize()})).end()};var e=function(){};e.prototype={on:function(h,g){(this||O)._events=(this||O)._events||{},(this||O)._events[h]=(this||O)._events[h]||[],(this||O)._events[h].push(g)},off:function(h,g){var y=arguments.length;return 0===y?delete(this||O)._events:1===y?delete(this||O)._events[h]:((this||O)._events=(this||O)._events||{},void(h in(this||O)._events!=!1&&(this||O)._events[h].splice((this||O)._events[h].indexOf(g),1)))},trigger:function(h){if((this||O)._events=(this||O)._events||{},h in(this||O)._events!=!1)for(var g=0;g<(this||O)._events[h].length;g++)(this||O)._events[h][g].apply(this||O,Array.prototype.slice.call(arguments,1))}},e.mixin=function(h){for(var g=["on","off","trigger"],y=0;y<g.length;y++)h.prototype[g[y]]=e.prototype[g[y]]};var $=/Mac/.test(navigator.userAgent),C=$?91:17,x=$?18:17,I=!/android/i.test(window.navigator.userAgent)&&!!document.createElement("input").validity,j=function(h){return void 0!==h},k=function(h){return void 0===h||null===h?null:"boolean"==typeof h?h?"1":"0":h+""},l=function(h){return(h+"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")},S={};S.before=function(h,g,y){var O=h[g];h[g]=function(){return y.apply(h,arguments),O.apply(h,arguments)}},S.after=function(h,g,y){var O=h[g];
vendor: 6,663 bytes, line 1
1h[g]=function(){var g=O.apply(h,arguments);return y.apply(h,arguments),g}};var n=function(h){var g=!1;return function(){g||(g=!0,h.apply(this||O,arguments))}},o=function(h,g){var y;return function(){var $=this||O,C=arguments;window.clearTimeout(y),y=window.setTimeout((function(){h.apply($,C)}),g)}},p=function(h,g,y){var O,$=h.trigger,C={};h.trigger=function(){var y=arguments[0];if(-1===g.indexOf(y))return $.apply(h,arguments);C[y]=arguments},y.apply(h,[]),h.trigger=$;for(O in C)C.hasOwnProperty(O)&&$.apply(h,C[O])},q=function(h,g,y,$){h.on(g,y,(function(g){for(var y=g.target;y&&y.parentNode!==h[0];)y=y.parentNode;return g.currentTarget=y,$.apply(this||O,[g])}))},r=function(h){var g={};if("selectionStart"in h)g.start=h.selectionStart,g.length=h.selectionEnd-g.start;else if(document.selection){h.focus();var y=document.selection.createRange(),O=document.selection.createRange().text.length;y.moveStart("character",-h.value.length),g.start=y.text.length-O,g.length=O}return g},s=function(h,g,y){var O,$,C={};if(y)for(O=0,$=y.length;O<$;O++)C[y[O]]=h.css(y[O]);else C=h.css();g.css(C)},t=function(g,y){return g?(w.$testInput||(w.$testInput=h("<span />").css({position:"absolute",top:-99999,left:-99999,width:"auto",padding:0,whiteSpace:"pre"}).appendTo("body")),w.$testInput.text(g),s(y,w.$testInput,["letterSpacing","fontSize","fontFamily","fontWeight","textTransform"]),w.$testInput.width()):0},u=function(h){var g=null,c=function(y,O){var $,C,x,I,S,_,F,D;y=y||window.event||{},O=O||{},y.metaKey||y.altKey||(O.force||!1!==h.data("grow"))&&($=h.val(),y.type&&"keydown"===y.type.toLowerCase()&&(C=y.keyCode,x=C>=48&&C<=57||C>=65&&C<=90||C>=96&&C<=111||C>=186&&C<=222||32===C,46===C||8===C?(D=r(h[0]),D.length?$=$.substring(0,D.start)+$.substring(D.start+D.length):8===C&&D.start?$=$.substring(0,D.start-1)+$.substring(D.start+1):46===C&&void 0!==D.start&&($=$.substring(0,D.start)+$.substring(D.start+1))):x&&(_=y.shiftKey,F=String.fromCharCode(y.keyCode),F=_?F.toUpperCase():F.toLowerCase(),$+=F)),I=h.attr("placeholder"),!$&&I&&($=I),(S=t($,h)+4)!==g&&(g=S,h.width(S),h.triggerHandler("resize")))};h.on("keydown keyup update blur",c),c()},v=function(h){var g=document.createElement("div");return g.appendChild(h.cloneNode(!0)),g.innerHTML},w=function(y,$){var C,x,I,S,_=this||O;S=y[0],S.selectize=_;var F=window.getComputedStyle&&window.getComputedStyle(S,null);if(I=F?F.getPropertyValue("direction"):S.currentStyle&&S.currentStyle.direction,I=I||y.parents("[dir]:first").attr("dir")||"",h.extend(_,{order:0,settings:$,$input:y,tabIndex:y.attr("tabindex")||"",tagType:"select"===S.tagName.toLowerCase()?1:2,rtl:/rtl/i.test(I),eventNS:".selectize"+ ++w.count,highlightedValue:null,isBlurring:!1,isOpen:!1,isDisabled:!1,isRequired:y.is("[required]"),isInvalid:!1,isLocked:!1,isFocused:!1,isInputHidden:!1,isSetup:!1,isShiftDown:!1,isCmdDown:!1,isCtrlDown:!1,ignoreFocus:!1,ignoreBlur:!1,ignoreHover:!1,hasOptions:!1,currentResults:null,lastValue:"",caretPos:0,loading:0,loadedSearches:{},$activeOption:null,$activeItems:[],optgroups:{},options:{},userOptions:{},items:[],renderCache:{},onSearchChange:null===$.loadThrottle?_.onSearchChange:o(_.onSearchChange,$.loadThrottle)}),_.sifter=new g((this||O).options,{diacritics:$.diacritics}),_.settings.options){for(C=0,x=_.settings.options.length;C<x;C++)_.registerOption(_.settings.options[C]);delete _.settings.options}if(_.settings.optgroups){for(C=0,x=_.settings.optgroups.length;C<x;C++)_.registerOptionGroup(_.settings.optgroups[C]);delete _.settings.optgroups}_.settings.mode=_.settings.mode||(1===_.settings.maxItems?"single":"multi"),"boolean"!=typeof _.settings.hideSelected&&(_.settings.hideSelected="multi"===_.settings.mode),_.initializePlugins(_.settings.plugins),_.setupCallbacks(),_.setupTemplates(),_.setup()};return e.mixin(w),void 0!==y?y.mixin(w):function(h,g){g||(g={});console.error("Selectize: "+h),g.explanation&&(console.group&&console.group(),console.error(g.explanation),console.group&&console.groupEnd())}("Dependency MicroPlugin is missing",{explanation:'Make sure you either: (1) are using the "standalone" version of Selectize, or (2) require MicroPlugin before you load Selectize.'}),h.extend(w.prototype,{setup:function(){var g,y,S,_,F,D,A,P,z,T,N=this||O,E=N.settings,H=N.eventNS,L=h(window),V=h(document),K=N.$input;if(A=N.settings.mode,P=K.attr("class")||"",g=h("<div>").addClass(E.wrapperClass).addClass(P).addClass(A),y=h("<div>").addClass(E.inputClass).addClass("items").appendTo(g),S=h('<input type="text" autocomplete="off" />').appendTo(y).attr("tabindex",K.is(":disabled")?"-1":N.tabIndex),D=h(E.dropdownParent||g),_=h("<div>").addClass(E.dropdownClass).addClass(A).hide().appendTo(D),F=h("<div>").addClass(E.dropdownContentClass).appendTo(_),(T=K.attr("id"))&&(S.attr("id",T+"-selectized"),h("label[for='"+T+"']").attr("for",T+"-selectized")),N.settings.copyClassesToDropdown&&_.addClass(P),g.css({width:K[0].style.width}),N.plugins.names.length&&(z="plugin-"+N.plugins.names.join(" plugin-"),g.addClass(z),_.addClass(z)),(null===E.maxItems||E.maxItems>1)&&1===N.tagType&&K.attr("multiple","multiple"),N.settings.placeholder&&S.attr("placeholder",E.placeholder),!N.settings.splitOn&&N.settings.delimiter){var R=N.settings.delimiter.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&");N.settings.splitOn=new RegExp("\\s*"+R+"+\\s*")}K.attr("autocorrect")&&S.attr("autocorrect",K.attr("autocorrect")),K.attr("autocapitalize")&&S.attr("autocapitalize",K.attr("autocapitalize")),S[0].type=K[0].type,N.$wrapper=g,N.$control=y,N.$control_input=S,N.$dropdown=_,N.$dropdown_content=F,_.on("mouseenter mousedown click","[data-disabled]>[data-selectable]",(function(h){h.stopImmediatePropagation()})),_.on("mouseenter","[data-selectable]",(function(){return N.onOptionHover.apply(N,arguments)})),_.on("mousedown click","[data-selectable]",(function(){return N.onOptionSelect.apply(N,arguments)})),q(y,"mousedown","*:not(input)",(function(){return N.onItemSelect.apply(N,arguments)})),u(S),y.on({mousedown:function(){return N.onMouseDown.apply(N,arguments)},click:function(){return N.onClick.apply(N,arguments)}}),S.on({mousedown:function(h){h.stopPropagation()},keydown:function(){return N.onKeyDown.apply(N,arguments)},keyup:function(){return N.onKeyUp.apply(N,arguments)},keypress:function(){return N.onKeyPress.apply(N,arguments)},resize:function(){N.positionDropdown.apply(N,[])},blur:function(){return N.onBlur.apply(N,arguments)},focus:function(){return N.ignoreBlur=!1,N.onFocus.apply(N,arguments)},paste:function(){return N.onPaste.apply(N,arguments)}}),V.on("keydown"+H,(function(h){N.isCmdDown=h[$?"metaKey":"ctrlKey"],N.isCtrlDown=h[$?"altKey":"ctrlKey"],N.isShiftDown=h.shift
1Key})),V.on("keyup"+H,(function(h){h.keyCode===x&&(N.isCtrlDown=!1),16===h.keyCode&&(N.isShiftDown=!1),h.keyCode===C&&(N.isCmdDown=!1)})),V.on("mousedown"+H,(function(h){if(N.isFocused){if(h.target===N.$dropdown[0]||h.target.parentNode===N.$dropdown[0])return!1;N.$control.has(h.target).length||h.target===N.$control[0]||N.blur(h.target)}})),L.on(["scroll"+H,"resize"+H].join(" "),(function(){N.isOpen&&N.positionDropdown.apply(N,arguments)})),L.on("mousemove"+H,(function(){N.ignoreHover=!1})),(this||O).revertSettings={$children:K.children().detach(),tabindex:K.attr("tabindex")},K.attr("tabindex",-1).hide().after(N.$wrapper),h.isArray(E.items)&&(N.setValue(E.items),delete E.items),I&&K.on("invalid"+H,(function(h){h.preventDefault(),N.isInvalid=!0,N.refreshState()})),N.updateOriginalInput(),N.refreshItems(),N.refreshState(),N.updatePlaceholder(),N.isSetup=!0,K.is(":disabled")&&N.disable(),N.on("change",(this||O).onChange),K.data("selectize",N),K.addClass("selectized"),N.trigger("initialize"),!0===E.preload&&N.onSearchChange("")},setupTemplates:function(){var g=this||O,y=g.settings.labelField,$=g.
1settings.optgroupLabelField,C={optgroup:function(h){return'<div class="optgroup">'+h.html+"</div>"},optgroup_header:function(h,g){return'<div class="optgroup-header">'+g(h[$])+"</div>"},option:function(h,g){return'<div class="option">'+g(h[y])+"</div>"},item:function(h,g){return'<div class="item">'+g(h[y])+"</div>"},option_create:function(h,g){return'<div class="create">Add <strong>'+g(h.input)+"</strong>&hellip;</div>"}};g.settings.render=h.extend({},C,g.settings.render)},setupCallbacks:function(){var h,g,y={initialize:"onInitialize",change:"onChange",item_add:"onItemAdd",item_remove:"onItemRemove",clear:"onClear",option_add:"onOptionAdd",option_remove:"onOptionRemove",option_clear:"onOptionClear",optgroup_add:"onOptionGroupAdd",optgroup_remove:"onOptionGroupRemove",optgroup_clear:"onOptionGroupClear",dropdown_open:"onDropdownOpen",dropdown_close:"onDropdownClose",type:"onType",load:"onLoad",focus:"onFocus",blur:"onBlur"};for(h in y)y.hasOwnProperty(h)&&(g=(this||O).settings[y[h]])&&this.on(h,g)},onClick:function(h){var g=this||O;g.isFocused&&g.isOpen||(g.focus(),h.preventDefault())},onMouseDown:function(g){var y=this||O,$=g.isDefaultPrevented();h(g.target);if(y.isFocused){if(g.target!==y.$control_input[0])return"single"===y.settings.mode?y.isOpen?y.close():y.open():$||y.setActiveItem(null),!1}else $||window.setTimeout((function(){y.focus()}),0)},onChange:function(){(this||O).$input.trigger("change")},onPaste:function(g){var y=this||O;y.isFull()||y.isInputHidden||y.isLocked?g.preventDefault():y.settings.splitOn&&setTimeout((function(){var g=y.$control_input.val();if(g.match(y.settings.splitOn))for(var O=h.trim(g).split(y.settings.splitOn),$=0,C=O.length;$<C;$++)y.createItem(O[$])}),0)},onKeyPress:function(h){if((this||O).isLocked)return h&&h.preventDefault();var g=String.fromCharCode(h.keyCode||h.which);return(this||O).settings.create&&"multi"===(this||O).settings.mode&&g===(this||O).settings.delimiter?(this.createItem(),h.preventDefault(),!1):void 0},onKeyDown:function(h){var g=(h.target,(this||O).$control_input[0],this||O);if(!g.isLocked){switch(h.keyCode){case 65:if(g.isCmdDown)return void g.selectAll();break;case 27:return void(g.isOpen&&(h.preventDefault(),h.stopPropagation(),g.close()));case 78:if(!h.ctrlKey||h.altKey)break;case 40:if(!g.isOpen&&g.hasOptions)g.open();else if(g.$activeOption){g.ignoreHover=!0;var y=g.getAdjacentOption(g.$activeOption,1);y.length&&g.setActiveOption(y,!0,!0)}return void h.preventDefault();case 80:if(!h.ctrlKey||h.altKey)break;case 38:if(g.$activeOption){g.ignoreHover=!0;var C=g.getAdjacentOption(g.$activeOption,-1);C.length&&g.setActiveOption(C,!0,!0)}return void h.preventDefault();case 13:return void(g.isOpen&&g.$activeOption&&(g.onOptionSelect({currentTarget:g.$activeOption}),h.preventDefault()));case 37:return void g.advanceSelection(-1,h);case 39:return void g.advanceSelection(1,h);case 9:return g.settings.selectOnTab&&g.isOpen&&g.$activeOption&&(g.onOptionSelect({currentTarget:g.$activeOption}),g.isFull()||h.preventDefault()),void(g.settings.create&&g.createItem()&&h.preventDefault());case 8:case 46:return void g.deleteSelection(h)}return!g.isFull()&&!g.isInputHidden||($?h.metaKey:h.ctrlKey)?void 0:void h.preventDefault()}9!==h.keyCode&&h.preventDefault()},onKeyUp:function(h){var g=this||O;if(g.isLocked)return h&&h.preventDefault();var y=g.$control_input.val()||"";g.lastValue!==y&&(g.lastValue=y,g.onSearchChange(y),g.refreshOptions(),g.trigger("type",y))},onSearchChange:function(h){var g=this||O,y=g.settings.load;y&&(g.loadedSearches.hasOwnProperty(h)||(g.loadedSearches[h]=!0,g.load((function(O){y.apply(g,[h,O])}))))},onFocus:function(h){var g=this||O,y=g.isFocused;if(g.isDisabled)return g.blur(),h&&h.preventDefault(),!1;g.ignoreFocus||(g.isFocused=!0,"focus"===g.settings.preload&&g.onSearchChange(""),y||g.trigger("focus"),g.$activeItems.length||(g.showInput(),g.setActiveItem(null),g.refreshOptions(!!g.settings.openOnFocus)),g.refreshState())},onBlur:function(h,g){var y=this||O;if(y.isFocused&&(y.isFocused=!1,!y.ignoreFocus)){if(!y.ignoreBlur&&document.activeElement===y.$dropdown_content[0])return y.ignoreBlur=!0,void y.onFocus(h);var d=function(){y.close(),y.setTextboxValue(""),y.setActiveItem(null),y.setActiveOption(null),y.setCaret(y.items.length),y.refreshState(),g&&g.focu
1s&&g.focus(),y.isBlurring=!1,y.ignoreFocus=!1,y.trigger("blur")};y.isBlurring=!0,y.ignoreFocus=!0,y.settings.create&&y.settings.createOnBlur?y.createItem(null,!1,d):d()}},onOptionHover:function(h){(this||O).ignoreHover||this.setActiveOption(h.currentTarget,!1)},onOptionSelect:function(g){var y,$,C=this||O;g.preventDefault&&(g.preventDefault(),g.stopPropagation()),$=h(g.currentTarget),$.hasClass("create")?C.createItem(null,(function(){C.settings.closeAfterSelect&&C.close()})):void 0!==(y=$.attr("data-value"))&&(C.lastQuery=null,C.setTextboxValue(""),C.addItem(y),C.settings.closeAfterSelect?C.close():!C.settings.hideSelected&&g.type&&/mouse/.test(g.type)&&C.setActiveOption(C.getOption(y)))},onItemSelect:function(h){var g=this||O;g.isLocked||"multi"===g.settings.mode&&(h.preventDefault(),g.setActiveItem(h.currentTarget,h))},load:function(h){var g=this||O,y=g.$wrapper.addClass(g.settings.loadingClass);g.loading++,h.apply(g,[function(h){g.loading=Math.max(g.loading-1,0),h&&h.length&&(g.addOption(h),g.refreshOptions(g.isFocused&&!g.isInputHidden)),g.loading||y.removeClass(g.settings.loadingClass),g.trigger("load",h)}])},setTextboxValue:function(h){var g=(this||O).$control_input;g.val()!==h&&(g.val(h).triggerHandler("update"),(this||O).lastValue=h)},getValue:function(){return 1===(this||O).tagType&&(this||O).$input.attr("multiple")?(this||O).items:(this||O).items.join((this||O).settings.delimiter)},setValue:function(h,g){p(this||O,g?[]:["change"],(function(){this.clear(g),this.addItems(h,g)}))},setActiveItem:function(g,y){var $,C,x,I,S,_,F,D,A=this||O;if("single"!==A.settings.mode){if(g=h(g),!g.length)return h(A.$activeItems).removeClass("active"),A.$activeItems=[],void(A.isFocused&&A.showInput());if("mousedown"===($=y&&y.type.toLowerCase())&&A.isShiftDown&&A.$activeItems.length){for(D=A.$control.children(".active:last"),I=Array.prototype.indexOf.apply(A.$control[0].childNodes,[D[0]]),S=Array.prototype.indexOf.apply(A.$control[0].childNodes,[g[0]]),I>S&&(F=I,I=S,S=F),C=I;C<=S;C++)_=A.$control[0].childNodes[C],-1===A.$activeItems.indexOf(_)&&(h(_).addClass("active"),A.$activeItems.push(_));y.preventDefault()}else"mousedown"===$&&A.isCtrlDown||"keydown"===$&&(this||O).isShiftDown?g.hasClass("active")?(x=A.$activeItems.indexOf(g[0]),A.$activeItems.splice(x,1),g.removeClass("active")):A.$activeItems.push(g.addClass("active")[0]):(h(A.$activeItems).removeClass("active"),A.$activeItems=[g.addClass("active")[0]]);A.hideInput(),(this||O).isFocused||A.focus()}},setActiveOption:function(g,y,$){var C,x,I,S,_,F=this||O;F.$activeOption&&F.$activeOption.removeClass("active"),F.$activeOption=null,g=h(g),g.length&&(F.$activeOption=g.addClass("active"),!y&&j(y)||(C=F.$dropdown_content.height(),x=F.$activeOption.outerHeight(!0),y=F.$dropdown_content.scrollTop()||0,I=F.$activeOption.offset().top-F.$dropdown_content.offset().top+y,S=I,_=I-C+x,I+x>C+y?F.$dropdown_content.stop().animate({scrollTop:_},$?F.settings.scrollDuration:0):I<y&&F.$dropdown_content.stop().animate({scrollTop:S},$?F.settings.scrollDuration:0)))},selectAll:function(){var h=this||O;"single"!==h.settings.mode&&(h.$activeItems=Array.prototype.slice.apply(h.$control.children(":not(input)").addClass("active")),h.$activeItems.length&&(h.hideInput(),h.close()),h.focus())},hideInput:function(){var h=this||O;h.setTextboxValue(""),h.$control_input.css({opacity:0,position:"absolute",left:h.rtl?1e4:-1e4}),h.isInputHidden=!0},showInput:function(){(this||O).$control_input.css({opacity:1,position:"relative",left:0}),(this||O).isInputHidden=!1},focus:function(){var h=this||O;h.isDisabled||(h.ignoreFocus=!0,h.$control_input[0].focus(),window.setTimeout((function(){h.ignoreFocus=!1,h.onFocus()}),0))},blur:function(h){(this||O).$control_input[0].blur(),this.onBlur(null,h)},getScoreFunction:function(h){return(this||O).sifter.getScoreFunction(h,this.getSearchOptions())},getSearchOptions:function(){var h=(this||O).settings,g=h.sortField;return"string"==typeof g&&(g=[{field:g}]),{fields:h.searchField,conjunction:h.searchConjunction,sort:g,nesting:h.nesting}},search:function(g){var y,$,C,x=this||O,I=x.settings,S=this.getSearchOptions();if(I.score&&"function"!=typeof(C=x.settings.score.apply(this||O,[g])))throw new Error('Selectize "score" setting must be a function that returns a function');if(g!==x.lastQuery?(x.lastQuery=g,$=x.sifter.search(g,h.extend(S,{score:C})),x.currentResults=$):$=h.extend(!0,{},x.currentResults),I.hideSelected)for(y=$.items.length-1;y>=0;y--)-1!==x.items.indexOf(k($.items[y].id))&&$.items.splice(y,1);return $},refreshOptions:function(g){var y,$,C,x,I,S,_,F,D,A,P,z,T,N,E,H;void 0===g&&(g=!0);var L=this||O,V=h.trim(L.$control_input.val()),K=L.search(V),R=L.$dropdown_content,B=L.$activeOption&&k(L.$activeOption.attr("data-value"));for(x=K.items.length,"number"==typeof L.settings.maxOptions&&(x=Math.min(x,L.settings.maxOptions)),I={},S=[],y=0;y<x;y++)for(_=L.options[K.items[y].id],F=L.render("option",_),D=_[L.settings.optgroupField]||"",A=h.isArray(D)?D:[D],$=0,C=A&&A.length;$<C;
1$++)D=A[$],L.optgroups.hasOwnProperty(D)||(D=""),I.hasOwnProperty(D)||(I[D]=document.createDocumentFragment(),S.push(D)),I[D].appendChild(F);for((this||O).settings.lockOptgroupOrder&&S.sort((function(h,g){return(L.optgroups[h].$order||0)-(L.optgroups[g].$order||0)})),P=document.createDocumentFragment(),y=0,x=S.length;y<x;y++)D=S[y],L.optgroups.hasOwnProperty(D)&&I[D].childNodes.length?(z=document.createDocumentFragment(),z.appendChild(L.render("optgroup_header",L.optgroups[D])),z.appendChild(I[D]),P.appendChild(L.render("optgroup",h.extend({},L.optgroups[D],{html:v(z),dom:z})))):P.appendChild(I[D]);if(R.html(P),L.settings.highlight&&(R.removeHighlight(),K.query.length&&K.tokens.length))for(y=0,x=K.tokens.length;y<x;y++)d(R,K.tokens[y].regex);if(!L.settings.hideSelected)for(y=0,x=L.items.length;y<x;y++)L.getOption(L.items[y]).addClass("selected");T=L.canCreate(V),T&&(R.prepend(L.render("option_create",{input:V})),H=h(R[0].childNodes[0])),L.hasOptions=K.items.length>0||T,L.hasOptions?(K.items.length>0?(E=B&&L.getOption(B),E&&E.length?N=E:"single"===L.settings.mode&&L.items.length&&(N=L.getOption(L.items[0])),N&&N.length||(N=H&&!L.settings.addPrecedence?L.getAdjacentOption(H,1):R.find("[data-selectable]:first"))):N=H,L.setActiveOption(N),g&&!L.isOpen&&L.open()):(L.setActiveOption(null),g&&L.isOpen&&L.close())},addOption:function(g){var y,$,C,x=this||O;if(h.isArray(g))for(y=0,$=g.length;y<$;y++)x.addOption(g[y]);else(C=x.registerOption(g))&&(x.userOptions[C]=!0,x.lastQuery=null,x.trigger("option_add",C,g))},registerOption:function(h){var g=k(h[(this||O).settings.valueField]);return void 0!==g&&null!==g&&!(this||O).options.hasOwnProperty(g)&&(h.$order=h.$order||++(this||O).order,(this||O).options[g]=h,g)},registerOptionGroup:function(h){var g=k(h[(this||O).settings.optgroupValueField]);return!!g&&(h.$order=h.$order||++(this||O).order,(this||O).optgroups[g]=h,g)},addOptionGroup:function(h,g){g[(this||O).settings.optgroupValueField]=h,(h=this.registerOptionGroup(g))&&this.trigger("optgroup_add",h,g)},removeOptionGroup:function(h){(this||O).optgroups.hasOwnProperty(h)&&(delete(this||O).optgroups[h],(this||O).renderCache={},this.trigger("optgroup_remove",h))},clearOptionGroups:function(){(this||O).optgroups={},(this||O).renderCache={},this.trigger("optgroup_clear")},updateOption:function(g,y){var $,C,x,I,S,_,F,D=this||O;if(g=k(g),x=k(y[D.settings.valueField]),null!==g&&D.options.hasOwnProperty(g)){if("string"!=typeof x)throw new Error("Value must be set in option data");F=D.options[g].$order,x!==g&&(delete D.options[g],-1!==(I=D.items.indexOf(g))&&D.items.splice(I,1,x)),y.$order=y.$order||F,D.options[x]=y,S=D.renderCache.item,_=D.renderCache.option,S&&(delete S[g],delete S[x]),_&&(delete _[g],delete _[x]),-1!==D.items.indexOf(x)&&($=D.getItem(g),C=h(D.render("item",y)),$.hasClass("active")&&C.addClass("active"),$.replaceWith(C)),D.lastQuery=null,D.isOpen&&D.refreshOptions(!1)}},removeOption:function(h,g){var y=this||O;h=k(h);var $=y.renderCache.item,C=y.renderCache.option;$&&delete $[h],C&&delete C[h],delete y.userOptions[h],delete y.options[h],y.lastQuery=null,y.trigger("option_remove",h),y.removeItem(h,g)},clearOptions:function(){var g=this||O;g.loadedSearches={},g.userOptions={},g.renderCache={};var y=g.options;h.each(g.options,(function(h,O){-1==g.items.indexOf(h)&&delete y[h]})),g.options=g.sifter.items=y,g.lastQuery=null,g.trigger("option_clear")},getOption:function(h){return this.getElementWithValue(h,(this||O).$dropdown_content.find("[data-selectable]"))},getAdjacentOption:function(g,y){var $=(this||O).$dropdown.find("[data-selectable]"),C=$.index(g)+y;return C>=0&&C<$.length?$.eq(C):h()},getElementWithValue:function(g,y){if(void 0!==(g=k(g))&&null!==g)for(var O=0,$=y.length;O<$;O++)if(y[O].getAttribute("data-value")===g)return h(y[O]);return h()},getItem:function(h){return this.getElementWithValue(h,(this||O).$control.children())},addItems:function(g,y){(this||O).buffer=document.createDocumentFragment();for(var $=(this||O).$control[0].childNodes,C=0;C<$.length;C++)(this||O).buffer.appendChild($[C]);for(var x=h.isArray(g)?g:[g],C=0,I=x.length;C<I;C++)(this||O).isPending=C<I-1,this.addItem(x[C],y);var S=(this||O).$control[0];S.insertBefore((this||O).buffer,S.firstChild),(this||O).buffer=null},addItem:function(g,y){p(this||O,y?[]:["change"],(function(){var $,C,x,I,S,_=this||O,F=_.settings.mode;g=k(g),-1===_.items.indexOf(g)?_.options.hasOwnProperty(g)&&("single"===F&&_.clear(y),"multi"===F&&_.isFull()||($=h(_.render("item",_.options[g])),S=_.isFull(),_.items.splice(_.caretPos,0,g),_.insertAtCaret($),(!_.isPending||!S&&_.isFull())&&_.refreshState(),_.isSetup&&(x=_.$dropdown_content.find("[data-selectable]"),_.isPending||(C=_.getOption(g),I=_.getAdjacentOption(C,1).attr("data-value"),_.refreshOptions(_.isFocused&&"single"!==F),I&&_.setActiveOption(_.getOption(I))),!x.length||_.isFull()?_.close():_.isPending||_.positionDropdown(),_.updatePlaceholder(),_.trigger("item_add",g,$),_.isPending||_.updateOriginalInput({silent:y})))):"single"===F&&_.close()}))},removeItem:function(g,y){var $,C,x,I=this||O;$=g instanceof h?g:I.getItem(g),g=k($.attr("data-value")),-1!==(C=I.items.indexOf(g))&&($.remove(),$.hasClass("active")&&(x=I.$activeItems.indexOf($[0]),I.$activeItems.splice(
1x,1)),I.items.splice(C,1),I.lastQuery=null,!I.settings.persist&&I.userOptions.hasOwnProperty(g)&&I.removeOption(g,y),C<I.caretPos&&I.setCaret(I.caretPos-1),I.refreshState(),I.updatePlaceholder(),I.updateOriginalInput({silent:y}),I.positionDropdown(),I.trigger("item_remove",g,$))},createItem:function(g,y){var $=this||O,C=$.caretPos;g=g||h.trim($.$control_input.val()||"");var x=arguments[arguments.length-1];if("function"!=typeof x&&(x=function(){}),"boolean"!=typeof y&&(y=!0),!$.canCreate(g))return x(),!1;$.lock();var I="function"==typeof $.settings.create?(this||O).settings.create:function(h){var g={};return g[$.settings.labelField]=h,g[$.settings.valueField]=h,g},S=n((function(h){if($.unlock(),!h||"object"!=typeof h)return x();var g=k(h[$.settings.valueField]);if("string"!=typeof g)return x();$.setTextboxValue(""),$.addOption(h),$.setCaret(C),$.addItem(g),$.refreshOptions(y&&"single"!==$.settings.mode),x(h)})),_=I.apply(this||O,[g,S]);return void 0!==_&&S(_),!0},refreshItems:function(){(this||O).lastQuery=null,(this||O).isSetup&&this.addItem((this||O).items),this.refreshState(),this.updateOriginalInput()},refreshState:function(){this.refreshValidityState(),this.refreshClasses()},refreshValidityState:function(){if(!(this||O).isRequired)return!1;var h=!(this||O).items.length;(this||O).isInvalid=h,(this||O).$control_input.prop("required",h),(this||O).$input.prop("required",!h)},refreshClasses:function(){var g=this||O,y=g.isFull(),$=g.isLocked;g.$wrapper.toggleClass("rtl",g.rtl),g.$control.toggleClass("focus",g.isFocused).toggleClass("disabled",g.isDisabled).toggleClass("required",g.isRequired).toggleClass("invalid",g.isInvalid).toggleClass("locked",$).toggleClass("full",y).toggleClass("not-full",!y).toggleClass("input-active",g.isFocused&&!g.isInputHidden).toggleClass("dropdown-active",g.isOpen).toggleClass("has-options",!h.isEmptyObject(g.options)).toggleClass("has-items",g.items.length>0),g.$control_input.data("grow",!y&&!$)},isFull:function(){return null!==(this||O).settings.maxItems&&(this||O).items.length>=(this||O).settings.maxItems},updateOriginalInput:function(h){var g,y,$,C,x=this||O;if(h=h||{},1===x.tagType){for($=[],g=0,y=x.items.length;g<y;g++)C=x.options[x.items[g]][x.settings.labelField]||"",$.push('<option value="'+l(x.items[g])+'" selected="selected">'+l(C)+"</option>");$.length||(this||O).$input.attr("multiple")||$.push('<option value="" selected="selected"></option>'),x.$input.html($.join(""))}else x.$input.val(x.getValue()),x.$input.attr("value",x.$input.val());x.isSetup&&(h.silent||x.trigger("change",x.$input.val()))},updatePlaceholder:function(){if((this||O).settings.placeholder){var h=(this||O).$control_input;(this||O).items.length?h.removeAttr("placeholder"):h.attr("placeholder",(this||O).settings.placeholder),h.triggerHandler("update",{force:!0})}},open:function(){var h=this||O;h.isLocked||h.isOpen||"multi"===h.settings.mode&&h.isFull()||(h.focus(),h.isOpen=!0,h.refreshState(),h.$dropdown.css({visibility:"hidden",display:"block"}),h.positionDropdown(),h.$dropdown.css({visibility:"visible"}),h.trigger("dropdown_open",h.$dropdown))},close:function(){var h=this||O,g=h.isOpen;"single"===h.settings.mode&&h.items.length&&(h.hideInput(),h.isBlurring||h.$control_input.blur()),h.isOpen=!1,h.$dropdown.hide(),h.setActiveOption(null),h.refreshState(),g&&h.trigger("dropdown_close",h.$dropdown)},positionDropdown:function(){var h=(this||O).$control,g="body"===(this||O).settings.dropdownParent?h.offset():h.position();g.top+=h.outerHeight(!0),(this||O).$dropdown.css({width:h[0].getBoundingClientRect().width,top:g.top,left:g.left})},clear:function(h){var g=this||O;g.items.length&&(g.$control.children(":not(input)").remove(),g.items=[],g.lastQuery=null,g.setCaret(0),g.setActiveItem(null),g.updatePlaceholder(),g.updateOriginalInput({silent:h}),g.refreshState(),g.showInput(),g.trigger("clear"))},insertAtCaret:function(h){var g=Math.min((this||O).caretPos,(this||O).items.length),y=h[0],$=(this||O).buffer||(this||O).$control[0];0===g?$.insertBefore(y,$.firstChild):$.insertBefore(y,$.childNodes[g]),this.setCaret(g+1)},deleteSelection:function(g){var y,$,C,x,I,S,_,F,D,A=this||O;if(C=g&&8===g.keyCode?-1:1,x=r(A.$control_input[0]),A.$activeOption&&!A.settings.hideSelected&&(_=A.getAdjacentOption(A.$activeOption,-1).attr("data-value")),I=[],A.$activeItems.length){for(D=A.$control.children(".active:"+(C>0?"last":"first")),S=A.$control.children(":not(input)").index(D),C>0&&S++,y=0,$=A.$activeItems.length;y<$;y++)I.push(h(A.$activeItems[y]).attr("data-value"));g&&(g.preventDefault(),g.stopPropagation())}else(A.isFocused||"single"===A.settings.mode)&&A.items.length&&(C<0&&0===x.start&&0===x.length?I.push(A.items[A.caretPos-1]):C>0&&x.start===A.$control_input.val().length&&I.push(A.items[A.caretPos]));if(!I.length||"function"==typeof A.settings.onDelete&&!1===A.settings.onDelete.apply(A,[I]))return!1;for(void 0!==S&&A.setCaret(S);I.length;)A.removeItem(I.pop());
1return A.showInput(),A.positionDropdown(),A.refreshOptions(!0),_&&(F=A.getOption(_),F.length&&A.setActiveOption(F)),!0},advanceSelection:function(h,g){var y,$,C,x,I,S=this||O;0!==h&&(S.rtl&&(h*=-1),y=h>0?"last":"first",$=r(S.$control_input[0]),S.isFocused&&!S.isInputHidden?(x=S.$control_input.val().length,(h<0?0===$.start&&0===$.length:$.start===x)&&!x&&S.advanceCaret(h,g)):(I=S.$control.children(".active:"+y),I.length&&(C=S.$control.children(":not(input)").index(I),S.setActiveItem(null),S.setCaret(h>0?C+1:C))))},advanceCaret:function(h,g){var y,$,C=this||O;0!==h&&(y=h>0?"next":"prev",C.isShiftDown?($=C.$control_input[y](),$.length&&(C.hideInput(),C.setActiveItem($),g&&g.preventDefault())):C.setCaret(C.caretPos+h))},setCaret:function(g){var y=this||O;if(g="single"===y.settings.mode?y.items.length:Math.max(0,Math.min(y.items.length,g)),!y.isPending){var $,C,x,I;for(x=y.$control.children(":not(input)"),$=0,C=x.length;$<C;$++)I=h(x[$]).detach(),$<g?y.$control_input.before(I):y.$control.append(I)}y.caretPos=g},lock:function(){this.close(),(this||O).isLocked=!0,this.refreshState()},unlock:function(){(this||O).isLocked=!1,this.refreshState()},disable:function(){var h=this||O;h.$input.prop("disabled",!0),h.$control_input.prop("disabled",!0).prop("tabindex",-1),h.isDisabled=!0,h.lock()},enable:function(){var h=this||O;h.$input.prop("disabled",!1),h.$control_input.prop("disabled",!1).prop("tabindex",h.tabIndex),h.isDisabled=!1,h.unlock()},destroy:function(){var g=this||O,y=g.eventNS,$=g.revertSettings;g.trigger("destroy"),g.off(),g.$wrapper.remove(),g.$dropdown.remove(),g.$input.html("").append($.$children).removeAttr("tabindex").removeClass("selectized").attr({tabindex:$.tabindex}).show(),g.$control_input.removeData("grow"),g.$input.removeData("selectize"),0==--w.count&&w.$testInput&&(w.$testInput.remove(),w.$testInput=void 0),h(window).off(y),h(document).off(y),h(document.body).off(y),delete g.$input[0].selectize},render:function(g,y){var $,C,x="",I=!1,S=this||O;return"option"!==g&&"item"!==g||($=k(y[S.settings.valueField]),I=!!$),I&&(j(S.renderCache[g])||(S.renderCache[g]={}),S.renderCache[g].hasOwnProperty($))?S.renderCache[g][$]:(x=h(S.settings.render[g].apply(this||O,[y,l])),"option"===g||"option_create"===g?y[S.settings.disabledField]||x.attr("data-selectable",""):"optgroup"===g&&(C=y[S.settings.optgroupValueField]||"",x.attr("data-group",C),y[S.settings.disabledField]&&x.attr("data-disabled","")),"option"!==g&&"item"!==g||x.attr("data-value",$||""),I&&(S.renderCache[g][$]=x[0]),x[0])},clearCache:function(h){var g=this||O;void 0===h?g.renderCache={}:delete g.renderCache[h]},canCreate:function(h){var g=this||O;if(!g.settings.create)return!1;var y=g.settings.createFilter;return h.length&&("function"!=typeof y||y.apply(g,[h]))&&("string"!=typeof y||new RegExp(y).test(h))&&(!(y instanceof RegExp)||y.test(h))}}),w.count=0,w.defaults={options:[],optgroups:[],plugins:[],delimiter:",",splitOn:null,persist:!0,diacritics:!0,create:!1,createOnBlur:!1,createFilter:null,highlight:!0,openOnFocus:!0,maxOptions:1e3,maxItems:null,hideSelected:null,addPrecedence:!1,selectOnTab:!1,preload:!1,allowEmptyOption:!1,closeAfterSelect:!1,scrollDuration:60,loadThrottle:300,loadingClass:"loading",dataAttr:"data-data",optgroupField:"optgroup",valueField:"value",labelField:"text",disabledField:"disabled",optgroupLabelField:"label",optgroupValueField:"value",lockOptgroupOrder:!1,sortField:"$order",searchField:["text"],searchConjunction:"and",mode:null,wrapperClass:"selectize-control",inputClass:"selectize-input",dropdownClass:"selectize-dropdown",dropdownContentClass:"selectize-dropdown-content",dropdownParent:null,copyClassesToDropdown:!0,render:{}},h.fn.selectize=function(g){var y=h.fn.selectize.defaults,$=h.extend({},y,g),C=$.dataAttr,x=$.labelField,I=$.valueField,S=$.disabledField,_=$.optgroupField,F=$.optgroupLabelField,D=$.optgroupValueField,m=function(g,y){var O,S,_,F,D=g.attr(C);if(D)for(y.options=JSON.parse(D),O=0,S=y.options.length;O<S;O++)y.items.push(y.options[O][I]);else{var A=h.trim(g.val()||"");if(!$.allowEmptyOption&&!A.length)return;for(_=A.split($.delimiter),O=0,S=_.length;O<S;O++)F={},F[x]=_[O],F[I]=_[O],y.options.push(F);y.items=_}},n=function(g,y){var O,A,P,z,T=y.options,N={},s=function(h){var g=C&&h.attr(C);return"string"==typeof g&&g.length?JSON.parse(g):null},t=function(g,O){g=h(g);var C=k(g.val());
1if(C||$.allowEmptyOption)if(N.hasOwnProperty(C)){if(O){var F=N[C][_];F?h.isArray(F)?F.push(O):N[C][_]=[F,O]:N[C][_]=O}}else{var D=s(g)||{};D[x]=D[x]||g.text(),D[I]=D[I]||C,D[S]=D[S]||g.prop("disabled"),D[_]=D[_]||O,N[C]=D,T.push(D),g.is(":selected")&&y.items.push(C)}};for(y.maxItems=g.attr("multiple")?null:1,z=g.children(),O=0,A=z.length;O<A;O++)P=z[O].tagName.toLowerCase(),"optgroup"===P?function(g){var O,$,C,x,I;for(g=h(g),C=g.attr("label"),C&&(x=s(g)||{},x[F]=C,x[D]=C,x[S]=g.prop("disabled"),y.optgroups.push(x)),I=h("option",g),O=0,$=I.length;O<$;O++)t(I[O],C)}(z[O]):"option"===P&&t(z[O])};return this.each((function(){if(!(this||O).selectize){var C=h(this||O),x=(this||O).tagName.toLowerCase(),I=C.attr("placeholder")||C.attr("data-placeholder");I||$.allowEmptyOption||(I=C.children('option[value=""]').text());var S={placeholder:I,options:[],optgroups:[],items:[]};"select"===x?n(C,S):m(C,S),new w(C,h.extend(!0,{},y,S,g))}}))},h.fn.selectize.defaults=w.defaults,h.fn.selectize.support={validity:I},w.define("drag_drop",(function(g){if(!h.fn.sortable)throw new Error('The "drag_drop" plugin requires jQuery UI "sortable".');if("multi"===(this||O).settings.mode){var y=this||O;y.lock=function(){var h=y.lock;return function(){var g=y.$control.data("sortable");return g&&g.disable(),h.apply(y,arguments)}}(),y.unlock=function(){var h=y.unlock;return function(){var g=y.$control.data("sortable");return g&&g.enable(),h.apply(y,arguments)}}(),y.setup=function(){var g=y.setup;return function(){g.apply(this||O,arguments);var $=y.$control.sortable({items:"[data-value]",forcePlaceholderSize:!0,disabled:y.isLocked,start:function(h,g){g.placeholder.css("width",g.helper.css("width")),$.css({overflow:"visible"})},stop:function(){$.css({overflow:"hidden"});var g=y.$activeItems?y.$activeItems.slice():null,C=[];$.children("[data-value]").each((function(){C.push(h(this||O).attr("data-value"))})),y.setValue(C),y.setActiveItem(g)}})}}()}})),w.define("dropdown_header",(function(g){var y=this||O;g=h.extend({title:"Untitled",headerClass:"selectize-dropdown-header",titleRowClass:"selectize-dropdown-header-title",labelClass:"selectize-dropdown-header-label",closeClass:"selectize-dropdown-header-close",html:function(h){return'<div class="'+h.headerClass+'"><div class="'+h.titleRowClass+'"><span class="'+h.labelClass+'">'+h.title+'</span><a href="javascript:void(0)" class="'+h.closeClass+'">&times;</a></div></div>'}},g),y.setup=function(){var O=y.setup;return function(){O.apply(y,arguments),y.$dropdown_header=h(g.html(g)),y.$dropdown.prepend(y.$dropdown_header)}}()})),w.define("optgroup_columns",(function(g){var y=this||O;g=h.extend({equalizeWidth:!0,equalizeHeight:!0},g),(this||O).getAdjacentOption=function(g,y){var O=g.closest("[data-group]").find("[data-selectable]"),$=O.index(g)+y;return $>=0&&$<O.length?O.eq($):h()},(this||O).onKeyDown=function(){var h=y.onKeyDown;return function(g){var $,C,x,I;return!(this||O).isOpen||37!==g.keyCode&&39!==g.keyCode?h.apply(this||O,arguments):(y.ignoreHover=!0,I=(this||O).$activeOption.closest("[data-group]"),$=I.find("[data-selectable]").index((this||O).$activeOption),I=37===g.keyCode?I.prev("[data-group]"):I.next("[data-group]"),x=I.find("[data-selectable]"),C=x.eq(Math.min(x.length-1,$)),void(C.length&&this.setActiveOption(C)))}}();var d=function(){var h,g=d.width,y=document;return void 0===g&&(h=y.createElement("div"),h.innerHTML='<div style="width:50px;height:50px;position:absolute;left:-50px;top:-50px;overflow:auto;"><div style="width:1px;height:100px;"></div></div>',h=h.firstChild,y.body.appendChild(h),g=d.width=h.offsetWidth-h.clientWidth,y.body.removeChild(h)),g},e=function(){var O,$,C,x,I,S,_;if(_=h("[data-group]",y.$dropdown_content),($=_.length)&&y.$dropdown_content.width()){if(g.equalizeHeight){for(C=0,O=0;O<$;O++)C=Math.max(C,_.eq(O).height());_.css({height:C})}g.equalizeWidth&&(S=y.$dropdown_content.innerWidth()-d(),x=Math.round(S/$),_.css({width:x}),$>1&&(I=S-x*($-1),_.eq($-1).css({width:I})))}};(g.equalizeHeight||g.equalizeWidth)&&(S.after(this||O,"positionDropdown",e),S.after(this||O,"refreshOptions",e))})),w.define("remove_button",(function(g){g=h.extend({label:"&times;",title:"Remove",className:"remove",append:!0},g);"single"!==(this||O).settings.mode?!function(g,y){var O=g,$='<a href="javascript:void(0)" class="'+y.className+'" tabindex="-1" title="'+l(y.title)+'">'+y.label+"</a>",f=function(h,g){var y=h.search(/(<\/[^>]+>\s*)$/);return h.substring(0,y)+g+h.substring(y)};g.setup=function(){var C=O.setup;return function(){if(y.append){var x=O.settings.render.item;O.settings.render.item=function(h){return f(x.apply(g,arguments),$)}}C.apply(g,arguments),g.$control.on("click","."+y.className,(function(g){if(g.preventDefault(),!O.isLocked){var y=h(g.currentTarget).parent();O.setActiveItem(y),O.deleteSelection()&&O.setCaret(O.items.length)}}))}}()}(this||O,g):function(g,y){y.className="remove-single";var O=g,$='<a href="javascript:void(0)" class="'+y.className+'" tabindex="-1" title="'+l(y.title)+'">'+y.label+"</a>",f=function(g,y){return h("<span>").append(g).append(y)};g.setup=function(){var C=O.setup;return function(){if(y.append){var x=h(O.$input.context).attr("id"),I=(h("#"+x),O.settings.render.item);O.settings.render.item=function(h){return f(I.apply(g,arguments),$)}}C.apply(g,arguments),g.$control.on("click","."+y.className,(function(h){h.preventDefault(),O.isLocked||O.clear()}
1))}}()}(this||O,g)})),w.define("restore_on_backspace",(function(h){var g=this||O;h.text=h.text||function(h){return h[(this||O).settings.labelField]},(this||O).onKeyDown=function(){var y=g.onKeyDown;return function(g){var $,C;return 8===g.keyCode&&""===(this||O).$control_input.val()&&!(this||O).$activeItems.length&&($=(this||O).caretPos-1)>=0&&$<(this||O).items.length?(C=(this||O).options[(this||O).items[$]],this.deleteSelection(g)&&(this.setTextboxValue(h.text.apply(this||O,[C])),this.refreshOptions(!0)),void g.preventDefault()):y.apply(this||O,arguments)}}()})),w}));var x=C;export default x;
2
3//

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.