diff --git a/dist/selectivity-full.js b/dist/selectivity-full.js index 9648c07..2e087f7 100644 --- a/dist/selectivity-full.js +++ b/dist/selectivity-full.js @@ -4431,6 +4431,9 @@ Selectivity.Templates = { * mode - Mode in which select exists, single or multiple. */ selectCompliance: function(options) { + if (options.mode === 'multiple' && options.name.slice(-2) !== '[]') { + options.name += '[]'; + } return (''); }, diff --git a/dist/selectivity-full.min.js b/dist/selectivity-full.min.js index 64a0697..ea52347 100644 --- a/dist/selectivity-full.min.js +++ b/dist/selectivity-full.min.js @@ -1,2 +1,2 @@ -!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;"undefined"!=typeof window?e=window:"undefined"!=typeof global?e=global:"undefined"!=typeof self&&(e=self),e.selectivity=t()}}(function(){return function t(e,i,s){function n(o,l){if(!i[o]){if(!e[o]){var u="function"==typeof require&&require;if(!l&&u)return u(o,!0);if(r)return r(o,!0);var h=new Error("Cannot find module '"+o+"'");throw h.code="MODULE_NOT_FOUND",h}var a=i[o]={exports:{}};e[o][0].call(a.exports,function(t){var i=e[o][1][t];return n(i?i:t)},a,a.exports,t,e,i,s)}return i[o].exports}for(var r="function"==typeof require&&require,o=0;o=n||n>e){var c=h;u=h=void 0,c&&(a=s(),o=t.apply(null,r),u||(r=null))}else u=setTimeout(i,n)}function n(){return r=arguments,l=s(),h=!0,u||(u=setTimeout(i,e)),o}var r,o,l,u,h,a=0;return e=0>e?0:+e||0,n}var s=Date.now;e.exports=i},{}],3:[function(t,e){"use strict";function i(t){return n[t]}function s(t){return t?String(t).replace(r,i):""}var n={"&":"&","<":"<",">":">",'"':""","'":"'"},r=new RegExp("["+Object.keys(n).join("")+"]","g");e.exports=s},{}],4:[function(t){"use strict";var e=window.jQuery||window.Zepto,i=t(2),s=t(7);t(12),s.OptionListeners.unshift(function(t,n){var r=n.ajax;if(r&&r.url){var o=r.formatError||s.Locale.ajaxError,l=r.minimumInputLength||0,u=r.params,h=r.processItem||function(t){return t},a=r.quietMillis||0,c=r.results||function(t){return{results:t,more:!1}},d=r.transport||e.ajax;a&&(d=i(d,a)),n.query=function(i){var n=i.offset,a=i.term;if(a.length-1?"&":"?")+e.param(u(a,n)));var f=r.success,v=r.error;d(e.extend({},r,{url:p,success:function(t,e,s){f&&f(t,e,s);var r=c(t,n);r.results=r.results.map(h),i.callback(r)},error:function(t,e,s){v&&v(t,e,s),i.error(o(a,t,e,s),{escape:!1})}}))}}}})},{12:12,2:2,7:7,jquery:"jquery"}],5:[function(t){"use strict";var e=t(7),i=0;e.OptionListeners.push(function(t,e){var s=e.query;s&&(e.query=function(t){i++;var e=i,n=t.callback,r=t.error;t.callback=function(){e===i&&n.apply(null,arguments)},t.error=function(){e===i&&r.apply(null,arguments)},s(t)})})},{7:7}],6:[function(t){"use strict";var e=window.jQuery||window.Zepto,i=t(9);e.extend(i.prototype,{removeCloseHandler:function(){this._$backdrop&&!this.parentMenu&&(this._$backdrop.remove(),this._$backdrop=null)},setupCloseHandler:function(){var t;this.parentMenu?t=this.parentMenu._$backdrop:(t=e("
").addClass("selectivity-backdrop"),e("body").append(t)),t.on("click",this.close.bind(this)),this._$backdrop=t}})},{9:9,jquery:"jquery"}],7:[function(t,e){"use strict";function i(t,e){var i;return this.each(function(){var r=this.selectivity;if(r){if("string"!==n.type(t)&&(e=t,t="setOptions"),"function"!==n.type(r[t]))throw new Error("Unknown method: "+t);void 0===i&&(i=r[t].call(r,e))}else if("string"===n.type(t)){if("destroy"!==t)throw new Error("Cannot call method on element without Selectivity instance")}else{e=n.extend({},t,{element:this});var o=n(this);o.is("select")&&o.prop("multiple")&&(e.multiple=!0);var l=s.InputTypes,u=e.inputType||(e.multiple?"Multiple":"Single");if("function"!==n.type(u)){if(!l[u])throw new Error("Unknown Selectivity input type: "+u);u=l[u]}this.selectivity=new u(e)}}),void 0===i?this:i}function s(t){return this instanceof s?(this.$el=n(t.element),this.$searchInput=null,this.dropdown=null,this.enabled=!0,this.hasTouch="undefined"!=typeof window&&"ontouchstart"in window,this.hasKeyboard=!this.hasTouch,this.items=null,this.matcher=s.matcher,this.options={},this.results=[],this.searchInputListeners=s.SearchInputListeners,this.templates=n.extend({},s.Templates),this.term="",this.setOptions(t),t.value?this.value(t.value,{triggerChange:!1}):this.data(t.data||null,{triggerChange:!1}),this._events=[],this._$searchInputs=[],this.$el.on("selectivity-close",this._closed.bind(this)),void this.delegateEvents()):i.apply(this,arguments)}var n=window.jQuery||window.Zepto;n.extend(s.prototype,{$:function(t){return this.$el.find(t)},close:function(){this.dropdown&&this.dropdown.close()},data:function(t,e){return e=e||{},void 0===t?this._data:(t=this.validateData(t),this._data=t,this._value=this.getValueForData(t),e.triggerChange!==!1&&this.triggerChange(),void 0)},delegateEvents:function(){this.undelegateEvents(),n.each(this.events,function(t,e){var i,s=t.indexOf(" ");s>-1&&(i=t.slice(s+1),t=t.slice(0,s)),"string"===n.type(e)&&(e=this[e]),e=e.bind(this),i?this.$el.on(t,i,e):this.$el.on(t,e),this._events.push({event:t,selector:i,listener:e})}.bind(this))},destroy:function(){this.undelegateEvents();var t=this.$el;t.children().remove(),t[0].selectivity=null,t=null},filterResults:function(t){return t},focus:function(){this.$searchInput&&this.$searchInput.focus()},getItemForId:function(t){var e=this.items;return e?s.findNestedById(e,t):{id:t,text:""+t}},initSearchInput:function(t,e){this._$searchInputs.push(t),this.$searchInput=t,this.searchInputListeners.forEach(function(e){e(this,t)}.bind(this)),e&&e.noSearch===!1||t.on("keyup",function(t){t.isDefaultPrevented()||this.search()}.bind(this))},loadMore:function(){this.options.query({callback:function(t){if(!t||!t.results)throw new Error("callback must be passed a response object");this._addResults(s.processItems(t.results),{hasMore:!!t.more})}.bind(this),error:this._addResults.bind(this,[]),offset:this.results.length,selectivity:this,term:this.term})},open:function(t){if(t=t||{},!this.dropdown&&this.triggerEvent("selectivity-opening")){var e=this.options.dropdown||s.Dropdown;e&&(this.dropdown=new e({position:this.options.positionDropdown,selectivity:this,showSearchInput:t.showSearchInput})),this.search("")}},positionDropdown:function(){this.dropdown&&this.dropdown.position()},removeSearchInput:function(){this._$searchInputs.pop(),this.$searchInput=this._$searchInputs[this._$searchInputs.length-1]||null},search:function(t){function e(e,s){i._setResults(e,n.extend({term:t},s))}var i=this;if(void 0===t){if(!i.$searchInput)return;t=i.$searchInput.val()}if(i.items){t=s.transformText(t);var r=i.matcher;e(i.items.map(function(e){return r(e,t)}).filter(function(t){return!!t}))}else i.options.query&&i.options.query({callback:function(t){if(!t||!t.results)throw new Error("callback must be passed a response object");e(s.processItems(t.results),{hasMore:!!t.more})},error:i._showError.bind(i),offset:0,selectivity:i,term:t});i.term=t},setOptions:function(t){t=t||{},s.OptionListeners.forEach(function(e){e(this,t)}.bind(this)),n.extend(this.options,t);var e=n.extend({closeOnSelect:"boolean",dropdown:"function|null",initSelection:"function|null",matcher:"function|null",placeholder:"string",positionDropdown:"function|null",query:"function|null",readOnly:"boolean",removeOnly:"boolean",searchInputListeners:"array"},t.allowedTypes);n.each(t,function(t,i){var r=e[t];if(r&&!r.split("|").some(function(t){return n.type(i)===t}))throw new Error(t+" must be of type "+r);switch(t){case"items":this.items=null===i?i:s.processItems(i);break;case"matcher":this.matcher=i;break;case"searchInputListeners":this.searchInputListeners=i;break;case"templates":n.extend(this.templates,i)}}.bind(this)),this.enabled=!this.options.readOnly&&!this.options.removeOnly},template:function(t,e){var i=this.templates[t];if(i)return"function"===n.type(i)?i(e):i.render?i.render(e):i.toString();throw new Error("Unknown template: "+t)},triggerChange:function(t){this.triggerEvent("change",n.extend({value:this._value},t))},triggerEvent:function(t,e){var i=n.Event(t,e||{});return this.$el.trigger(i),!i.isDefaultPrevented()},undelegateEvents:function(){this._events.forEach(function(t){t.selector?this.$el.off(t.event,t.selector,t.listener):this.$el.off(t.event,t.listener)},this),this._events=[]},val:function(t){return this.value(t)},validateItem:function(t){if(t&&s.isValidId(t.id)&&"string"===n.type(t.text))return t;throw new Error("Item should have id (number or string) and text (string) properties")},value:function(t,e){return e=e||{},void 0===t?this._value:(t=this.validateValue(t),this._value=t,this.options.initSelection?this.options.initSelection(t,function(i){this._value===t&&(this._data=this.validateData(i),e.triggerChange!==!1&&this.triggerChange())}.bind(this)):(this._data=this.getDataForValue(t),e.triggerChange!==!1&&this.triggerChange()),void 0)},_addResults:function(t,e){this.results=this.results.concat(t),this.dropdown&&this.dropdown.showResults(this.filterResults(t),n.extend({add:!0},e))},_closed:function(){this.dropdown=null},_getItemId:function(t){var e;e=t.target?n(t.target).closest("[data-item-id]"):t.length?t:n(t);var i=e.data("item-id");return"string"===n.type(i)?i:s.findById(this._data||[],i)||s.findNestedById(this.results,i)?i:""+i},_setResults:function(t,e){this.results=t,this.dropdown&&this.dropdown.showResults(this.filterResults(t),e||{})},_showError:function(t,e){this.results=[],this.dropdown&&this.dropdown.showError(t,e)}}),s.Dropdown=null,s.InputTypes={},s.OptionListeners=[],s.SearchInputListeners=[],s.Templates={},s.findById=function(t,e){var i=s.findIndexById(t,e);return i>-1?t[i]:null},s.findIndexById=function(t,e){for(var i=0,s=t.length;s>i;i++)if(t[i].id===e)return i;return-1},s.findNestedById=null,s.inherits=function(t,e,i){return 2===arguments.length&&(i=e,e=s),t.prototype=n.extend(Object.create(e.prototype),{constructor:t},i),function(t,i){e.prototype[i].apply(t,Array.prototype.slice.call(arguments,2))}},s.isValidId=function(t){var e=n.type(t);return"number"===e||"string"===e},s.matcher=function(t,e){var i=null;if(s.transformText(t.text).indexOf(e)>-1)i=t;else if(t.children){var n=t.children.map(function(t){return s.matcher(t,e)}).filter(function(t){return!!t});n.length&&(i={id:t.id,text:t.text,children:n})}return i},s.processItem=function(t){if(s.isValidId(t))return{id:t,text:""+t};if(t&&(s.isValidId(t.id)||t.children)&&"string"===n.type(t.text))return t.children&&(t.children=s.processItems(t.children)),t;throw new Error("invalid item")},s.processItems=function(t){if("array"===n.type(t))return t.map(s.processItem);throw new Error("invalid items")},s.quoteCssAttr=function(t){return'"'+(""+t).replace(/\\/g,"\\\\").replace(/"/g,'\\"')+'"'},s.transformText=function(t){return t.toLowerCase()},e.exports=n.fn.selectivity=s},{jquery:"jquery"}],8:[function(t){"use strict";var e={"Ⓐ":"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","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ω":"ω","ς":"σ"},i=t(7),s=i.transformText;i.transformText=function(t){for(var i="",n=0,r=t.length;r>n;n++){var o=t[n];i+=e[o]||o}return s(i)}},{7:7}],9:[function(t,e){"use strict";function i(t){var e=t.selectivity;this.$el=s(e.template("dropdown",{dropdownCssClass:e.options.dropdownCssClass,searchInputPlaceholder:e.options.searchInputPlaceholder,showSearchInput:t.showSearchInput})),this.$results=this.$(".selectivity-results-container"),this.hasMore=!1,this.highlightedResult=null,this.loadMoreHighlighted=!1,this.options=t,this.results=[],this.selectivity=e,this._closeProxy=this.close.bind(this),e.options.closeOnSelect!==!1&&e.$el.on("selectivity-selecting",this._closeProxy),this.addToDom(),this.position(),this.setupCloseHandler(),this._scrolledProxy=n(this._scrolled.bind(this),50),this._suppressMouseWheel(),t.showSearchInput&&(e.initSearchInput(this.$(".selectivity-search-input")),e.focus()),this._delegateEvents(),this.showLoading(),setTimeout(this.triggerOpen.bind(this),1)}var s=window.jQuery||window.Zepto,n=t(2),r=t(7);s.extend(i.prototype,{$:function(t){return this.$el.find(t)},addToDom:function(){this.$el.appendTo(this.selectivity.$el[0].ownerDocument.body)},close:function(){this.options.showSearchInput&&this.selectivity.removeSearchInput(),this.$el.remove(),this.removeCloseHandler(),this.selectivity.$el.off("selectivity-selecting",this._closeProxy),this.triggerClose()},events:{"click .selectivity-load-more":"_loadMoreClicked","click .selectivity-result-item":"_resultClicked","mouseenter .selectivity-load-more":"highlightLoadMore","mouseenter .selectivity-result-item":"_resultHovered"},highlight:function(t){this.loadMoreHighlighted&&this.$(".selectivity-load-more").removeClass("highlight"),this.$(".selectivity-result-item").removeClass("highlight").filter("[data-item-id="+r.quoteCssAttr(t.id)+"]").addClass("highlight"),this.highlightedResult=t,this.loadMoreHighlighted=!1,this.selectivity.triggerEvent("selectivity-highlight",{item:t,id:t.id})},highlightLoadMore:function(){this.$(".selectivity-result-item").removeClass("highlight"),this.$(".selectivity-load-more").addClass("highlight"),this.highlightedResult=null,this.loadMoreHighlighted=!0},position:function(){var t=this.options.position;t&&t(this.$el,this.selectivity.$el),this._scrolled()},removeCloseHandler:function(){s("body").off("click",this._closeProxy)},renderItems:function(t){var e=this.selectivity;return t.map(function(t){var i=e.template(t.id?"resultItem":"resultLabel",t);return t.children&&(i+=e.template("resultChildren",{childrenHtml:this.renderItems(t.children)})),i},this).join("")},selectHighlight:function(){this.highlightedResult?this.selectItem(this.highlightedResult.id):this.loadMoreHighlighted&&this._loadMoreClicked()},selectItem:function(t){var e=this.selectivity,i=r.findNestedById(e.results,t);if(i){var s={id:t,item:i};e.triggerEvent("selectivity-selecting",s)&&e.triggerEvent("selectivity-selected",s)}},setupCloseHandler:function(){s("body").on("click",this._closeProxy)},showError:function(t,e){e=e||{},this.$results.html(this.selectivity.template("error",{escape:e.escape!==!1,message:t})),this.hasMore=!1,this.results=[],this.highlightedResult=null,this.loadMoreHighlighted=!1,this.position()},showLoading:function(){this.$results.html(this.selectivity.template("loading")),this.hasMore=!1,this.results=[],this.highlightedResult=null,this.loadMoreHighlighted=!1,this.position()},showResults:function(t,e){var i=this.renderItems(t);e.hasMore?i+=this.selectivity.template("loadMore"):i||e.add||(i=this.selectivity.template("noResults",{term:e.term})),e.add?(this.$(".selectivity-loading").replaceWith(i),this.results=this.results.concat(t)):(this.$results.html(i),this.results=t),this.hasMore=e.hasMore,(!e.add||this.loadMoreHighlighted)&&this._highlightFirstItem(t),this.position()},triggerClose:function(){this.selectivity.$el.trigger("selectivity-close")},triggerOpen:function(){this.selectivity.$el.trigger("selectivity-open")},_delegateEvents:function(){s.each(this.events,function(t,e){var i=t.indexOf(" "),n=t.slice(i+1);t=t.slice(0,i),"string"===s.type(e)&&(e=this[e]),e=e.bind(this),this.$el.on(t,n,e)}.bind(this)),this.$results.on("scroll touchmove touchend",this._scrolledProxy)},_highlightFirstItem:function(t){function e(t){for(var i=0,s=t.length;s>i;i++){var n=t[i];if(n.id)return n;if(n.children){var r=e(n.children);if(r)return r}}}var i=e(t);i?this.highlight(i):(this.highlightedResult=null,this.loadMoreHighlighted=!1)},_loadMoreClicked:function(){return this.$(".selectivity-load-more").replaceWith(this.selectivity.template("loading")),this.selectivity.loadMore(),this.selectivity.focus(),!1},_resultClicked:function(t){return this.selectItem(this.selectivity._getItemId(t)),!1},_resultHovered:function(t){var e=this.selectivity._getItemId(t),i=r.findNestedById(this.results,e);i&&this.highlight(i)},_scrolled:function(){var t=this.$(".selectivity-load-more");t.length&&t[0].offsetTop-this.$results[0].scrollTopn.bottom)&&e.scrollIntoView(t.alignToTop)},_suppressMouseWheel:function(){var t=this.selectivity.options.suppressMouseWheelSelector;if(null!==t){var e=t||".selectivity-results-container";this.$el.on("DOMMouseScroll mousewheel",e,function(t){function e(){return t.stopPropagation(),t.preventDefault(),t.returnValue=!1,!1}var i=s(this),n=this.scrollTop,r=this.scrollHeight,o=i.height(),l=t.originalEvent,u="DOMMouseScroll"===t.type?-40*l.detail:l.wheelDelta,h=u>0;if(r>o){if(!h&&-u>r-o-n)return i.scrollTop(r),e();if(h&&u>n)return i.scrollTop(0),e()}})}}}),e.exports=r.Dropdown=i},{2:2,7:7,jquery:"jquery"}],10:[function(t,e){"use strict";function i(t){var e=t.indexOf("@"),i=t.lastIndexOf("."),s=t.indexOf(" ");return e>0&&i>e+1&&i=0;i--)if(/\s/.test(t[i]))return t.slice(i+1,e);return t.slice(0,e)}function n(t,e){return t.slice(0,1)===e[0]&&t.slice(-1)===e[1]?t.slice(1,-1).trim():t.trim()}function r(t){var e=s(t),r=t.slice(0,-e.length).trim();return i(e)?(e=n(n(e,"()"),"<>"),r=n(r,'""').trim()||e,{id:e,text:r}):t.trim()?{id:t,text:t}:null}function o(t,e,n){function o(t){if(t)for(var e=0,n=t.length;n>e;e++)switch(t[e]){case";":case",":case"\n":return!0;case" ":case" ":if(i(s(t,e)))return!0;break;case'"':do e++;while(n>e&&'"'!==t[e]);break;default:continue}return!1}function l(t){for(var e=0,n=t.length;n>e;e++)switch(t[e]){case";":case",":case"\n":return{term:t.slice(0,e),input:t.slice(e+1)};case" ":case" ":if(i(s(t,e)))return{term:t.slice(0,e),input:t.slice(e+1)};break;case'"':do e++;while(n>e&&'"'!==t[e]);break;default:continue}return{}}for(;o(t);){var u=l(t);if(u.term){var a=r(u.term);!a||a.id&&h.findById(e,a.id)||n(a)}t=u.input}return t}function l(t){a.call(this,t)}var u=window.jQuery||window.Zepto,h=t(7),a=t(13),c=h.inherits(l,a,{initSearchInput:function(t){c(this,"initSearchInput",t),t.on("blur",function(){var e=t.val();i(s(e))&&this.add(r(e))}.bind(this))},setOptions:function(t){t=u.extend({createTokenItem:r,showDropdown:!1,tokenizer:o},t),c(this,"setOptions",t)}});e.exports=h.InputTypes.Email=l},{13:13,7:7,jquery:"jquery"}],11:[function(t){"use strict";function e(t,e){function h(e,s){function n(t,e){for(var i=0,s=t.length;s>i;i++)if(t.eq(i).is(e))return i;return-1}function r(){var t;if(e.highlightedResult){var n=i.quoteCssAttr(e.highlightedResult.id);t=e.$(".selectivity-result-item[data-item-id="+n+"]")[0]}else{if(!e.loadMoreHighlighted)return;t=e.$(".selectivity-load-more")[0]}var r=t.getBoundingClientRect(),o=e.$results[0].getBoundingClientRect();(r.topo.bottom)&&t.scrollIntoView(0>s)}if(e.submenu)return void h(e.submenu,s);var o=e.results;if(o.length){var l=e.$(".selectivity-result-item"),u=s>0?0:l.length-1,a=u,c=e.highlightedResult;if(c){var d=i.quoteCssAttr(c.id);if(a=n(l,"[data-item-id="+d+"]")+s,s>0?a>=l.length:0>a){if(e.hasMore)return e.highlightLoadMore(),void r();a=u}}var p=i.findNestedById(o,t._getItemId(l[a]));p&&(e.highlight(p),r())}}function a(i){var r=t.dropdown;if(r)if(i.keyCode===s){if(!e.val()){if(r.submenu){for(var o=r.submenu;o.submenu;)o=o.submenu;p=o}i.preventDefault(),d=!0}}else i.keyCode===n?h(r,1):i.keyCode===u?h(r,-1):i.keyCode===l&&setTimeout(function(){t.close({keepFocus:!1})},1)}function c(e){function i(){t.options.showDropdown!==!1&&t.open()}var s=t.dropdown;d?(e.preventDefault(),d=!1,p&&(p.close(),p=null)):e.keyCode!==r||e.ctrlKey?e.keyCode===o?(t.close(),e.preventDefault()):e.keyCode===n||e.keyCode===u?(i(),e.preventDefault()):i():(s?s.selectHighlight():t.options.showDropdown!==!1&&i(),e.preventDefault())}var d=!1,p=null;e.on("keydown",a).on("keyup",c)}var i=t(7),s=8,n=40,r=13,o=27,l=9,u=38;i.SearchInputListeners.push(e)},{7:7}],12:[function(t){"use strict";var e=t(3),i=t(7);i.Locale={ajaxError:function(t){return"Failed to fetch results for "+e(t)+""},loading:"Loading...",loadMore:"Load more...",needMoreCharacters:function(t){return"Enter "+t+" more characters to search"},noResults:"No results found",noResultsForTerm:function(t){return"No results for "+e(t)+""}}},{3:3,7:7}],13:[function(t,e){"use strict";function i(t){n.call(this,t),this.$el.html(this.template("multipleSelectInput",{enabled:this.enabled})).trigger("selectivity-init","multiple"),this._highlightedItemId=null,this.initSearchInput(this.$(".selectivity-multiple-input:not(.selectivity-width-detector)")),this._rerenderSelection(),t.positionDropdown||(this.options.positionDropdown=function(t,e){var i=e.offset(),n=t.height(),r=e.height(),o=e[0].getBoundingClientRect().top+r+n;t.css({left:i.left+"px",top:i.top+("undefined"!=typeof window&&o>s(window).height()?-n:r)+"px"}).width(e.width())})}var s=window.jQuery||window.Zepto,n=t(7),r=8,o=46,l=13,u=n.inherits(i,{add:function(t){var e=n.isValidId(t),i=e?t:this.validateItem(t)&&t.id;-1===this._value.indexOf(i)&&(this._value.push(i),e&&this.options.initSelection?this.options.initSelection([i],function(e){this._value.indexOf(i)>-1&&(t=this.validateItem(e[0]),this._data.push(t),this.triggerChange({added:t}))}.bind(this)):(e&&(t=this.getItemForId(i)),this._data.push(t),this.triggerChange({added:t}))),this.$searchInput.val("")},clear:function(){this.data([])},events:{change:"_rerenderSelection","change .selectivity-multiple-input":function(){return!1},click:"_clicked","click .selectivity-multiple-selected-item":"_itemClicked","keydown .selectivity-multiple-input":"_keyHeld","keyup .selectivity-multiple-input":"_keyReleased","paste .selectivity-multiple-input":"_onPaste","selectivity-selected":"_resultSelected"},filterResults:function(t){return t.filter(function(t){return!n.findById(this._data,t.id)},this)},getDataForValue:function(t){return t.map(this.getItemForId.bind(this)).filter(function(t){return!!t})},getValueForData:function(t){return t.map(function(t){return t.id})},remove:function(t){var e,i="object"===s.type(t)?t.id:t,r=n.findIndexById(this._data,i);r>-1&&(e=this._data[r],this._data.splice(r,1)),this._value[r]!==i&&(r=this._value.indexOf(i)),r>-1&&this._value.splice(r,1),e&&this.triggerChange({removed:e}),i===this._highlightedItemId&&(this._highlightedItemId=null)},search:function(){var t=this.$searchInput.val();this.options.tokenizer&&(t=this.options.tokenizer(t,this._data,this.add.bind(this),this.options),"string"===s.type(t)?this.$searchInput.val(t):t=""),this.dropdown&&u(this,"search")},setOptions:function(t){t=t||{};var e="backspaceHighlightsBeforeDelete";void 0===t[e]&&(t[e]=this.hasTouch),t.allowedTypes=t.allowedTypes||{},t.allowedTypes[e]="boolean",u(this,"setOptions",t)},validateData:function(t){if(null===t)return[];if("array"===s.type(t))return t.map(this.validateItem.bind(this));throw new Error("Data for MultiSelectivity instance should be array")},validateValue:function(t){if(null===t)return[];if("array"===s.type(t)){if(t.every(n.isValidId))return t;throw new Error("Value contains invalid IDs")}throw new Error("Value for MultiSelectivity instance should be an array")},_backspacePressed:function(){this.options.backspaceHighlightsBeforeDelete?this._highlightedItemId?this._deletePressed():this._value.length&&this._highlightItem(this._value.slice(-1)[0]):this._value.length&&this.remove(this._value.slice(-1)[0])},_clicked:function(){return this.enabled?(this.focus(),this._open(),!1):void 0},_createToken:function(){var t=this.$searchInput.val(),e=this.options.createTokenItem;if(t&&e){var i=e(t);i&&this.add(i)}},_deletePressed:function(){this._highlightedItemId&&this.remove(this._highlightedItemId)},_highlightItem:function(t){this._highlightedItemId=t,this.$(".selectivity-multiple-selected-item").removeClass("highlighted").filter("[data-item-id="+n.quoteCssAttr(t)+"]").addClass("highlighted"),this.hasKeyboard&&this.focus()},_itemClicked:function(t){this.enabled&&this._highlightItem(this._getItemId(t))},_itemRemoveClicked:function(t){return this.remove(this._getItemId(t)),this._updateInputWidth(),!1},_keyHeld:function(t){this._originalValue=this.$searchInput.val(),t.keyCode!==l||t.ctrlKey||t.preventDefault()},_keyReleased:function(t){var e=!!this._originalValue;t.keyCode!==l||t.ctrlKey?t.keyCode!==r||e?t.keyCode!==o||e||this._deletePressed():this._backspacePressed():this.options.createTokenItem&&this._createToken(),this._updateInputWidth()},_onPaste:function(){setTimeout(function(){this.search(),this.options.createTokenItem&&this._createToken()}.bind(this),10)},_open:function(){this.options.showDropdown!==!1&&this.open()},_renderSelectedItem:function(t){this.$searchInput.before(this.template("multipleSelectedItem",s.extend({highlighted:t.id===this._highlightedItemId,removable:!this.options.readOnly},t)));var e=n.quoteCssAttr(t.id);this.$(".selectivity-multiple-selected-item[data-item-id="+e+"]").find(".selectivity-multiple-selected-item-remove").on("click",this._itemRemoveClicked.bind(this))},_rerenderSelection:function(t){if(t=t||{},t.added)this._renderSelectedItem(t.added),this._scrollToBottom();else if(t.removed){var e=n.quoteCssAttr(t.removed.id);this.$(".selectivity-multiple-selected-item[data-item-id="+e+"]").remove()}else this.$(".selectivity-multiple-selected-item").remove(),this._data.forEach(this._renderSelectedItem,this),this._updateInputWidth(); -(t.added||t.removed)&&(this.dropdown&&this.dropdown.showResults(this.filterResults(this.results),{hasMore:this.dropdown.hasMore}),this.hasKeyboard&&this.focus()),this.positionDropdown(),this._updatePlaceholder()},_resultSelected:function(t){-1===this._value.indexOf(t.id)?this.add(t.item):this.remove(t.item)},_scrollToBottom:function(){var t=this.$(".selectivity-multiple-input-container");t.scrollTop(t.height())},_updateInputWidth:function(){if(this.enabled){var t=this.$searchInput,e=this.$(".selectivity-width-detector");e.text(t.val()||!this._data.length&&this.options.placeholder||""),t.width(e.width()+20),this.positionDropdown()}},_updatePlaceholder:function(){var t=this._data.length?"":this.options.placeholder;this.enabled?this.$searchInput.attr("placeholder",t):this.$(".selectivity-placeholder").text(t)}});e.exports=n.InputTypes.Multiple=i},{7:7,jquery:"jquery"}],14:[function(t,e){"use strict";function i(t){n.call(this,t),this.$el.html(this.template("singleSelectInput",this.options)).trigger("selectivity-init","single"),this._rerenderSelection(),t.positionDropdown||(this.options.positionDropdown=function(t,e){var i=e.offset(),n=i.top+e.height();if("undefined"!=typeof window){var r=e[0].getBoundingClientRect(),o=t.height(),l=s(window).height();r.top+o>l&&(n=Math.max(l-o+i.top-r.top,0))}t.css({left:i.left+"px",top:n+"px"}).width(e.width())}),t.showSearchInputInDropdown===!1&&this.initSearchInput(this.$(".selectivity-single-select-input"),{noSearch:!0})}var s=window.jQuery||window.Zepto,n=t(7),r=n.inherits(i,{events:{change:"_rerenderSelection",click:"_clicked","focus .selectivity-single-select-input":"_focused","selectivity-selected":"_resultSelected"},clear:function(){this.data(null)},close:function(t){this._closing=!0,r(this,"close"),t&&t.keepFocus===!1||this.$(".selectivity-single-select-input").focus(),this._closing=!1},getDataForValue:function(t){return this.getItemForId(t)},getValueForData:function(t){return t?t.id:null},open:function(t){var e=this.options.showSearchInputInDropdown!==!1;r(this,"open",s.extend({showSearchInput:e},t)),e||this.focus()},setOptions:function(t){t=t||{},t.allowedTypes=s.extend(t.allowedTypes||{},{allowClear:"boolean",showSearchInputInDropdown:"boolean"}),r(this,"setOptions",t)},validateData:function(t){return null===t?t:this.validateItem(t)},validateValue:function(t){if(null===t||n.isValidId(t))return t;throw new Error("Value for SingleSelectivity instance should be a valid ID or null")},_clicked:function(){return this.enabled?(this.dropdown?this.close():this.options.showDropdown!==!1&&this.open(),!1):void 0},_focused:function(){this.enabled&&!this._closing&&this.options.showDropdown!==!1&&this.open()},_itemRemoveClicked:function(){return this.data(null),!1},_rerenderSelection:function(){var t=this.$(".selectivity-single-result-container");this._data?(t.html(this.template("singleSelectedItem",s.extend({removable:this.options.allowClear&&!this.options.readOnly},this._data))),t.find(".selectivity-single-selected-item-remove").on("click",this._itemRemoveClicked.bind(this))):t.html(this.template("singleSelectPlaceholder",{placeholder:this.options.placeholder}))},_resultSelected:function(t){this.data(t.item),this.close()}});e.exports=n.InputTypes.Single=i},{7:7,jquery:"jquery"}],15:[function(t,e){"use strict";function i(t){this.parentMenu=t.parentMenu,n.call(this,t),this._closeSubmenuTimeout=0}var s=t(7),n=t(9),r=s.inherits(i,n,{close:function(){this.options.restoreOptions&&this.selectivity.setOptions(this.options.restoreOptions),this.options.restoreResults&&(this.selectivity.results=this.options.restoreResults),this.submenu&&this.submenu.close(),r(this,"close"),this.parentMenu&&(this.parentMenu.submenu=null,this.parentMenu=null)},highlight:function(t){if(this.submenu){if(!this.highlightedResult||this.highlightedResult.id!==t.id)return this._closeSubmenuTimeout&&clearTimeout(this._closeSubmenuTimeout),void(this._closeSubmenuTimeout=setTimeout(this._closeSubmenuAndHighlight.bind(this,t),100))}else this.parentMenu&&this.parentMenu._closeSubmenuTimeout&&(clearTimeout(this.parentMenu._closeSubmenuTimeout),this.parentMenu._closeSubmenuTimeout=0);this._doHighlight(t)},selectHighlight:function(){this.submenu?this.submenu.selectHighlight():r(this,"selectHighlight")},selectItem:function(t){var e=this.selectivity,i=s.findNestedById(e.results,t);if(i&&!i.submenu){var n={id:t,item:i};e.triggerEvent("selectivity-selecting",n)&&e.triggerEvent("selectivity-selected",n)}},showResults:function(t,e){this.submenu?this.submenu.showResults(t,e):r(this,"showResults",t,e)},triggerClose:function(){this.parentMenu?this.selectivity.$el.trigger("selectivity-close-submenu"):r(this,"triggerClose")},triggerOpen:function(){this.parentMenu?this.selectivity.$el.trigger("selectivity-open-submenu"):r(this,"triggerOpen")},_closeSubmenuAndHighlight:function(t){this.submenu&&this.submenu.close(),this._doHighlight(t)},_doHighlight:function(t){if(r(this,"highlight",t),t.submenu&&!this.submenu){var e=this.selectivity,i=e.options.dropdown||s.Dropdown;if(i){var n=s.quoteCssAttr(t.id),o=this.$(".selectivity-result-item[data-item-id="+n+"]"),l=this.$el;this.submenu=new i({parentMenu:this,position:t.submenu.positionDropdown||function(t){var e=o.offset(),i=l.width();t.css({left:e.left+i+"px",top:e.top+"px"}).width(i)},restoreOptions:{items:e.items,query:e.options.query||null},restoreResults:e.results,selectivity:e,showSearchInput:t.submenu.showSearchInput}),e.setOptions({items:t.submenu.items||null,query:t.submenu.query||null}),e.search("")}}}});s.Dropdown=i,s.findNestedById=function(t,e){for(var i=0,n=t.length;n>i;i++){var r,o=t[i];if(o.id===e?r=o:o.children?r=s.findNestedById(o.children,e):o.submenu&&o.submenu.items&&(r=s.findNestedById(o.submenu.items,e)),r)return r}return null},e.exports=i},{7:7,9:9}],16:[function(t){"use strict";var e=t(3),i=t(7);t(12),i.Templates={dropdown:function(t){var i=t.dropdownCssClass?" "+t.dropdownCssClass:"",s="";if(t.showSearchInput){i+=" has-search-input";var n=t.searchInputPlaceholder;s='
"}return'
'+s+'
'},error:function(t){return'
'+(t.escape?e(t.message):t.message)+"
"},loading:function(){return'
'+i.Locale.loading+"
"},loadMore:function(){return'
'+i.Locale.loadMore+"
"},multipleSelectInput:function(t){return'
'+(t.enabled?'':'
')+'
'},multipleSelectedItem:function(t){var i=t.highlighted?" highlighted":"";return''+(t.removable?'':"")+e(t.text)+""},noResults:function(t){var e=i.Locale;return'
'+(t.term?e.noResultsForTerm(t.term):e.noResults)+"
"},resultChildren:function(t){return'
'+t.childrenHtml+"
"},resultItem:function(t){return'
'+e(t.text)+(t.submenu?'':"")+"
"},resultLabel:function(t){return'
'+e(t.text)+"
"},singleSelectInput:'
',singleSelectPlaceholder:function(t){return'
'+e(t.placeholder)+"
"},singleSelectedItem:function(t){return''+(t.removable?'':"")+e(t.text)+""},selectCompliance:function(t){return'"},selectOptionCompliance:function(t){return'"}}},{12:12,3:3,7:7}],17:[function(t){"use strict";function e(t,e,i,n){function r(t){return t?u.some(function(e){return t.indexOf(e)>-1}):!1}function o(t){for(var e=0,i=t.length;i>e;e++)if(u.indexOf(t[e])>-1)return{term:t.slice(0,e),input:t.slice(e+1)};return{}}for(var l=n.createTokenItem||function(t){return t?{id:t,text:t}:null},u=n.tokenSeparators;r(t);){var h=o(t);if(h.term){var a=l(h.term);a&&!s.findById(e,a.id)&&i(a)}t=h.input}return t}var i=window.jQuery||window.Zepto,s=t(7);s.OptionListeners.push(function(t,s){s.tokenSeparators&&(s.allowedTypes=i.extend({tokenSeparators:"array"},s.allowedTypes),s.tokenizer=s.tokenizer||e)})},{7:7,jquery:"jquery"}],18:[function(t){"use strict";function e(t,e){var i=e.multiple?[]:null,n=function(){var t=s(this);if(t.is("option")){var r=t.text(),o=t.attr("value")||r;if(t.prop("selected")){var l={id:o,text:r};e.multiple?i.push(l):i=l}return{id:o,text:t.attr("label")||r}}return{text:t.attr("label"),children:t.children("option,optgroup").map(n).get()}};e.allowClear="allowClear"in e?e.allowClear:!t.prop("required");var r=t.children("option,optgroup").map(n).get();e.items=e.query?null:r,e.placeholder=e.placeholder||t.data("placeholder")||"",e.data=i;var o=(t.attr("class")||"selectivity-input").split(" ");-1===o.indexOf("selectivity-input")&&o.push("selectivity-input");var l=s("
").attr({id:t.attr("id"),"class":o.join(" "),style:t.attr("style"),"data-name":t.attr("name")});return t.replaceWith(l),l}function i(t){var e=t.$el;e.on("selectivity-init",function(i,s){e.append(t.template("selectCompliance",{name:e.attr("data-name"),mode:s})).removeAttr("data-name")}).on("selectivity-init change",function(){var i=t._data,s=e.find("select");i instanceof Array?(s.empty(),i.forEach(function(e){s.append(t.template("selectOptionCompliance",e))})):i?s.html(t.template("selectOptionCompliance",i)):s.empty()})}var s=window.jQuery||window.Zepto,n=t(7);n.OptionListeners.push(function(t,s){var n=t.$el;n.is("select")&&(n.attr("autofocus")&&setTimeout(function(){t.focus()},1),t.$el=e(n,s),t.$el[0].selectivity=t,i(t))})},{7:7,jquery:"jquery"}]},{},[1])(1)}); \ No newline at end of file +!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;"undefined"!=typeof window?t=window:"undefined"!=typeof global?t=global:"undefined"!=typeof self&&(t=self),t.selectivity=e()}}(function(){return function e(t,i,s){function n(o,l){if(!i[o]){if(!t[o]){var u="function"==typeof require&&require;if(!l&&u)return u(o,!0);if(r)return r(o,!0);var h=new Error("Cannot find module '"+o+"'");throw h.code="MODULE_NOT_FOUND",h}var a=i[o]={exports:{}};t[o][0].call(a.exports,function(e){var i=t[o][1][e];return n(i?i:e)},a,a.exports,e,t,i,s)}return i[o].exports}for(var r="function"==typeof require&&require,o=0;o=n||n>t){var c=h;u=h=void 0,c&&(a=s(),o=e.apply(null,r),u||(r=null))}else u=setTimeout(i,n)}function n(){return r=arguments,l=s(),h=!0,u||(u=setTimeout(i,t)),o}var r,o,l,u,h,a=0;return t=0>t?0:+t||0,n}var s=Date.now;t.exports=i},{}],3:[function(e,t){"use strict";function i(e){return n[e]}function s(e){return e?String(e).replace(r,i):""}var n={"&":"&","<":"<",">":">",'"':""","'":"'"},r=new RegExp("["+Object.keys(n).join("")+"]","g");t.exports=s},{}],4:[function(e){"use strict";var t=window.jQuery||window.Zepto,i=e(2),s=e(7);e(12),s.OptionListeners.unshift(function(e,n){var r=n.ajax;if(r&&r.url){var o=r.formatError||s.Locale.ajaxError,l=r.minimumInputLength||0,u=r.params,h=r.processItem||function(e){return e},a=r.quietMillis||0,c=r.results||function(e){return{results:e,more:!1}},d=r.transport||t.ajax;a&&(d=i(d,a)),n.query=function(i){var n=i.offset,a=i.term;if(a.length-1?"&":"?")+t.param(u(a,n)));var f=r.success,v=r.error;d(t.extend({},r,{url:p,success:function(e,t,s){f&&f(e,t,s);var r=c(e,n);r.results=r.results.map(h),i.callback(r)},error:function(e,t,s){v&&v(e,t,s),i.error(o(a,e,t,s),{escape:!1})}}))}}}})},{12:12,2:2,7:7,jquery:"jquery"}],5:[function(e){"use strict";var t=e(7),i=0;t.OptionListeners.push(function(e,t){var s=t.query;s&&(t.query=function(e){i++;var t=i,n=e.callback,r=e.error;e.callback=function(){t===i&&n.apply(null,arguments)},e.error=function(){t===i&&r.apply(null,arguments)},s(e)})})},{7:7}],6:[function(e){"use strict";var t=window.jQuery||window.Zepto,i=e(9);t.extend(i.prototype,{removeCloseHandler:function(){this._$backdrop&&!this.parentMenu&&(this._$backdrop.remove(),this._$backdrop=null)},setupCloseHandler:function(){var e;this.parentMenu?e=this.parentMenu._$backdrop:(e=t("
").addClass("selectivity-backdrop"),t("body").append(e)),e.on("click",this.close.bind(this)),this._$backdrop=e}})},{9:9,jquery:"jquery"}],7:[function(e,t){"use strict";function i(e,t){var i;return this.each(function(){var r=this.selectivity;if(r){if("string"!==n.type(e)&&(t=e,e="setOptions"),"function"!==n.type(r[e]))throw new Error("Unknown method: "+e);void 0===i&&(i=r[e].call(r,t))}else if("string"===n.type(e)){if("destroy"!==e)throw new Error("Cannot call method on element without Selectivity instance")}else{t=n.extend({},e,{element:this});var o=n(this);o.is("select")&&o.prop("multiple")&&(t.multiple=!0);var l=s.InputTypes,u=t.inputType||(t.multiple?"Multiple":"Single");if("function"!==n.type(u)){if(!l[u])throw new Error("Unknown Selectivity input type: "+u);u=l[u]}this.selectivity=new u(t)}}),void 0===i?this:i}function s(e){return this instanceof s?(this.$el=n(e.element),this.$searchInput=null,this.dropdown=null,this.enabled=!0,this.hasTouch="undefined"!=typeof window&&"ontouchstart"in window,this.hasKeyboard=!this.hasTouch,this.items=null,this.matcher=s.matcher,this.options={},this.results=[],this.searchInputListeners=s.SearchInputListeners,this.templates=n.extend({},s.Templates),this.term="",this.setOptions(e),e.value?this.value(e.value,{triggerChange:!1}):this.data(e.data||null,{triggerChange:!1}),this._events=[],this._$searchInputs=[],this.$el.on("selectivity-close",this._closed.bind(this)),void this.delegateEvents()):i.apply(this,arguments)}var n=window.jQuery||window.Zepto;n.extend(s.prototype,{$:function(e){return this.$el.find(e)},close:function(){this.dropdown&&this.dropdown.close()},data:function(e,t){return t=t||{},void 0===e?this._data:(e=this.validateData(e),this._data=e,this._value=this.getValueForData(e),t.triggerChange!==!1&&this.triggerChange(),void 0)},delegateEvents:function(){this.undelegateEvents(),n.each(this.events,function(e,t){var i,s=e.indexOf(" ");s>-1&&(i=e.slice(s+1),e=e.slice(0,s)),"string"===n.type(t)&&(t=this[t]),t=t.bind(this),i?this.$el.on(e,i,t):this.$el.on(e,t),this._events.push({event:e,selector:i,listener:t})}.bind(this))},destroy:function(){this.undelegateEvents();var e=this.$el;e.children().remove(),e[0].selectivity=null,e=null},filterResults:function(e){return e},focus:function(){this.$searchInput&&this.$searchInput.focus()},getItemForId:function(e){var t=this.items;return t?s.findNestedById(t,e):{id:e,text:""+e}},initSearchInput:function(e,t){this._$searchInputs.push(e),this.$searchInput=e,this.searchInputListeners.forEach(function(t){t(this,e)}.bind(this)),t&&t.noSearch===!1||e.on("keyup",function(e){e.isDefaultPrevented()||this.search()}.bind(this))},loadMore:function(){this.options.query({callback:function(e){if(!e||!e.results)throw new Error("callback must be passed a response object");this._addResults(s.processItems(e.results),{hasMore:!!e.more})}.bind(this),error:this._addResults.bind(this,[]),offset:this.results.length,selectivity:this,term:this.term})},open:function(e){if(e=e||{},!this.dropdown&&this.triggerEvent("selectivity-opening")){var t=this.options.dropdown||s.Dropdown;t&&(this.dropdown=new t({position:this.options.positionDropdown,selectivity:this,showSearchInput:e.showSearchInput})),this.search("")}},positionDropdown:function(){this.dropdown&&this.dropdown.position()},removeSearchInput:function(){this._$searchInputs.pop(),this.$searchInput=this._$searchInputs[this._$searchInputs.length-1]||null},search:function(e){function t(t,s){i._setResults(t,n.extend({term:e},s))}var i=this;if(void 0===e){if(!i.$searchInput)return;e=i.$searchInput.val()}if(i.items){e=s.transformText(e);var r=i.matcher;t(i.items.map(function(t){return r(t,e)}).filter(function(e){return!!e}))}else i.options.query&&i.options.query({callback:function(e){if(!e||!e.results)throw new Error("callback must be passed a response object");t(s.processItems(e.results),{hasMore:!!e.more})},error:i._showError.bind(i),offset:0,selectivity:i,term:e});i.term=e},setOptions:function(e){e=e||{},s.OptionListeners.forEach(function(t){t(this,e)}.bind(this)),n.extend(this.options,e);var t=n.extend({closeOnSelect:"boolean",dropdown:"function|null",initSelection:"function|null",matcher:"function|null",placeholder:"string",positionDropdown:"function|null",query:"function|null",readOnly:"boolean",removeOnly:"boolean",searchInputListeners:"array"},e.allowedTypes);n.each(e,function(e,i){var r=t[e];if(r&&!r.split("|").some(function(e){return n.type(i)===e}))throw new Error(e+" must be of type "+r);switch(e){case"items":this.items=null===i?i:s.processItems(i);break;case"matcher":this.matcher=i;break;case"searchInputListeners":this.searchInputListeners=i;break;case"templates":n.extend(this.templates,i)}}.bind(this)),this.enabled=!this.options.readOnly&&!this.options.removeOnly},template:function(e,t){var i=this.templates[e];if(i)return"function"===n.type(i)?i(t):i.render?i.render(t):i.toString();throw new Error("Unknown template: "+e)},triggerChange:function(e){this.triggerEvent("change",n.extend({value:this._value},e))},triggerEvent:function(e,t){var i=n.Event(e,t||{});return this.$el.trigger(i),!i.isDefaultPrevented()},undelegateEvents:function(){this._events.forEach(function(e){e.selector?this.$el.off(e.event,e.selector,e.listener):this.$el.off(e.event,e.listener)},this),this._events=[]},val:function(e){return this.value(e)},validateItem:function(e){if(e&&s.isValidId(e.id)&&"string"===n.type(e.text))return e;throw new Error("Item should have id (number or string) and text (string) properties")},value:function(e,t){return t=t||{},void 0===e?this._value:(e=this.validateValue(e),this._value=e,this.options.initSelection?this.options.initSelection(e,function(i){this._value===e&&(this._data=this.validateData(i),t.triggerChange!==!1&&this.triggerChange())}.bind(this)):(this._data=this.getDataForValue(e),t.triggerChange!==!1&&this.triggerChange()),void 0)},_addResults:function(e,t){this.results=this.results.concat(e),this.dropdown&&this.dropdown.showResults(this.filterResults(e),n.extend({add:!0},t))},_closed:function(){this.dropdown=null},_getItemId:function(e){var t;t=e.target?n(e.target).closest("[data-item-id]"):e.length?e:n(e);var i=t.data("item-id");return"string"===n.type(i)?i:s.findById(this._data||[],i)||s.findNestedById(this.results,i)?i:""+i},_setResults:function(e,t){this.results=e,this.dropdown&&this.dropdown.showResults(this.filterResults(e),t||{})},_showError:function(e,t){this.results=[],this.dropdown&&this.dropdown.showError(e,t)}}),s.Dropdown=null,s.InputTypes={},s.OptionListeners=[],s.SearchInputListeners=[],s.Templates={},s.findById=function(e,t){var i=s.findIndexById(e,t);return i>-1?e[i]:null},s.findIndexById=function(e,t){for(var i=0,s=e.length;s>i;i++)if(e[i].id===t)return i;return-1},s.findNestedById=null,s.inherits=function(e,t,i){return 2===arguments.length&&(i=t,t=s),e.prototype=n.extend(Object.create(t.prototype),{constructor:e},i),function(e,i){t.prototype[i].apply(e,Array.prototype.slice.call(arguments,2))}},s.isValidId=function(e){var t=n.type(e);return"number"===t||"string"===t},s.matcher=function(e,t){var i=null;if(s.transformText(e.text).indexOf(t)>-1)i=e;else if(e.children){var n=e.children.map(function(e){return s.matcher(e,t)}).filter(function(e){return!!e});n.length&&(i={id:e.id,text:e.text,children:n})}return i},s.processItem=function(e){if(s.isValidId(e))return{id:e,text:""+e};if(e&&(s.isValidId(e.id)||e.children)&&"string"===n.type(e.text))return e.children&&(e.children=s.processItems(e.children)),e;throw new Error("invalid item")},s.processItems=function(e){if("array"===n.type(e))return e.map(s.processItem);throw new Error("invalid items")},s.quoteCssAttr=function(e){return'"'+(""+e).replace(/\\/g,"\\\\").replace(/"/g,'\\"')+'"'},s.transformText=function(e){return e.toLowerCase()},t.exports=n.fn.selectivity=s},{jquery:"jquery"}],8:[function(e){"use strict";var t={"Ⓐ":"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","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ω":"ω","ς":"σ"},i=e(7),s=i.transformText;i.transformText=function(e){for(var i="",n=0,r=e.length;r>n;n++){var o=e[n];i+=t[o]||o}return s(i)}},{7:7}],9:[function(e,t){"use strict";function i(e){var t=e.selectivity;this.$el=s(t.template("dropdown",{dropdownCssClass:t.options.dropdownCssClass,searchInputPlaceholder:t.options.searchInputPlaceholder,showSearchInput:e.showSearchInput})),this.$results=this.$(".selectivity-results-container"),this.hasMore=!1,this.highlightedResult=null,this.loadMoreHighlighted=!1,this.options=e,this.results=[],this.selectivity=t,this._closeProxy=this.close.bind(this),t.options.closeOnSelect!==!1&&t.$el.on("selectivity-selecting",this._closeProxy),this.addToDom(),this.position(),this.setupCloseHandler(),this._scrolledProxy=n(this._scrolled.bind(this),50),this._suppressMouseWheel(),e.showSearchInput&&(t.initSearchInput(this.$(".selectivity-search-input")),t.focus()),this._delegateEvents(),this.showLoading(),setTimeout(this.triggerOpen.bind(this),1)}var s=window.jQuery||window.Zepto,n=e(2),r=e(7);s.extend(i.prototype,{$:function(e){return this.$el.find(e)},addToDom:function(){this.$el.appendTo(this.selectivity.$el[0].ownerDocument.body)},close:function(){this.options.showSearchInput&&this.selectivity.removeSearchInput(),this.$el.remove(),this.removeCloseHandler(),this.selectivity.$el.off("selectivity-selecting",this._closeProxy),this.triggerClose()},events:{"click .selectivity-load-more":"_loadMoreClicked","click .selectivity-result-item":"_resultClicked","mouseenter .selectivity-load-more":"highlightLoadMore","mouseenter .selectivity-result-item":"_resultHovered"},highlight:function(e){this.loadMoreHighlighted&&this.$(".selectivity-load-more").removeClass("highlight"),this.$(".selectivity-result-item").removeClass("highlight").filter("[data-item-id="+r.quoteCssAttr(e.id)+"]").addClass("highlight"),this.highlightedResult=e,this.loadMoreHighlighted=!1,this.selectivity.triggerEvent("selectivity-highlight",{item:e,id:e.id})},highlightLoadMore:function(){this.$(".selectivity-result-item").removeClass("highlight"),this.$(".selectivity-load-more").addClass("highlight"),this.highlightedResult=null,this.loadMoreHighlighted=!0},position:function(){var e=this.options.position;e&&e(this.$el,this.selectivity.$el),this._scrolled()},removeCloseHandler:function(){s("body").off("click",this._closeProxy)},renderItems:function(e){var t=this.selectivity;return e.map(function(e){var i=t.template(e.id?"resultItem":"resultLabel",e);return e.children&&(i+=t.template("resultChildren",{childrenHtml:this.renderItems(e.children)})),i},this).join("")},selectHighlight:function(){this.highlightedResult?this.selectItem(this.highlightedResult.id):this.loadMoreHighlighted&&this._loadMoreClicked()},selectItem:function(e){var t=this.selectivity,i=r.findNestedById(t.results,e);if(i){var s={id:e,item:i};t.triggerEvent("selectivity-selecting",s)&&t.triggerEvent("selectivity-selected",s)}},setupCloseHandler:function(){s("body").on("click",this._closeProxy)},showError:function(e,t){t=t||{},this.$results.html(this.selectivity.template("error",{escape:t.escape!==!1,message:e})),this.hasMore=!1,this.results=[],this.highlightedResult=null,this.loadMoreHighlighted=!1,this.position()},showLoading:function(){this.$results.html(this.selectivity.template("loading")),this.hasMore=!1,this.results=[],this.highlightedResult=null,this.loadMoreHighlighted=!1,this.position()},showResults:function(e,t){var i=this.renderItems(e);t.hasMore?i+=this.selectivity.template("loadMore"):i||t.add||(i=this.selectivity.template("noResults",{term:t.term})),t.add?(this.$(".selectivity-loading").replaceWith(i),this.results=this.results.concat(e)):(this.$results.html(i),this.results=e),this.hasMore=t.hasMore,(!t.add||this.loadMoreHighlighted)&&this._highlightFirstItem(e),this.position()},triggerClose:function(){this.selectivity.$el.trigger("selectivity-close")},triggerOpen:function(){this.selectivity.$el.trigger("selectivity-open")},_delegateEvents:function(){s.each(this.events,function(e,t){var i=e.indexOf(" "),n=e.slice(i+1);e=e.slice(0,i),"string"===s.type(t)&&(t=this[t]),t=t.bind(this),this.$el.on(e,n,t)}.bind(this)),this.$results.on("scroll touchmove touchend",this._scrolledProxy)},_highlightFirstItem:function(e){function t(e){for(var i=0,s=e.length;s>i;i++){var n=e[i];if(n.id)return n;if(n.children){var r=t(n.children);if(r)return r}}}var i=t(e);i?this.highlight(i):(this.highlightedResult=null,this.loadMoreHighlighted=!1)},_loadMoreClicked:function(){return this.$(".selectivity-load-more").replaceWith(this.selectivity.template("loading")),this.selectivity.loadMore(),this.selectivity.focus(),!1},_resultClicked:function(e){return this.selectItem(this.selectivity._getItemId(e)),!1},_resultHovered:function(e){var t=this.selectivity._getItemId(e),i=r.findNestedById(this.results,t);i&&this.highlight(i)},_scrolled:function(){var e=this.$(".selectivity-load-more");e.length&&e[0].offsetTop-this.$results[0].scrollTopn.bottom)&&t.scrollIntoView(e.alignToTop)},_suppressMouseWheel:function(){var e=this.selectivity.options.suppressMouseWheelSelector;if(null!==e){var t=e||".selectivity-results-container";this.$el.on("DOMMouseScroll mousewheel",t,function(e){function t(){return e.stopPropagation(),e.preventDefault(),e.returnValue=!1,!1}var i=s(this),n=this.scrollTop,r=this.scrollHeight,o=i.height(),l=e.originalEvent,u="DOMMouseScroll"===e.type?-40*l.detail:l.wheelDelta,h=u>0;if(r>o){if(!h&&-u>r-o-n)return i.scrollTop(r),t();if(h&&u>n)return i.scrollTop(0),t()}})}}}),t.exports=r.Dropdown=i},{2:2,7:7,jquery:"jquery"}],10:[function(e,t){"use strict";function i(e){var t=e.indexOf("@"),i=e.lastIndexOf("."),s=e.indexOf(" ");return t>0&&i>t+1&&i=0;i--)if(/\s/.test(e[i]))return e.slice(i+1,t);return e.slice(0,t)}function n(e,t){return e.slice(0,1)===t[0]&&e.slice(-1)===t[1]?e.slice(1,-1).trim():e.trim()}function r(e){var t=s(e),r=e.slice(0,-t.length).trim();return i(t)?(t=n(n(t,"()"),"<>"),r=n(r,'""').trim()||t,{id:t,text:r}):e.trim()?{id:e,text:e}:null}function o(e,t,n){function o(e){if(e)for(var t=0,n=e.length;n>t;t++)switch(e[t]){case";":case",":case"\n":return!0;case" ":case" ":if(i(s(e,t)))return!0;break;case'"':do t++;while(n>t&&'"'!==e[t]);break;default:continue}return!1}function l(e){for(var t=0,n=e.length;n>t;t++)switch(e[t]){case";":case",":case"\n":return{term:e.slice(0,t),input:e.slice(t+1)};case" ":case" ":if(i(s(e,t)))return{term:e.slice(0,t),input:e.slice(t+1)};break;case'"':do t++;while(n>t&&'"'!==e[t]);break;default:continue}return{}}for(;o(e);){var u=l(e);if(u.term){var a=r(u.term);!a||a.id&&h.findById(t,a.id)||n(a)}e=u.input}return e}function l(e){a.call(this,e)}var u=window.jQuery||window.Zepto,h=e(7),a=e(13),c=h.inherits(l,a,{initSearchInput:function(e){c(this,"initSearchInput",e),e.on("blur",function(){var t=e.val();i(s(t))&&this.add(r(t))}.bind(this))},setOptions:function(e){e=u.extend({createTokenItem:r,showDropdown:!1,tokenizer:o},e),c(this,"setOptions",e)}});t.exports=h.InputTypes.Email=l},{13:13,7:7,jquery:"jquery"}],11:[function(e){"use strict";function t(e,t){function h(t,s){function n(e,t){for(var i=0,s=e.length;s>i;i++)if(e.eq(i).is(t))return i;return-1}function r(){var e;if(t.highlightedResult){var n=i.quoteCssAttr(t.highlightedResult.id);e=t.$(".selectivity-result-item[data-item-id="+n+"]")[0]}else{if(!t.loadMoreHighlighted)return;e=t.$(".selectivity-load-more")[0]}var r=e.getBoundingClientRect(),o=t.$results[0].getBoundingClientRect();(r.topo.bottom)&&e.scrollIntoView(0>s)}if(t.submenu)return void h(t.submenu,s);var o=t.results;if(o.length){var l=t.$(".selectivity-result-item"),u=s>0?0:l.length-1,a=u,c=t.highlightedResult;if(c){var d=i.quoteCssAttr(c.id);if(a=n(l,"[data-item-id="+d+"]")+s,s>0?a>=l.length:0>a){if(t.hasMore)return t.highlightLoadMore(),void r();a=u}}var p=i.findNestedById(o,e._getItemId(l[a]));p&&(t.highlight(p),r())}}function a(i){var r=e.dropdown;if(r)if(i.keyCode===s){if(!t.val()){if(r.submenu){for(var o=r.submenu;o.submenu;)o=o.submenu;p=o}i.preventDefault(),d=!0}}else i.keyCode===n?h(r,1):i.keyCode===u?h(r,-1):i.keyCode===l&&setTimeout(function(){e.close({keepFocus:!1})},1)}function c(t){function i(){e.options.showDropdown!==!1&&e.open()}var s=e.dropdown;d?(t.preventDefault(),d=!1,p&&(p.close(),p=null)):t.keyCode!==r||t.ctrlKey?t.keyCode===o?(e.close(),t.preventDefault()):t.keyCode===n||t.keyCode===u?(i(),t.preventDefault()):i():(s?s.selectHighlight():e.options.showDropdown!==!1&&i(),t.preventDefault())}var d=!1,p=null;t.on("keydown",a).on("keyup",c)}var i=e(7),s=8,n=40,r=13,o=27,l=9,u=38;i.SearchInputListeners.push(t)},{7:7}],12:[function(e){"use strict";var t=e(3),i=e(7);i.Locale={ajaxError:function(e){return"Failed to fetch results for "+t(e)+""},loading:"Loading...",loadMore:"Load more...",needMoreCharacters:function(e){return"Enter "+e+" more characters to search"},noResults:"No results found",noResultsForTerm:function(e){return"No results for "+t(e)+""}}},{3:3,7:7}],13:[function(e,t){"use strict";function i(e){n.call(this,e),this.$el.html(this.template("multipleSelectInput",{enabled:this.enabled})).trigger("selectivity-init","multiple"),this._highlightedItemId=null,this.initSearchInput(this.$(".selectivity-multiple-input:not(.selectivity-width-detector)")),this._rerenderSelection(),e.positionDropdown||(this.options.positionDropdown=function(e,t){var i=t.offset(),n=e.height(),r=t.height(),o=t[0].getBoundingClientRect().top+r+n;e.css({left:i.left+"px",top:i.top+("undefined"!=typeof window&&o>s(window).height()?-n:r)+"px"}).width(t.width())})}var s=window.jQuery||window.Zepto,n=e(7),r=8,o=46,l=13,u=n.inherits(i,{add:function(e){var t=n.isValidId(e),i=t?e:this.validateItem(e)&&e.id;-1===this._value.indexOf(i)&&(this._value.push(i),t&&this.options.initSelection?this.options.initSelection([i],function(t){this._value.indexOf(i)>-1&&(e=this.validateItem(t[0]),this._data.push(e),this.triggerChange({added:e}))}.bind(this)):(t&&(e=this.getItemForId(i)),this._data.push(e),this.triggerChange({added:e}))),this.$searchInput.val("")},clear:function(){this.data([])},events:{change:"_rerenderSelection","change .selectivity-multiple-input":function(){return!1},click:"_clicked","click .selectivity-multiple-selected-item":"_itemClicked","keydown .selectivity-multiple-input":"_keyHeld","keyup .selectivity-multiple-input":"_keyReleased","paste .selectivity-multiple-input":"_onPaste","selectivity-selected":"_resultSelected"},filterResults:function(e){return e.filter(function(e){return!n.findById(this._data,e.id)},this)},getDataForValue:function(e){return e.map(this.getItemForId.bind(this)).filter(function(e){return!!e})},getValueForData:function(e){return e.map(function(e){return e.id})},remove:function(e){var t,i="object"===s.type(e)?e.id:e,r=n.findIndexById(this._data,i);r>-1&&(t=this._data[r],this._data.splice(r,1)),this._value[r]!==i&&(r=this._value.indexOf(i)),r>-1&&this._value.splice(r,1),t&&this.triggerChange({removed:t}),i===this._highlightedItemId&&(this._highlightedItemId=null)},search:function(){var e=this.$searchInput.val();this.options.tokenizer&&(e=this.options.tokenizer(e,this._data,this.add.bind(this),this.options),"string"===s.type(e)?this.$searchInput.val(e):e=""),this.dropdown&&u(this,"search")},setOptions:function(e){e=e||{};var t="backspaceHighlightsBeforeDelete";void 0===e[t]&&(e[t]=this.hasTouch),e.allowedTypes=e.allowedTypes||{},e.allowedTypes[t]="boolean",u(this,"setOptions",e)},validateData:function(e){if(null===e)return[];if("array"===s.type(e))return e.map(this.validateItem.bind(this));throw new Error("Data for MultiSelectivity instance should be array")},validateValue:function(e){if(null===e)return[];if("array"===s.type(e)){if(e.every(n.isValidId))return e;throw new Error("Value contains invalid IDs")}throw new Error("Value for MultiSelectivity instance should be an array")},_backspacePressed:function(){this.options.backspaceHighlightsBeforeDelete?this._highlightedItemId?this._deletePressed():this._value.length&&this._highlightItem(this._value.slice(-1)[0]):this._value.length&&this.remove(this._value.slice(-1)[0])},_clicked:function(){return this.enabled?(this.focus(),this._open(),!1):void 0},_createToken:function(){var e=this.$searchInput.val(),t=this.options.createTokenItem;if(e&&t){var i=t(e);i&&this.add(i)}},_deletePressed:function(){this._highlightedItemId&&this.remove(this._highlightedItemId)},_highlightItem:function(e){this._highlightedItemId=e,this.$(".selectivity-multiple-selected-item").removeClass("highlighted").filter("[data-item-id="+n.quoteCssAttr(e)+"]").addClass("highlighted"),this.hasKeyboard&&this.focus()},_itemClicked:function(e){this.enabled&&this._highlightItem(this._getItemId(e))},_itemRemoveClicked:function(e){return this.remove(this._getItemId(e)),this._updateInputWidth(),!1},_keyHeld:function(e){this._originalValue=this.$searchInput.val(),e.keyCode!==l||e.ctrlKey||e.preventDefault()},_keyReleased:function(e){var t=!!this._originalValue;e.keyCode!==l||e.ctrlKey?e.keyCode!==r||t?e.keyCode!==o||t||this._deletePressed():this._backspacePressed():this.options.createTokenItem&&this._createToken(),this._updateInputWidth()},_onPaste:function(){setTimeout(function(){this.search(),this.options.createTokenItem&&this._createToken()}.bind(this),10)},_open:function(){this.options.showDropdown!==!1&&this.open()},_renderSelectedItem:function(e){this.$searchInput.before(this.template("multipleSelectedItem",s.extend({highlighted:e.id===this._highlightedItemId,removable:!this.options.readOnly},e)));var t=n.quoteCssAttr(e.id);this.$(".selectivity-multiple-selected-item[data-item-id="+t+"]").find(".selectivity-multiple-selected-item-remove").on("click",this._itemRemoveClicked.bind(this))},_rerenderSelection:function(e){if(e=e||{},e.added)this._renderSelectedItem(e.added),this._scrollToBottom();else if(e.removed){var t=n.quoteCssAttr(e.removed.id);this.$(".selectivity-multiple-selected-item[data-item-id="+t+"]").remove()}else this.$(".selectivity-multiple-selected-item").remove(),this._data.forEach(this._renderSelectedItem,this),this._updateInputWidth(); +(e.added||e.removed)&&(this.dropdown&&this.dropdown.showResults(this.filterResults(this.results),{hasMore:this.dropdown.hasMore}),this.hasKeyboard&&this.focus()),this.positionDropdown(),this._updatePlaceholder()},_resultSelected:function(e){-1===this._value.indexOf(e.id)?this.add(e.item):this.remove(e.item)},_scrollToBottom:function(){var e=this.$(".selectivity-multiple-input-container");e.scrollTop(e.height())},_updateInputWidth:function(){if(this.enabled){var e=this.$searchInput,t=this.$(".selectivity-width-detector");t.text(e.val()||!this._data.length&&this.options.placeholder||""),e.width(t.width()+20),this.positionDropdown()}},_updatePlaceholder:function(){var e=this._data.length?"":this.options.placeholder;this.enabled?this.$searchInput.attr("placeholder",e):this.$(".selectivity-placeholder").text(e)}});t.exports=n.InputTypes.Multiple=i},{7:7,jquery:"jquery"}],14:[function(e,t){"use strict";function i(e){n.call(this,e),this.$el.html(this.template("singleSelectInput",this.options)).trigger("selectivity-init","single"),this._rerenderSelection(),e.positionDropdown||(this.options.positionDropdown=function(e,t){var i=t.offset(),n=i.top+t.height();if("undefined"!=typeof window){var r=t[0].getBoundingClientRect(),o=e.height(),l=s(window).height();r.top+o>l&&(n=Math.max(l-o+i.top-r.top,0))}e.css({left:i.left+"px",top:n+"px"}).width(t.width())}),e.showSearchInputInDropdown===!1&&this.initSearchInput(this.$(".selectivity-single-select-input"),{noSearch:!0})}var s=window.jQuery||window.Zepto,n=e(7),r=n.inherits(i,{events:{change:"_rerenderSelection",click:"_clicked","focus .selectivity-single-select-input":"_focused","selectivity-selected":"_resultSelected"},clear:function(){this.data(null)},close:function(e){this._closing=!0,r(this,"close"),e&&e.keepFocus===!1||this.$(".selectivity-single-select-input").focus(),this._closing=!1},getDataForValue:function(e){return this.getItemForId(e)},getValueForData:function(e){return e?e.id:null},open:function(e){var t=this.options.showSearchInputInDropdown!==!1;r(this,"open",s.extend({showSearchInput:t},e)),t||this.focus()},setOptions:function(e){e=e||{},e.allowedTypes=s.extend(e.allowedTypes||{},{allowClear:"boolean",showSearchInputInDropdown:"boolean"}),r(this,"setOptions",e)},validateData:function(e){return null===e?e:this.validateItem(e)},validateValue:function(e){if(null===e||n.isValidId(e))return e;throw new Error("Value for SingleSelectivity instance should be a valid ID or null")},_clicked:function(){return this.enabled?(this.dropdown?this.close():this.options.showDropdown!==!1&&this.open(),!1):void 0},_focused:function(){this.enabled&&!this._closing&&this.options.showDropdown!==!1&&this.open()},_itemRemoveClicked:function(){return this.data(null),!1},_rerenderSelection:function(){var e=this.$(".selectivity-single-result-container");this._data?(e.html(this.template("singleSelectedItem",s.extend({removable:this.options.allowClear&&!this.options.readOnly},this._data))),e.find(".selectivity-single-selected-item-remove").on("click",this._itemRemoveClicked.bind(this))):e.html(this.template("singleSelectPlaceholder",{placeholder:this.options.placeholder}))},_resultSelected:function(e){this.data(e.item),this.close()}});t.exports=n.InputTypes.Single=i},{7:7,jquery:"jquery"}],15:[function(e,t){"use strict";function i(e){this.parentMenu=e.parentMenu,n.call(this,e),this._closeSubmenuTimeout=0}var s=e(7),n=e(9),r=s.inherits(i,n,{close:function(){this.options.restoreOptions&&this.selectivity.setOptions(this.options.restoreOptions),this.options.restoreResults&&(this.selectivity.results=this.options.restoreResults),this.submenu&&this.submenu.close(),r(this,"close"),this.parentMenu&&(this.parentMenu.submenu=null,this.parentMenu=null)},highlight:function(e){if(this.submenu){if(!this.highlightedResult||this.highlightedResult.id!==e.id)return this._closeSubmenuTimeout&&clearTimeout(this._closeSubmenuTimeout),void(this._closeSubmenuTimeout=setTimeout(this._closeSubmenuAndHighlight.bind(this,e),100))}else this.parentMenu&&this.parentMenu._closeSubmenuTimeout&&(clearTimeout(this.parentMenu._closeSubmenuTimeout),this.parentMenu._closeSubmenuTimeout=0);this._doHighlight(e)},selectHighlight:function(){this.submenu?this.submenu.selectHighlight():r(this,"selectHighlight")},selectItem:function(e){var t=this.selectivity,i=s.findNestedById(t.results,e);if(i&&!i.submenu){var n={id:e,item:i};t.triggerEvent("selectivity-selecting",n)&&t.triggerEvent("selectivity-selected",n)}},showResults:function(e,t){this.submenu?this.submenu.showResults(e,t):r(this,"showResults",e,t)},triggerClose:function(){this.parentMenu?this.selectivity.$el.trigger("selectivity-close-submenu"):r(this,"triggerClose")},triggerOpen:function(){this.parentMenu?this.selectivity.$el.trigger("selectivity-open-submenu"):r(this,"triggerOpen")},_closeSubmenuAndHighlight:function(e){this.submenu&&this.submenu.close(),this._doHighlight(e)},_doHighlight:function(e){if(r(this,"highlight",e),e.submenu&&!this.submenu){var t=this.selectivity,i=t.options.dropdown||s.Dropdown;if(i){var n=s.quoteCssAttr(e.id),o=this.$(".selectivity-result-item[data-item-id="+n+"]"),l=this.$el;this.submenu=new i({parentMenu:this,position:e.submenu.positionDropdown||function(e){var t=o.offset(),i=l.width();e.css({left:t.left+i+"px",top:t.top+"px"}).width(i)},restoreOptions:{items:t.items,query:t.options.query||null},restoreResults:t.results,selectivity:t,showSearchInput:e.submenu.showSearchInput}),t.setOptions({items:e.submenu.items||null,query:e.submenu.query||null}),t.search("")}}}});s.Dropdown=i,s.findNestedById=function(e,t){for(var i=0,n=e.length;n>i;i++){var r,o=e[i];if(o.id===t?r=o:o.children?r=s.findNestedById(o.children,t):o.submenu&&o.submenu.items&&(r=s.findNestedById(o.submenu.items,t)),r)return r}return null},t.exports=i},{7:7,9:9}],16:[function(e){"use strict";var t=e(3),i=e(7);e(12),i.Templates={dropdown:function(e){var i=e.dropdownCssClass?" "+e.dropdownCssClass:"",s="";if(e.showSearchInput){i+=" has-search-input";var n=e.searchInputPlaceholder;s='
"}return'
'+s+'
'},error:function(e){return'
'+(e.escape?t(e.message):e.message)+"
"},loading:function(){return'
'+i.Locale.loading+"
"},loadMore:function(){return'
'+i.Locale.loadMore+"
"},multipleSelectInput:function(e){return'
'+(e.enabled?'':'
')+'
'},multipleSelectedItem:function(e){var i=e.highlighted?" highlighted":"";return''+(e.removable?'':"")+t(e.text)+""},noResults:function(e){var t=i.Locale;return'
'+(e.term?t.noResultsForTerm(e.term):t.noResults)+"
"},resultChildren:function(e){return'
'+e.childrenHtml+"
"},resultItem:function(e){return'
'+t(e.text)+(e.submenu?'':"")+"
"},resultLabel:function(e){return'
'+t(e.text)+"
"},singleSelectInput:'
',singleSelectPlaceholder:function(e){return'
'+t(e.placeholder)+"
"},singleSelectedItem:function(e){return''+(e.removable?'':"")+t(e.text)+""},selectCompliance:function(e){return"multiple"===e.mode&&"[]"!==e.name.slice(-2)&&(e.name+="[]"),'"},selectOptionCompliance:function(e){return'"}}},{12:12,3:3,7:7}],17:[function(e){"use strict";function t(e,t,i,n){function r(e){return e?u.some(function(t){return e.indexOf(t)>-1}):!1}function o(e){for(var t=0,i=e.length;i>t;t++)if(u.indexOf(e[t])>-1)return{term:e.slice(0,t),input:e.slice(t+1)};return{}}for(var l=n.createTokenItem||function(e){return e?{id:e,text:e}:null},u=n.tokenSeparators;r(e);){var h=o(e);if(h.term){var a=l(h.term);a&&!s.findById(t,a.id)&&i(a)}e=h.input}return e}var i=window.jQuery||window.Zepto,s=e(7);s.OptionListeners.push(function(e,s){s.tokenSeparators&&(s.allowedTypes=i.extend({tokenSeparators:"array"},s.allowedTypes),s.tokenizer=s.tokenizer||t)})},{7:7,jquery:"jquery"}],18:[function(e){"use strict";function t(e,t){var i=t.multiple?[]:null,n=function(){var e=s(this);if(e.is("option")){var r=e.text(),o=e.attr("value")||r;if(e.prop("selected")){var l={id:o,text:r};t.multiple?i.push(l):i=l}return{id:o,text:e.attr("label")||r}}return{text:e.attr("label"),children:e.children("option,optgroup").map(n).get()}};t.allowClear="allowClear"in t?t.allowClear:!e.prop("required");var r=e.children("option,optgroup").map(n).get();t.items=t.query?null:r,t.placeholder=t.placeholder||e.data("placeholder")||"",t.data=i;var o=(e.attr("class")||"selectivity-input").split(" ");-1===o.indexOf("selectivity-input")&&o.push("selectivity-input");var l=s("
").attr({id:e.attr("id"),"class":o.join(" "),style:e.attr("style"),"data-name":e.attr("name")});return e.replaceWith(l),l}function i(e){var t=e.$el;t.on("selectivity-init",function(i,s){t.append(e.template("selectCompliance",{name:t.attr("data-name"),mode:s})).removeAttr("data-name")}).on("selectivity-init change",function(){var i=e._data,s=t.find("select");i instanceof Array?(s.empty(),i.forEach(function(t){s.append(e.template("selectOptionCompliance",t))})):i?s.html(e.template("selectOptionCompliance",i)):s.empty()})}var s=window.jQuery||window.Zepto,n=e(7);n.OptionListeners.push(function(e,s){var n=e.$el;n.is("select")&&(n.attr("autofocus")&&setTimeout(function(){e.focus()},1),e.$el=t(n,s),e.$el[0].selectivity=e,i(e))})},{7:7,jquery:"jquery"}]},{},[1])(1)}); \ No newline at end of file diff --git a/src/selectivity-templates.js b/src/selectivity-templates.js index 414a8b4..40ae941 100644 --- a/src/selectivity-templates.js +++ b/src/selectivity-templates.js @@ -278,6 +278,9 @@ Selectivity.Templates = { * mode - Mode in which select exists, single or multiple. */ selectCompliance: function(options) { + if (options.mode === 'multiple' && options.name.slice(-2) !== '[]') { + options.name += '[]'; + } return (''); },