diff --git a/.gitignore b/.gitignore
index f970be09..07e6e472 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,7 +1 @@
-/*.user
-/*.sln
-/*.suo
-/.idea*
-/*.xml
-/bower_components
-/node_modules/*
+/node_modules
diff --git a/bower.json b/bower.json
deleted file mode 100644
index 45d74a08..00000000
--- a/bower.json
+++ /dev/null
@@ -1,24 +0,0 @@
-{
- "name": "devbridge-autocomplete",
- "version": "1.2.14",
- "homepage": "https://github.com/devbridge/jQuery-Autocomplete",
- "authors": [
- "Tomas Kirda"
- ],
- "description": "Autocomplete provides suggestions while you type into the text field.",
- "main": "dist/jquery.autocomplete.js",
- "keywords": [
- "ajax",
- "autocomplete"
- ],
- "license": "MIT",
- "ignore": [
- "**/.*",
- "node_modules",
- "bower_components",
- "spec"
- ],
- "dependencies": {
- "jquery": ">=1.7"
- }
-}
\ No newline at end of file
diff --git a/content/styles.css b/content/styles.css
index 5db52342..b28deb3d 100644
--- a/content/styles.css
+++ b/content/styles.css
@@ -1,12 +1,11 @@
body { font-family: sans-serif; font-size: 14px; line-height: 1.6em; margin: 0; padding: 0; }
.container { width: 800px; margin: 0 auto; }
-.autocomplete-suggestions { border: 1px solid #999; background: #FFF; cursor: default; overflow: auto; -webkit-box-shadow: 1px 4px 3px rgba(50, 50, 50, 0.64); -moz-box-shadow: 1px 4px 3px rgba(50, 50, 50, 0.64); box-shadow: 1px 4px 3px rgba(50, 50, 50, 0.64); }
+.autocomplete-suggestions { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; border: 1px solid #999; background: #FFF; cursor: default; overflow: auto; -webkit-box-shadow: 1px 4px 3px rgba(50, 50, 50, 0.64); -moz-box-shadow: 1px 4px 3px rgba(50, 50, 50, 0.64); box-shadow: 1px 4px 3px rgba(50, 50, 50, 0.64); }
.autocomplete-suggestion { padding: 2px 5px; white-space: nowrap; overflow: hidden; }
.autocomplete-no-suggestion { padding: 2px 5px;}
.autocomplete-selected { background: #F0F0F0; }
.autocomplete-suggestions strong { font-weight: bold; color: #000; }
-.autocomplete-group { padding: 2px 5px; }
-.autocomplete-group strong { font-weight: bold; font-size: 16px; color: #000; display: block; border-bottom: 1px solid #000; }
+.autocomplete-group { padding: 2px 5px; font-weight: bold; font-size: 16px; color: #000; display: block; border-bottom: 1px solid #000; }
input { font-size: 28px; padding: 10px; border: 1px solid #CCC; display: block; margin: 20px 0; }
diff --git a/devbridge-autocomplete.jquery.json b/devbridge-autocomplete.jquery.json
index ade1d79d..c99dfc72 100644
--- a/devbridge-autocomplete.jquery.json
+++ b/devbridge-autocomplete.jquery.json
@@ -6,7 +6,7 @@
"ajax",
"autocomplete"
],
- "version": "1.2.14",
+ "version": "1.5.0",
"author": {
"name": "Tomas Kirda",
"url": "https://github.com/tkirda"
diff --git a/dist/jquery.autocomplete.js b/dist/jquery.autocomplete.js
index 2004a9d1..6f04a755 100644
--- a/dist/jquery.autocomplete.js
+++ b/dist/jquery.autocomplete.js
@@ -1,954 +1,1045 @@
/**
-* Ajax Autocomplete for jQuery, version 1.2.14
-* (c) 2014 Tomas Kirda
-*
-* Ajax Autocomplete for jQuery is freely distributable under the terms of an MIT-style license.
-* For details, see the web site: https://github.com/devbridge/jQuery-Autocomplete
-*/
-
-/*jslint browser: true, white: true, plusplus: true */
-/*global define, window, document, jQuery, exports */
+ * Ajax Autocomplete for jQuery, version 1.5.0
+ * (c) 2017 Tomas Kirda
+ *
+ * Ajax Autocomplete for jQuery is freely distributable under the terms of an MIT-style license.
+ * For details, see the web site: https://github.com/devbridge/jQuery-Autocomplete
+ */
// Expose plugin as an AMD module if AMD loader is present:
(function (factory) {
- 'use strict';
- if (typeof define === 'function' && define.amd) {
+ "use strict";
+ if (typeof define === "function" && define.amd) {
// AMD. Register as an anonymous module.
- define(['jquery'], factory);
- } else if (typeof exports === 'object' && typeof require === 'function') {
+ define(["jquery"], factory);
+ } else if (typeof exports === "object" && typeof require === "function") {
// Browserify
- factory(require('jquery'));
+ factory(require("jquery"));
} else {
// Browser globals
factory(jQuery);
}
-}(function ($) {
- 'use strict';
-
- var
- utils = (function () {
- return {
+})(
+ /**
+ * @param {jQuery} $
+ */
+ function ($) {
+ "use strict";
+
+ var utils = {
escapeRegExChars: function (value) {
- return value.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
+ return value.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&");
},
createNode: function (containerClass) {
- var div = document.createElement('div');
+ var div = document.createElement("div");
div.className = containerClass;
- div.style.position = 'absolute';
- div.style.display = 'none';
+ div.style.position = "absolute";
+ div.style.display = "none";
return div;
- }
- };
- }()),
-
- keys = {
- ESC: 27,
- TAB: 9,
- RETURN: 13,
- LEFT: 37,
- UP: 38,
- RIGHT: 39,
- DOWN: 40
- };
-
- function Autocomplete(el, options) {
- var noop = function () { },
- that = this,
- defaults = {
- ajaxSettings: {},
- autoSelectFirst: false,
- appendTo: document.body,
- serviceUrl: null,
- lookup: null,
- onSelect: null,
- width: 'auto',
- minChars: 1,
- maxHeight: 300,
- deferRequestBy: 0,
- params: {},
- formatResult: Autocomplete.formatResult,
- delimiter: null,
- zIndex: 9999,
- type: 'GET',
- noCache: false,
- onSearchStart: noop,
- onSearchComplete: noop,
- onSearchError: noop,
- containerClass: 'autocomplete-suggestions',
- tabDisabled: false,
- dataType: 'text',
- currentRequest: null,
- triggerSelectOnValidInput: true,
- preventBadQueries: true,
- lookupFilter: function (suggestion, originalQuery, queryLowerCase) {
- return suggestion.value.toLowerCase().indexOf(queryLowerCase) !== -1;
- },
- paramName: 'query',
- transformResult: function (response) {
- return typeof response === 'string' ? $.parseJSON(response) : response;
},
- showNoSuggestionNotice: false,
- noSuggestionNotice: 'No results',
- orientation: 'bottom',
- forceFixPosition: false
+ },
+ keys = { ESC: 27, TAB: 9, RETURN: 13, LEFT: 37, UP: 38, RIGHT: 39, DOWN: 40 },
+ noop = $.noop;
+
+ function Autocomplete(el, options) {
+ var that = this;
+
+ // Shared variables:
+ that.element = el;
+ that.el = $(el);
+ that.suggestions = [];
+ that.badQueries = [];
+ that.selectedIndex = -1;
+ that.currentValue = that.element.value;
+ that.timeoutId = null;
+ that.cachedResponse = {};
+ that.onChangeTimeout = null;
+ that.onChange = null;
+ that.isLocal = false;
+ that.suggestionsContainer = null;
+ that.noSuggestionsContainer = null;
+ that.options = $.extend(true, {}, Autocomplete.defaults, options);
+ that.classes = {
+ selected: "autocomplete-selected",
+ suggestion: "autocomplete-suggestion",
};
+ that.hint = null;
+ that.hintValue = "";
+ that.selection = null;
+
+ // Initialize and set options:
+ that.initialize();
+ that.setOptions(options);
+ }
- // Shared variables:
- that.element = el;
- that.el = $(el);
- that.suggestions = [];
- that.badQueries = [];
- that.selectedIndex = -1;
- that.currentValue = that.element.value;
- that.intervalId = 0;
- that.cachedResponse = {};
- that.onChangeInterval = null;
- that.onChange = null;
- that.isLocal = false;
- that.suggestionsContainer = null;
- that.noSuggestionsContainer = null;
- that.options = $.extend({}, defaults, options);
- that.classes = {
- selected: 'autocomplete-selected',
- suggestion: 'autocomplete-suggestion'
+ Autocomplete.utils = utils;
+
+ $.Autocomplete = Autocomplete;
+
+ Autocomplete.defaults = {
+ ajaxSettings: {},
+ autoSelectFirst: false,
+ appendTo: "body",
+ serviceUrl: null,
+ lookup: null,
+ onSelect: null,
+ onHint: null,
+ width: "auto",
+ minChars: 1,
+ maxHeight: 300,
+ deferRequestBy: 0,
+ params: {},
+ formatResult: _formatResult,
+ formatGroup: _formatGroup,
+ delimiter: null,
+ zIndex: 9999,
+ type: "GET",
+ noCache: false,
+ onSearchStart: noop,
+ onSearchComplete: noop,
+ onSearchError: noop,
+ preserveInput: false,
+ containerClass: "autocomplete-suggestions",
+ tabDisabled: false,
+ dataType: "text",
+ currentRequest: null,
+ triggerSelectOnValidInput: true,
+ preventBadQueries: true,
+ lookupFilter: _lookupFilter,
+ paramName: "query",
+ transformResult: _transformResult,
+ showNoSuggestionNotice: false,
+ noSuggestionNotice: "No results",
+ orientation: "bottom",
+ forceFixPosition: false,
};
- that.hint = null;
- that.hintValue = '';
- that.selection = null;
- // Initialize and set options:
- that.initialize();
- that.setOptions(options);
- }
+ function _lookupFilter(suggestion, originalQuery, queryLowerCase) {
+ return suggestion.value.toLowerCase().indexOf(queryLowerCase) !== -1;
+ }
- Autocomplete.utils = utils;
+ function _transformResult(response) {
+ return typeof response === "string" ? JSON.parse(response) : response;
+ }
- $.Autocomplete = Autocomplete;
+ function _formatResult(suggestion, currentValue) {
+ // Do not replace anything if the current value is empty
+ if (!currentValue) {
+ return suggestion.value;
+ }
+
+ var pattern = "(" + utils.escapeRegExChars(currentValue) + ")";
+
+ return suggestion.value
+ .replace(new RegExp(pattern, "gi"), "$1 ")
+ .replace(/&/g, "&")
+ .replace(//g, ">")
+ .replace(/"/g, """)
+ .replace(/<(\/?strong)>/g, "<$1>");
+ }
- Autocomplete.formatResult = function (suggestion, currentValue) {
- var pattern = '(' + utils.escapeRegExChars(currentValue) + ')';
+ function _formatGroup(suggestion, category) {
+ return '
' + category + "
";
+ }
+
+ Autocomplete.prototype = {
+ initialize: function () {
+ var that = this,
+ suggestionSelector = "." + that.classes.suggestion,
+ selected = that.classes.selected,
+ options = that.options,
+ container;
- return suggestion.value.replace(new RegExp(pattern, 'gi'), '$1<\/strong>');
- };
+ that.element.setAttribute("autocomplete", "off");
- Autocomplete.prototype = {
+ // html() deals with many types: htmlString or Element or Array or jQuery
+ that.noSuggestionsContainer = $('
')
+ .html(this.options.noSuggestionNotice)
+ .get(0);
- killerFn: null,
+ that.suggestionsContainer = Autocomplete.utils.createNode(options.containerClass);
- initialize: function () {
- var that = this,
- suggestionSelector = '.' + that.classes.suggestion,
- selected = that.classes.selected,
- options = that.options,
- container;
+ container = $(that.suggestionsContainer);
- // Remove autocomplete attribute to prevent native suggestions:
- that.element.setAttribute('autocomplete', 'off');
+ container.appendTo(options.appendTo || "body");
- that.killerFn = function (e) {
- if ($(e.target).closest('.' + that.options.containerClass).length === 0) {
- that.killSuggestions();
- that.disableKillerFn();
+ // Only set width if it was provided:
+ if (options.width !== "auto") {
+ container.css("width", options.width);
}
- };
- // html() deals with many types: htmlString or Element or Array or jQuery
- that.noSuggestionsContainer = $('
')
- .html(this.options.noSuggestionNotice).get(0);
+ // Listen for mouse over event on suggestions list:
+ container.on("mouseover.autocomplete", suggestionSelector, function () {
+ that.activate($(this).data("index"));
+ });
- that.suggestionsContainer = Autocomplete.utils.createNode(options.containerClass);
+ // Deselect active element when mouse leaves suggestions container:
+ container.on("mouseout.autocomplete", function () {
+ that.selectedIndex = -1;
+ container.children("." + selected).removeClass(selected);
+ });
- container = $(that.suggestionsContainer);
+ // Listen for click event on suggestions list:
+ container.on("click.autocomplete", suggestionSelector, function () {
+ that.select($(this).data("index"));
+ });
- container.appendTo(options.appendTo);
+ container.on("click.autocomplete", function () {
+ clearTimeout(that.blurTimeoutId);
+ });
- // Only set width if it was provided:
- if (options.width !== 'auto') {
- container.width(options.width);
- }
+ that.fixPositionCapture = function () {
+ if (that.visible) {
+ that.fixPosition();
+ }
+ };
- // Listen for mouse over event on suggestions list:
- container.on('mouseover.autocomplete', suggestionSelector, function () {
- that.activate($(this).data('index'));
- });
+ $(window).on("resize.autocomplete", that.fixPositionCapture);
- // Deselect active element when mouse leaves suggestions container:
- container.on('mouseout.autocomplete', function () {
- that.selectedIndex = -1;
- container.children('.' + selected).removeClass(selected);
- });
+ that.el.on("keydown.autocomplete", function (e) {
+ that.onKeyPress(e);
+ });
+ that.el.on("keyup.autocomplete", function (e) {
+ that.onKeyUp(e);
+ });
+ that.el.on("blur.autocomplete", function () {
+ that.onBlur();
+ });
+ that.el.on("focus.autocomplete", function () {
+ that.onFocus();
+ });
+ that.el.on("change.autocomplete", function (e) {
+ that.onKeyUp(e);
+ });
+ that.el.on("input.autocomplete", function (e) {
+ that.onKeyUp(e);
+ });
+ },
- // Listen for click event on suggestions list:
- container.on('click.autocomplete', suggestionSelector, function () {
- that.select($(this).data('index'));
- });
+ onFocus: function () {
+ var that = this;
- that.fixPositionCapture = function () {
- if (that.visible) {
- that.fixPosition();
+ if (that.disabled) {
+ return;
}
- };
- $(window).on('resize.autocomplete', that.fixPositionCapture);
+ that.fixPosition();
- that.el.on('keydown.autocomplete', function (e) { that.onKeyPress(e); });
- that.el.on('keyup.autocomplete', function (e) { that.onKeyUp(e); });
- that.el.on('blur.autocomplete', function () { that.onBlur(); });
- that.el.on('focus.autocomplete', function () { that.onFocus(); });
- that.el.on('change.autocomplete', function (e) { that.onKeyUp(e); });
- },
-
- onFocus: function () {
- var that = this;
- that.fixPosition();
- if (that.options.minChars <= that.el.val().length) {
- that.onValueChange();
- }
- },
+ if (that.el.val().length >= that.options.minChars) {
+ that.onValueChange();
+ }
+ },
- onBlur: function () {
- this.enableKillerFn();
- },
+ onBlur: function () {
+ var that = this,
+ options = that.options,
+ value = that.el.val(),
+ query = that.getQuery(value);
- setOptions: function (suppliedOptions) {
- var that = this,
- options = that.options;
+ // If user clicked on a suggestion, hide() will
+ // be canceled, otherwise close suggestions
+ that.blurTimeoutId = setTimeout(function () {
+ that.hide();
- $.extend(options, suppliedOptions);
+ if (that.selection && that.currentValue !== query) {
+ (options.onInvalidateSelection || $.noop).call(that.element);
+ }
+ }, 200);
+ },
- that.isLocal = $.isArray(options.lookup);
+ abortAjax: function () {
+ var that = this;
+ if (that.currentRequest) {
+ that.currentRequest.abort();
+ that.currentRequest = null;
+ }
+ },
- if (that.isLocal) {
- options.lookup = that.verifySuggestionsFormat(options.lookup);
- }
+ setOptions: function (suppliedOptions) {
+ var that = this,
+ options = $.extend({}, that.options, suppliedOptions);
- options.orientation = that.validateOrientation(options.orientation, 'bottom');
+ that.isLocal = Array.isArray(options.lookup);
- // Adjust height, width and z-index:
- $(that.suggestionsContainer).css({
- 'max-height': options.maxHeight + 'px',
- 'width': options.width + 'px',
- 'z-index': options.zIndex
- });
- },
+ if (that.isLocal) {
+ options.lookup = that.verifySuggestionsFormat(options.lookup);
+ }
+ options.orientation = that.validateOrientation(options.orientation, "bottom");
- clearCache: function () {
- this.cachedResponse = {};
- this.badQueries = [];
- },
+ // Adjust height, width and z-index:
+ $(that.suggestionsContainer).css({
+ "max-height": options.maxHeight + "px",
+ width: options.width + "px",
+ "z-index": options.zIndex,
+ });
- clear: function () {
- this.clearCache();
- this.currentValue = '';
- this.suggestions = [];
- },
+ this.options = options;
+ },
+
+ clearCache: function () {
+ this.cachedResponse = {};
+ this.badQueries = [];
+ },
+
+ clear: function () {
+ this.clearCache();
+ this.currentValue = "";
+ this.suggestions = [];
+ },
+
+ disable: function () {
+ var that = this;
+ that.disabled = true;
+ clearTimeout(that.onChangeTimeout);
+ that.abortAjax();
+ },
+
+ enable: function () {
+ this.disabled = false;
+ },
+
+ fixPosition: function () {
+ // Use only when container has already its content
+
+ var that = this,
+ $container = $(that.suggestionsContainer),
+ containerParent = $container.parent().get(0);
+ // Fix position automatically when appended to body.
+ // In other cases force parameter must be given.
+ if (containerParent !== document.body && !that.options.forceFixPosition) {
+ return;
+ }
- disable: function () {
- var that = this;
- that.disabled = true;
- clearInterval(that.onChangeInterval);
- if (that.currentRequest) {
- that.currentRequest.abort();
- }
- },
-
- enable: function () {
- this.disabled = false;
- },
-
- fixPosition: function () {
- // Use only when container has already its content
-
- var that = this,
- $container = $(that.suggestionsContainer),
- containerParent = $container.parent().get(0);
- // Fix position automatically when appended to body.
- // In other cases force parameter must be given.
- if (containerParent !== document.body && !that.options.forceFixPosition)
- return;
-
- // Choose orientation
- var orientation = that.options.orientation,
- containerHeight = $container.outerHeight(),
- height = that.el.outerHeight(),
- offset = that.el.offset(),
- styles = { 'top': offset.top, 'left': offset.left };
-
- if (orientation == 'auto') {
- var viewPortHeight = $(window).height(),
- scrollTop = $(window).scrollTop(),
- topOverflow = -scrollTop + offset.top - containerHeight,
- bottomOverflow = scrollTop + viewPortHeight - (offset.top + height + containerHeight);
-
- orientation = (Math.max(topOverflow, bottomOverflow) === topOverflow)
- ? 'top'
- : 'bottom';
- }
+ // Choose orientation
+ var orientation = that.options.orientation,
+ containerHeight = $container.outerHeight(),
+ height = that.el.outerHeight(),
+ offset = that.el.offset(),
+ styles = { top: offset.top, left: offset.left };
+
+ if (orientation === "auto") {
+ var viewPortHeight = $(window).height(),
+ scrollTop = $(window).scrollTop(),
+ topOverflow = -scrollTop + offset.top - containerHeight,
+ bottomOverflow =
+ scrollTop + viewPortHeight - (offset.top + height + containerHeight);
+
+ orientation =
+ Math.max(topOverflow, bottomOverflow) === topOverflow ? "top" : "bottom";
+ }
- if (orientation === 'top') {
- styles.top += -containerHeight;
- } else {
- styles.top += height;
- }
+ if (orientation === "top") {
+ styles.top += -containerHeight;
+ } else {
+ styles.top += height;
+ }
- // If container is not positioned to body,
- // correct its position using offset parent offset
- if(containerParent !== document.body) {
- var opacity = $container.css('opacity'),
- parentOffsetDiff;
+ // If container is not positioned to body,
+ // correct its position using offset parent offset
+ if (containerParent !== document.body) {
+ var opacity = $container.css("opacity"),
+ parentOffsetDiff;
- if (!that.visible){
- $container.css('opacity', 0).show();
+ if (!that.visible) {
+ $container.css("opacity", 0).show();
}
- parentOffsetDiff = $container.offsetParent().offset();
- styles.top -= parentOffsetDiff.top;
- styles.left -= parentOffsetDiff.left;
+ parentOffsetDiff = $container.offsetParent().offset();
+ styles.top -= parentOffsetDiff.top;
+ styles.top += containerParent.scrollTop;
+ styles.left -= parentOffsetDiff.left;
- if (!that.visible){
- $container.css('opacity', opacity).hide();
+ if (!that.visible) {
+ $container.css("opacity", opacity).hide();
+ }
}
- }
- // -2px to account for suggestions border.
- if (that.options.width === 'auto') {
- styles.width = (that.el.outerWidth() - 2) + 'px';
- }
-
- $container.css(styles);
- },
+ if (that.options.width === "auto") {
+ styles.width = that.el.outerWidth() + "px";
+ }
- enableKillerFn: function () {
- var that = this;
- $(document).on('click.autocomplete', that.killerFn);
- },
+ $container.css(styles);
+ },
- disableKillerFn: function () {
- var that = this;
- $(document).off('click.autocomplete', that.killerFn);
- },
+ isCursorAtEnd: function () {
+ var that = this,
+ valLength = that.el.val().length,
+ selectionStart = that.element.selectionStart,
+ range;
- killSuggestions: function () {
- var that = this;
- that.stopKillSuggestions();
- that.intervalId = window.setInterval(function () {
- that.hide();
- that.stopKillSuggestions();
- }, 50);
- },
-
- stopKillSuggestions: function () {
- window.clearInterval(this.intervalId);
- },
-
- isCursorAtEnd: function () {
- var that = this,
- valLength = that.el.val().length,
- selectionStart = that.element.selectionStart,
- range;
-
- if (typeof selectionStart === 'number') {
- return selectionStart === valLength;
- }
- if (document.selection) {
- range = document.selection.createRange();
- range.moveStart('character', -valLength);
- return valLength === range.text.length;
- }
- return true;
- },
+ if (typeof selectionStart === "number") {
+ return selectionStart === valLength;
+ }
+ if (document.selection) {
+ range = document.selection.createRange();
+ range.moveStart("character", -valLength);
+ return valLength === range.text.length;
+ }
+ return true;
+ },
- onKeyPress: function (e) {
- var that = this;
+ onKeyPress: function (e) {
+ var that = this;
- // If suggestions are hidden and user presses arrow down, display suggestions:
- if (!that.disabled && !that.visible && e.which === keys.DOWN && that.currentValue) {
- that.suggest();
- return;
- }
-
- if (that.disabled || !that.visible) {
- return;
- }
+ // If suggestions are hidden and user presses arrow down, display suggestions:
+ if (!that.disabled && !that.visible && e.which === keys.DOWN && that.currentValue) {
+ that.suggest();
+ return;
+ }
- switch (e.which) {
- case keys.ESC:
- that.el.val(that.currentValue);
- that.hide();
- break;
- case keys.RIGHT:
- if (that.hint && that.options.onHint && that.isCursorAtEnd()) {
- that.selectHint();
- break;
- }
+ if (that.disabled || !that.visible) {
return;
- case keys.TAB:
- if (that.hint && that.options.onHint) {
- that.selectHint();
- return;
- }
- // Fall through to RETURN
- case keys.RETURN:
- if (that.selectedIndex === -1) {
+ }
+
+ switch (e.which) {
+ case keys.ESC:
+ that.el.val(that.currentValue);
that.hide();
+ break;
+ case keys.RIGHT:
+ if (that.hint && that.options.onHint && that.isCursorAtEnd()) {
+ that.selectHint();
+ break;
+ }
return;
- }
- that.select(that.selectedIndex);
- if (e.which === keys.TAB && that.options.tabDisabled === false) {
+ case keys.TAB:
+ if (that.hint && that.options.onHint) {
+ that.selectHint();
+ return;
+ }
+ if (that.selectedIndex === -1) {
+ that.hide();
+ return;
+ }
+ that.select(that.selectedIndex);
+ if (that.options.tabDisabled === false) {
+ return;
+ }
+ break;
+ case keys.RETURN:
+ if (that.selectedIndex === -1) {
+ that.hide();
+ return;
+ }
+ that.select(that.selectedIndex);
+ break;
+ case keys.UP:
+ that.moveUp();
+ break;
+ case keys.DOWN:
+ that.moveDown();
+ break;
+ default:
return;
- }
- break;
- case keys.UP:
- that.moveUp();
- break;
- case keys.DOWN:
- that.moveDown();
- break;
- default:
+ }
+
+ // Cancel event if function did not return:
+ e.stopImmediatePropagation();
+ e.preventDefault();
+ },
+
+ onKeyUp: function (e) {
+ var that = this;
+
+ if (that.disabled) {
return;
- }
+ }
- // Cancel event if function did not return:
- e.stopImmediatePropagation();
- e.preventDefault();
- },
+ switch (e.which) {
+ case keys.UP:
+ case keys.DOWN:
+ return;
+ }
- onKeyUp: function (e) {
- var that = this;
+ clearTimeout(that.onChangeTimeout);
- if (that.disabled) {
- return;
- }
+ if (that.currentValue !== that.el.val()) {
+ that.findBestHint();
+ if (that.options.deferRequestBy > 0) {
+ // Defer lookup in case when value changes very quickly:
+ that.onChangeTimeout = setTimeout(function () {
+ that.onValueChange();
+ }, that.options.deferRequestBy);
+ } else {
+ that.onValueChange();
+ }
+ }
+ },
- switch (e.which) {
- case keys.UP:
- case keys.DOWN:
+ onValueChange: function () {
+ if (this.ignoreValueChange) {
+ this.ignoreValueChange = false;
return;
- }
+ }
- clearInterval(that.onChangeInterval);
+ var that = this,
+ options = that.options,
+ value = that.el.val(),
+ query = that.getQuery(value);
- if (that.currentValue !== that.el.val()) {
- that.findBestHint();
- if (that.options.deferRequestBy > 0) {
- // Defer lookup in case when value changes very quickly:
- that.onChangeInterval = setInterval(function () {
- that.onValueChange();
- }, that.options.deferRequestBy);
- } else {
- that.onValueChange();
+ if (that.selection && that.currentValue !== query) {
+ that.selection = null;
+ (options.onInvalidateSelection || $.noop).call(that.element);
}
- }
- },
-
- onValueChange: function () {
- var that = this,
- options = that.options,
- value = that.el.val(),
- query = that.getQuery(value),
- index;
-
- if (that.selection && that.currentValue !== query) {
- that.selection = null;
- (options.onInvalidateSelection || $.noop).call(that.element);
- }
- clearInterval(that.onChangeInterval);
- that.currentValue = value;
- that.selectedIndex = -1;
+ clearTimeout(that.onChangeTimeout);
+ that.currentValue = value;
+ that.selectedIndex = -1;
- // Check existing suggestion for the match before proceeding:
- if (options.triggerSelectOnValidInput) {
- index = that.findSuggestionIndex(query);
- if (index !== -1) {
- that.select(index);
+ // Check existing suggestion for the match before proceeding:
+ if (options.triggerSelectOnValidInput && that.isExactMatch(query)) {
+ that.select(0);
return;
}
- }
- if (query.length < options.minChars) {
- that.hide();
- } else {
- that.getSuggestions(query);
- }
- },
+ if (query.length < options.minChars) {
+ that.hide();
+ } else {
+ that.getSuggestions(query);
+ }
+ },
- findSuggestionIndex: function (query) {
- var that = this,
- index = -1,
- queryLowerCase = query.toLowerCase();
+ isExactMatch: function (query) {
+ var suggestions = this.suggestions;
- $.each(that.suggestions, function (i, suggestion) {
- if (suggestion.value.toLowerCase() === queryLowerCase) {
- index = i;
- return false;
- }
- });
+ return (
+ suggestions.length === 1 &&
+ suggestions[0].value.toLowerCase() === query.toLowerCase()
+ );
+ },
- return index;
- },
+ getQuery: function (value) {
+ var delimiter = this.options.delimiter,
+ parts;
- getQuery: function (value) {
- var delimiter = this.options.delimiter,
- parts;
+ if (!delimiter) {
+ return value;
+ }
+ parts = value.split(delimiter);
+ return parts[parts.length - 1].trim();
+ },
+
+ getSuggestionsLocal: function (query) {
+ var that = this,
+ options = that.options,
+ queryLowerCase = query.toLowerCase(),
+ filter = options.lookupFilter,
+ limit = parseInt(options.lookupLimit, 10),
+ data;
+
+ data = {
+ suggestions: $.grep(options.lookup, function (suggestion) {
+ return filter(suggestion, query, queryLowerCase);
+ }),
+ };
- if (!delimiter) {
- return value;
- }
- parts = value.split(delimiter);
- return $.trim(parts[parts.length - 1]);
- },
-
- getSuggestionsLocal: function (query) {
- var that = this,
- options = that.options,
- queryLowerCase = query.toLowerCase(),
- filter = options.lookupFilter,
- limit = parseInt(options.lookupLimit, 10),
- data;
-
- data = {
- suggestions: $.grep(options.lookup, function (suggestion) {
- return filter(suggestion, query, queryLowerCase);
- })
- };
+ if (limit && data.suggestions.length > limit) {
+ data.suggestions = data.suggestions.slice(0, limit);
+ }
- if (limit && data.suggestions.length > limit) {
- data.suggestions = data.suggestions.slice(0, limit);
- }
+ return data;
+ },
- return data;
- },
+ getSuggestions: function (q) {
+ var response,
+ that = this,
+ options = that.options,
+ serviceUrl = options.serviceUrl,
+ params,
+ cacheKey,
+ ajaxSettings;
- getSuggestions: function (q) {
- var response,
- that = this,
- options = that.options,
- serviceUrl = options.serviceUrl,
- params,
- cacheKey,
- ajaxSettings;
+ options.params[options.paramName] = q;
- options.params[options.paramName] = q;
- params = options.ignoreParams ? null : options.params;
+ if (options.onSearchStart.call(that.element, options.params) === false) {
+ return;
+ }
- if (options.onSearchStart.call(that.element, options.params) === false) {
- return;
- }
+ params = options.ignoreParams ? null : options.params;
- if (that.isLocal) {
- response = that.getSuggestionsLocal(q);
- } else {
- if ($.isFunction(serviceUrl)) {
- serviceUrl = serviceUrl.call(that.element, q);
+ if (typeof options.lookup === "function") {
+ options.lookup(q, function (data) {
+ that.suggestions = data.suggestions;
+ that.suggest();
+ options.onSearchComplete.call(that.element, q, data.suggestions);
+ });
+ return;
}
- cacheKey = serviceUrl + '?' + $.param(params || {});
- response = that.cachedResponse[cacheKey];
- }
- if (response && $.isArray(response.suggestions)) {
- that.suggestions = response.suggestions;
- that.suggest();
- options.onSearchComplete.call(that.element, q, response.suggestions);
- } else if (!that.isBadQuery(q)) {
- if (that.currentRequest) {
- that.currentRequest.abort();
+ if (that.isLocal) {
+ response = that.getSuggestionsLocal(q);
+ } else {
+ if (typeof serviceUrl === "function") {
+ serviceUrl = serviceUrl.call(that.element, q);
+ }
+ cacheKey = serviceUrl + "?" + $.param(params || {});
+ response = that.cachedResponse[cacheKey];
}
- ajaxSettings = {
- url: serviceUrl,
- data: params,
- type: options.type,
- dataType: options.dataType
- };
+ if (response && Array.isArray(response.suggestions)) {
+ that.suggestions = response.suggestions;
+ that.suggest();
+ options.onSearchComplete.call(that.element, q, response.suggestions);
+ } else if (!that.isBadQuery(q)) {
+ that.abortAjax();
+
+ ajaxSettings = {
+ url: serviceUrl,
+ data: params,
+ type: options.type,
+ dataType: options.dataType,
+ };
+
+ $.extend(ajaxSettings, options.ajaxSettings);
+
+ that.currentRequest = $.ajax(ajaxSettings)
+ .done(function (data) {
+ var result;
+ that.currentRequest = null;
+ result = options.transformResult(data, q);
+ that.processResponse(result, q, cacheKey);
+ options.onSearchComplete.call(that.element, q, result.suggestions);
+ })
+ .fail(function (jqXHR, textStatus, errorThrown) {
+ options.onSearchError.call(
+ that.element,
+ q,
+ jqXHR,
+ textStatus,
+ errorThrown
+ );
+ });
+ } else {
+ options.onSearchComplete.call(that.element, q, []);
+ }
+ },
+
+ isBadQuery: function (q) {
+ if (!this.options.preventBadQueries) {
+ return false;
+ }
- $.extend(ajaxSettings, options.ajaxSettings);
+ var badQueries = this.badQueries,
+ i = badQueries.length;
- that.currentRequest = $.ajax(ajaxSettings).done(function (data) {
- var result;
- that.currentRequest = null;
- result = options.transformResult(data);
- that.processResponse(result, q, cacheKey);
- options.onSearchComplete.call(that.element, q, result.suggestions);
- }).fail(function (jqXHR, textStatus, errorThrown) {
- options.onSearchError.call(that.element, q, jqXHR, textStatus, errorThrown);
- });
- } else {
- options.onSearchComplete.call(that.element, q, []);
- }
- },
+ while (i--) {
+ if (q.indexOf(badQueries[i]) === 0) {
+ return true;
+ }
+ }
- isBadQuery: function (q) {
- if (!this.options.preventBadQueries){
return false;
- }
+ },
- var badQueries = this.badQueries,
- i = badQueries.length;
+ hide: function () {
+ var that = this,
+ container = $(that.suggestionsContainer);
- while (i--) {
- if (q.indexOf(badQueries[i]) === 0) {
- return true;
+ if (typeof that.options.onHide === "function" && that.visible) {
+ that.options.onHide.call(that.element, container);
}
- }
-
- return false;
- },
- hide: function () {
- var that = this;
- that.visible = false;
- that.selectedIndex = -1;
- clearInterval(that.onChangeInterval);
- $(that.suggestionsContainer).hide();
- that.signalHint(null);
- },
-
- suggest: function () {
- if (this.suggestions.length === 0) {
- this.options.showNoSuggestionNotice ? this.noSuggestions() : this.hide();
- return;
- }
+ that.visible = false;
+ that.selectedIndex = -1;
+ clearTimeout(that.onChangeTimeout);
+ $(that.suggestionsContainer).hide();
+ that.onHint(null);
+ },
+
+ suggest: function () {
+ if (!this.suggestions.length) {
+ if (this.options.showNoSuggestionNotice) {
+ this.noSuggestions();
+ } else {
+ this.hide();
+ }
+ return;
+ }
- var that = this,
- options = that.options,
- groupBy = options.groupBy,
- formatResult = options.formatResult,
- value = that.getQuery(that.currentValue),
- className = that.classes.suggestion,
- classSelected = that.classes.selected,
- container = $(that.suggestionsContainer),
- noSuggestionsContainer = $(that.noSuggestionsContainer),
- beforeRender = options.beforeRender,
- html = '',
- category,
- formatGroup = function (suggestion, index) {
+ var that = this,
+ options = that.options,
+ groupBy = options.groupBy,
+ formatResult = options.formatResult,
+ value = that.getQuery(that.currentValue),
+ className = that.classes.suggestion,
+ classSelected = that.classes.selected,
+ container = $(that.suggestionsContainer),
+ noSuggestionsContainer = $(that.noSuggestionsContainer),
+ beforeRender = options.beforeRender,
+ html = "",
+ category,
+ formatGroup = function (suggestion) {
var currentCategory = suggestion.data[groupBy];
- if (category === currentCategory){
- return '';
+ if (category === currentCategory) {
+ return "";
}
category = currentCategory;
- return '' + category + '
';
- },
- index;
+ return options.formatGroup(suggestion, category);
+ };
- if (options.triggerSelectOnValidInput) {
- index = that.findSuggestionIndex(value);
- if (index !== -1) {
- that.select(index);
+ if (options.triggerSelectOnValidInput && that.isExactMatch(value)) {
+ that.select(0);
return;
}
- }
- // Build suggestions inner HTML:
- $.each(that.suggestions, function (i, suggestion) {
- if (groupBy){
- html += formatGroup(suggestion, value, i);
- }
+ // Build suggestions inner HTML:
+ $.each(that.suggestions, function (i, suggestion) {
+ if (groupBy) {
+ html += formatGroup(suggestion, value, i);
+ }
- html += '' + formatResult(suggestion, value) + '
';
- });
+ html +=
+ '' +
+ formatResult(suggestion, value, i) +
+ "
";
+ });
- this.adjustContainerWidth();
+ this.adjustContainerWidth();
- noSuggestionsContainer.detach();
- container.html(html);
+ noSuggestionsContainer.detach();
+ container.html(html);
- // Select first value by default:
- if (options.autoSelectFirst) {
- that.selectedIndex = 0;
- container.children().first().addClass(classSelected);
- }
+ if (typeof beforeRender === "function") {
+ beforeRender.call(that.element, container, that.suggestions);
+ }
- if ($.isFunction(beforeRender)) {
- beforeRender.call(that.element, container);
- }
+ that.fixPosition();
+ container.show();
+
+ // Select first value by default:
+ if (options.autoSelectFirst) {
+ that.selectedIndex = 0;
+ container.scrollTop(0);
+ container
+ .children("." + className)
+ .first()
+ .addClass(classSelected);
+ }
- that.fixPosition();
+ that.visible = true;
+ that.findBestHint();
+ },
- container.show();
- that.visible = true;
+ noSuggestions: function () {
+ var that = this,
+ beforeRender = that.options.beforeRender,
+ container = $(that.suggestionsContainer),
+ noSuggestionsContainer = $(that.noSuggestionsContainer);
- that.findBestHint();
- },
+ this.adjustContainerWidth();
- noSuggestions: function() {
- var that = this,
- container = $(that.suggestionsContainer),
- noSuggestionsContainer = $(that.noSuggestionsContainer);
+ // Some explicit steps. Be careful here as it easy to get
+ // noSuggestionsContainer removed from DOM if not detached properly.
+ noSuggestionsContainer.detach();
- this.adjustContainerWidth();
+ // clean suggestions if any
+ container.empty();
+ container.append(noSuggestionsContainer);
- // Some explicit steps. Be careful here as it easy to get
- // noSuggestionsContainer removed from DOM if not detached properly.
- noSuggestionsContainer.detach();
- container.empty(); // clean suggestions if any
- container.append(noSuggestionsContainer);
+ if (typeof beforeRender === "function") {
+ beforeRender.call(that.element, container, that.suggestions);
+ }
- that.fixPosition();
+ that.fixPosition();
+
+ container.show();
+ that.visible = true;
+ },
+
+ adjustContainerWidth: function () {
+ var that = this,
+ options = that.options,
+ width,
+ container = $(that.suggestionsContainer);
+
+ // If width is auto, adjust width before displaying suggestions,
+ // because if instance was created before input had width, it will be zero.
+ // Also it adjusts if input width has changed.
+ if (options.width === "auto") {
+ width = that.el.outerWidth();
+ container.css("width", width > 0 ? width : 300);
+ } else if (options.width === "flex") {
+ // Trust the source! Unset the width property so it will be the max length
+ // the containing elements.
+ container.css("width", "");
+ }
+ },
- container.show();
- that.visible = true;
- },
+ findBestHint: function () {
+ var that = this,
+ value = that.el.val().toLowerCase(),
+ bestMatch = null;
- adjustContainerWidth: function() {
- var that = this,
- options = that.options,
- width,
- container = $(that.suggestionsContainer);
+ if (!value) {
+ return;
+ }
- // If width is auto, adjust width before displaying suggestions,
- // because if instance was created before input had width, it will be zero.
- // Also it adjusts if input width has changed.
- // -2px to account for suggestions border.
- if (options.width === 'auto') {
- width = that.el.outerWidth() - 2;
- container.width(width > 0 ? width : 300);
- }
- },
+ $.each(that.suggestions, function (i, suggestion) {
+ var foundMatch = suggestion.value.toLowerCase().indexOf(value) === 0;
+ if (foundMatch) {
+ bestMatch = suggestion;
+ }
+ return !foundMatch;
+ });
- findBestHint: function () {
- var that = this,
- value = that.el.val().toLowerCase(),
- bestMatch = null;
+ that.onHint(bestMatch);
+ },
- if (!value) {
- return;
- }
+ onHint: function (suggestion) {
+ var that = this,
+ onHintCallback = that.options.onHint,
+ hintValue = "";
- $.each(that.suggestions, function (i, suggestion) {
- var foundMatch = suggestion.value.toLowerCase().indexOf(value) === 0;
- if (foundMatch) {
- bestMatch = suggestion;
+ if (suggestion) {
+ hintValue =
+ that.currentValue + suggestion.value.substr(that.currentValue.length);
+ }
+ if (that.hintValue !== hintValue) {
+ that.hintValue = hintValue;
+ that.hint = suggestion;
+ if (typeof onHintCallback === "function") {
+ onHintCallback.call(that.element, hintValue);
+ }
+ }
+ },
+
+ verifySuggestionsFormat: function (suggestions) {
+ // If suggestions is string array, convert them to supported format:
+ if (suggestions.length && typeof suggestions[0] === "string") {
+ return $.map(suggestions, function (value) {
+ return { value: value, data: null };
+ });
}
- return !foundMatch;
- });
-
- that.signalHint(bestMatch);
- },
-
- signalHint: function (suggestion) {
- var hintValue = '',
- that = this;
- if (suggestion) {
- hintValue = that.currentValue + suggestion.value.substr(that.currentValue.length);
- }
- if (that.hintValue !== hintValue) {
- that.hintValue = hintValue;
- that.hint = suggestion;
- (this.options.onHint || $.noop)(hintValue);
- }
- },
-
- verifySuggestionsFormat: function (suggestions) {
- // If suggestions is string array, convert them to supported format:
- if (suggestions.length && typeof suggestions[0] === 'string') {
- return $.map(suggestions, function (value) {
- return { value: value, data: null };
- });
- }
- return suggestions;
- },
+ return suggestions;
+ },
- validateOrientation: function(orientation, fallback) {
- orientation = $.trim(orientation || '').toLowerCase();
+ validateOrientation: function (orientation, fallback) {
+ orientation = (orientation || "").trim().toLowerCase();
- if($.inArray(orientation, ['auto', 'bottom', 'top']) === -1){
- orientation = fallback;
- }
+ if ($.inArray(orientation, ["auto", "bottom", "top"]) === -1) {
+ orientation = fallback;
+ }
- return orientation;
- },
+ return orientation;
+ },
- processResponse: function (result, originalQuery, cacheKey) {
- var that = this,
- options = that.options;
+ processResponse: function (result, originalQuery, cacheKey) {
+ var that = this,
+ options = that.options;
- result.suggestions = that.verifySuggestionsFormat(result.suggestions);
+ result.suggestions = that.verifySuggestionsFormat(result.suggestions);
- // Cache results if cache is not disabled:
- if (!options.noCache) {
- that.cachedResponse[cacheKey] = result;
- if (options.preventBadQueries && result.suggestions.length === 0) {
- that.badQueries.push(originalQuery);
+ // Cache results if cache is not disabled:
+ if (!options.noCache) {
+ that.cachedResponse[cacheKey] = result;
+ if (options.preventBadQueries && !result.suggestions.length) {
+ that.badQueries.push(originalQuery);
+ }
}
- }
- // Return if originalQuery is not matching current query:
- if (originalQuery !== that.getQuery(that.currentValue)) {
- return;
- }
+ // Return if originalQuery is not matching current query:
+ if (originalQuery !== that.getQuery(that.currentValue)) {
+ return;
+ }
- that.suggestions = result.suggestions;
- that.suggest();
- },
+ that.suggestions = result.suggestions;
+ that.suggest();
+ },
- activate: function (index) {
- var that = this,
- activeItem,
- selected = that.classes.selected,
- container = $(that.suggestionsContainer),
- children = container.find('.' + that.classes.suggestion);
+ activate: function (index) {
+ var that = this,
+ activeItem,
+ selected = that.classes.selected,
+ container = $(that.suggestionsContainer),
+ children = container.find("." + that.classes.suggestion);
- container.find('.' + selected).removeClass(selected);
+ container.find("." + selected).removeClass(selected);
- that.selectedIndex = index;
+ that.selectedIndex = index;
- if (that.selectedIndex !== -1 && children.length > that.selectedIndex) {
- activeItem = children.get(that.selectedIndex);
- $(activeItem).addClass(selected);
- return activeItem;
- }
+ if (that.selectedIndex !== -1 && children.length > that.selectedIndex) {
+ activeItem = children.get(that.selectedIndex);
+ $(activeItem).addClass(selected);
+ return activeItem;
+ }
- return null;
- },
+ return null;
+ },
- selectHint: function () {
- var that = this,
- i = $.inArray(that.hint, that.suggestions);
+ selectHint: function () {
+ var that = this,
+ i = $.inArray(that.hint, that.suggestions);
- that.select(i);
- },
+ that.select(i);
+ },
- select: function (i) {
- var that = this;
- that.hide();
- that.onSelect(i);
- },
+ select: function (i) {
+ var that = this;
+ that.hide();
+ that.onSelect(i);
+ },
- moveUp: function () {
- var that = this;
+ moveUp: function () {
+ var that = this;
- if (that.selectedIndex === -1) {
- return;
- }
+ if (that.selectedIndex === -1) {
+ return;
+ }
- if (that.selectedIndex === 0) {
- $(that.suggestionsContainer).children().first().removeClass(that.classes.selected);
- that.selectedIndex = -1;
- that.el.val(that.currentValue);
- that.findBestHint();
- return;
- }
+ if (that.selectedIndex === 0) {
+ $(that.suggestionsContainer)
+ .children("." + that.classes.suggestion)
+ .first()
+ .removeClass(that.classes.selected);
+ that.selectedIndex = -1;
+ that.ignoreValueChange = false;
+ that.el.val(that.currentValue);
+ that.findBestHint();
+ return;
+ }
- that.adjustScroll(that.selectedIndex - 1);
- },
+ that.adjustScroll(that.selectedIndex - 1);
+ },
- moveDown: function () {
- var that = this;
+ moveDown: function () {
+ var that = this;
- if (that.selectedIndex === (that.suggestions.length - 1)) {
- return;
- }
+ if (that.selectedIndex === that.suggestions.length - 1) {
+ return;
+ }
- that.adjustScroll(that.selectedIndex + 1);
- },
+ that.adjustScroll(that.selectedIndex + 1);
+ },
- adjustScroll: function (index) {
- var that = this,
- activeItem = that.activate(index),
- offsetTop,
- upperBound,
- lowerBound,
- heightDelta = 25;
+ adjustScroll: function (index) {
+ var that = this,
+ activeItem = that.activate(index);
- if (!activeItem) {
- return;
- }
+ if (!activeItem) {
+ return;
+ }
- offsetTop = activeItem.offsetTop;
- upperBound = $(that.suggestionsContainer).scrollTop();
- lowerBound = upperBound + that.options.maxHeight - heightDelta;
+ var offsetTop,
+ upperBound,
+ lowerBound,
+ heightDelta = $(activeItem).outerHeight();
+
+ offsetTop = activeItem.offsetTop;
+ upperBound = $(that.suggestionsContainer).scrollTop();
+ lowerBound = upperBound + that.options.maxHeight - heightDelta;
+
+ if (offsetTop < upperBound) {
+ $(that.suggestionsContainer).scrollTop(offsetTop);
+ } else if (offsetTop > lowerBound) {
+ $(that.suggestionsContainer).scrollTop(
+ offsetTop - that.options.maxHeight + heightDelta
+ );
+ }
- if (offsetTop < upperBound) {
- $(that.suggestionsContainer).scrollTop(offsetTop);
- } else if (offsetTop > lowerBound) {
- $(that.suggestionsContainer).scrollTop(offsetTop - that.options.maxHeight + heightDelta);
- }
+ if (!that.options.preserveInput) {
+ // During onBlur event, browser will trigger "change" event,
+ // because value has changed, to avoid side effect ignore,
+ // that event, so that correct suggestion can be selected
+ // when clicking on suggestion with a mouse
+ that.ignoreValueChange = true;
+ that.el.val(that.getValue(that.suggestions[index].value));
+ }
- that.el.val(that.getValue(that.suggestions[index].value));
- that.signalHint(null);
- },
+ that.onHint(null);
+ },
- onSelect: function (index) {
- var that = this,
- onSelectCallback = that.options.onSelect,
- suggestion = that.suggestions[index];
+ onSelect: function (index) {
+ var that = this,
+ onSelectCallback = that.options.onSelect,
+ suggestion = that.suggestions[index];
- that.currentValue = that.getValue(suggestion.value);
+ that.currentValue = that.getValue(suggestion.value);
- if (that.currentValue !== that.el.val()) {
- that.el.val(that.currentValue);
- }
+ if (that.currentValue !== that.el.val() && !that.options.preserveInput) {
+ that.el.val(that.currentValue);
+ }
- that.signalHint(null);
- that.suggestions = [];
- that.selection = suggestion;
+ that.onHint(null);
+ that.suggestions = [];
+ that.selection = suggestion;
- if ($.isFunction(onSelectCallback)) {
- onSelectCallback.call(that.element, suggestion);
- }
- },
+ if (typeof onSelectCallback === "function") {
+ onSelectCallback.call(that.element, suggestion);
+ }
+ },
- getValue: function (value) {
- var that = this,
- delimiter = that.options.delimiter,
- currentValue,
- parts;
+ getValue: function (value) {
+ var that = this,
+ delimiter = that.options.delimiter,
+ currentValue,
+ parts;
- if (!delimiter) {
- return value;
- }
+ if (!delimiter) {
+ return value;
+ }
- currentValue = that.currentValue;
- parts = currentValue.split(delimiter);
+ currentValue = that.currentValue;
+ parts = currentValue.split(delimiter);
- if (parts.length === 1) {
- return value;
- }
+ if (parts.length === 1) {
+ return value;
+ }
- return currentValue.substr(0, currentValue.length - parts[parts.length - 1].length) + value;
- },
+ return (
+ currentValue.substr(0, currentValue.length - parts[parts.length - 1].length) +
+ value
+ );
+ },
+
+ dispose: function () {
+ var that = this;
+ that.el.off(".autocomplete").removeData("autocomplete");
+ $(window).off("resize.autocomplete", that.fixPositionCapture);
+ $(that.suggestionsContainer).remove();
+ },
+ };
- dispose: function () {
- var that = this;
- that.el.off('.autocomplete').removeData('autocomplete');
- that.disableKillerFn();
- $(window).off('resize.autocomplete', that.fixPositionCapture);
- $(that.suggestionsContainer).remove();
- }
- };
-
- // Create chainable jQuery plugin:
- $.fn.autocomplete = $.fn.devbridgeAutocomplete = function (options, args) {
- var dataKey = 'autocomplete';
- // If function invoked without argument return
- // instance of the first matched element:
- if (arguments.length === 0) {
- return this.first().data(dataKey);
- }
+ // Create chainable jQuery plugin:
+ $.fn.devbridgeAutocomplete = function (options, args) {
+ var dataKey = "autocomplete";
+ // If function invoked without argument return
+ // instance of the first matched element:
+ if (!arguments.length) {
+ return this.first().data(dataKey);
+ }
- return this.each(function () {
- var inputElement = $(this),
- instance = inputElement.data(dataKey);
+ return this.each(function () {
+ var inputElement = $(this),
+ instance = inputElement.data(dataKey);
- if (typeof options === 'string') {
- if (instance && typeof instance[options] === 'function') {
- instance[options](args);
- }
- } else {
- // If instance already exists, destroy it:
- if (instance && instance.dispose) {
- instance.dispose();
+ if (typeof options === "string") {
+ if (instance && typeof instance[options] === "function") {
+ instance[options](args);
+ }
+ } else {
+ // If instance already exists, destroy it:
+ if (instance && instance.dispose) {
+ instance.dispose();
+ }
+ instance = new Autocomplete(this, options);
+ inputElement.data(dataKey, instance);
}
- instance = new Autocomplete(this, options);
- inputElement.data(dataKey, instance);
- }
- });
- };
-}));
+ });
+ };
+
+ // Don't overwrite if it already exists
+ if (!$.fn.autocomplete) {
+ $.fn.autocomplete = $.fn.devbridgeAutocomplete;
+ }
+ }
+);
diff --git a/dist/jquery.autocomplete.min.js b/dist/jquery.autocomplete.min.js
index f11e4949..41940414 100644
--- a/dist/jquery.autocomplete.min.js
+++ b/dist/jquery.autocomplete.min.js
@@ -1,8 +1,8 @@
/**
-* Ajax Autocomplete for jQuery, version 1.2.12
-* (c) 2014 Tomas Kirda
+* Ajax Autocomplete for jQuery, version 1.5.0
+* (c) 2025 Tomas Kirda
*
* Ajax Autocomplete for jQuery is freely distributable under the terms of an MIT-style license.
* For details, see the web site: https://github.com/devbridge/jQuery-Autocomplete
*/
-!function(a){"use strict";"function"==typeof define&&define.amd?define(["jquery"],a):a("object"==typeof exports&&"function"==typeof require?require("jquery"):jQuery)}(function(a){"use strict";function b(c,d){var e=function(){},f=this,g={ajaxSettings:{},autoSelectFirst:!1,appendTo:document.body,serviceUrl:null,lookup:null,onSelect:null,width:"auto",minChars:1,maxHeight:300,deferRequestBy:0,params:{},formatResult:b.formatResult,delimiter:null,zIndex:9999,type:"GET",noCache:!1,onSearchStart:e,onSearchComplete:e,onSearchError:e,containerClass:"autocomplete-suggestions",tabDisabled:!1,dataType:"text",currentRequest:null,triggerSelectOnValidInput:!0,preventBadQueries:!0,lookupFilter:function(a,b,c){return-1!==a.value.toLowerCase().indexOf(c)},paramName:"query",transformResult:function(b){return"string"==typeof b?a.parseJSON(b):b},showNoSuggestionNotice:!1,noSuggestionNotice:"No results",orientation:"bottom",forceFixPosition:!1};f.element=c,f.el=a(c),f.suggestions=[],f.badQueries=[],f.selectedIndex=-1,f.currentValue=f.element.value,f.intervalId=0,f.cachedResponse={},f.onChangeInterval=null,f.onChange=null,f.isLocal=!1,f.suggestionsContainer=null,f.noSuggestionsContainer=null,f.options=a.extend({},g,d),f.classes={selected:"autocomplete-selected",suggestion:"autocomplete-suggestion"},f.hint=null,f.hintValue="",f.selection=null,f.initialize(),f.setOptions(d)}var c=function(){return{escapeRegExChars:function(a){return a.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},createNode:function(a){var b=document.createElement("div");return b.className=a,b.style.position="absolute",b.style.display="none",b}}}(),d={ESC:27,TAB:9,RETURN:13,LEFT:37,UP:38,RIGHT:39,DOWN:40};b.utils=c,a.Autocomplete=b,b.formatResult=function(a,b){var d="("+c.escapeRegExChars(b)+")";return a.value.replace(new RegExp(d,"gi"),"$1 ")},b.prototype={killerFn:null,initialize:function(){var c,d=this,e="."+d.classes.suggestion,f=d.classes.selected,g=d.options;d.element.setAttribute("autocomplete","off"),d.killerFn=function(b){0===a(b.target).closest("."+d.options.containerClass).length&&(d.killSuggestions(),d.disableKillerFn())},d.noSuggestionsContainer=a('
').html(this.options.noSuggestionNotice).get(0),d.suggestionsContainer=b.utils.createNode(g.containerClass),c=a(d.suggestionsContainer),c.appendTo(g.appendTo),"auto"!==g.width&&c.width(g.width),c.on("mouseover.autocomplete",e,function(){d.activate(a(this).data("index"))}),c.on("mouseout.autocomplete",function(){d.selectedIndex=-1,c.children("."+f).removeClass(f)}),c.on("click.autocomplete",e,function(){d.select(a(this).data("index"))}),d.fixPositionCapture=function(){d.visible&&d.fixPosition()},a(window).on("resize.autocomplete",d.fixPositionCapture),d.el.on("keydown.autocomplete",function(a){d.onKeyPress(a)}),d.el.on("keyup.autocomplete",function(a){d.onKeyUp(a)}),d.el.on("blur.autocomplete",function(){d.onBlur()}),d.el.on("focus.autocomplete",function(){d.onFocus()}),d.el.on("change.autocomplete",function(a){d.onKeyUp(a)})},onFocus:function(){var a=this;a.fixPosition(),a.options.minChars<=a.el.val().length&&a.onValueChange()},onBlur:function(){this.enableKillerFn()},setOptions:function(b){var c=this,d=c.options;a.extend(d,b),c.isLocal=a.isArray(d.lookup),c.isLocal&&(d.lookup=c.verifySuggestionsFormat(d.lookup)),d.orientation=c.validateOrientation(d.orientation,"bottom"),a(c.suggestionsContainer).css({"max-height":d.maxHeight+"px",width:d.width+"px","z-index":d.zIndex})},clearCache:function(){this.cachedResponse={},this.badQueries=[]},clear:function(){this.clearCache(),this.currentValue="",this.suggestions=[]},disable:function(){var a=this;a.disabled=!0,a.currentRequest&&a.currentRequest.abort()},enable:function(){this.disabled=!1},fixPosition:function(){var b=this,c=a(b.suggestionsContainer),d=c.parent().get(0);if(d===document.body||b.options.forceFixPosition){var e=b.options.orientation,f=c.outerHeight(),g=b.el.outerHeight(),h=b.el.offset(),i={top:h.top,left:h.left};if("auto"==e){var j=a(window).height(),k=a(window).scrollTop(),l=-k+h.top-f,m=k+j-(h.top+g+f);e=Math.max(l,m)===l?"top":"bottom"}if(i.top+="top"===e?-f:g,d!==document.body){var n,o=c.css("opacity");b.visible||c.css("opacity",0).show(),n=c.offsetParent().offset(),i.top-=n.top,i.left-=n.left,b.visible||c.css("opacity",o).hide()}"auto"===b.options.width&&(i.width=b.el.outerWidth()-2+"px"),c.css(i)}},enableKillerFn:function(){var b=this;a(document).on("click.autocomplete",b.killerFn)},disableKillerFn:function(){var b=this;a(document).off("click.autocomplete",b.killerFn)},killSuggestions:function(){var a=this;a.stopKillSuggestions(),a.intervalId=window.setInterval(function(){a.hide(),a.stopKillSuggestions()},50)},stopKillSuggestions:function(){window.clearInterval(this.intervalId)},isCursorAtEnd:function(){var a,b=this,c=b.el.val().length,d=b.element.selectionStart;return"number"==typeof d?d===c:document.selection?(a=document.selection.createRange(),a.moveStart("character",-c),c===a.text.length):!0},onKeyPress:function(a){var b=this;if(!b.disabled&&!b.visible&&a.which===d.DOWN&&b.currentValue)return void b.suggest();if(!b.disabled&&b.visible){switch(a.which){case d.ESC:b.el.val(b.currentValue),b.hide();break;case d.RIGHT:if(b.hint&&b.options.onHint&&b.isCursorAtEnd()){b.selectHint();break}return;case d.TAB:if(b.hint&&b.options.onHint)return void b.selectHint();case d.RETURN:if(-1===b.selectedIndex)return void b.hide();if(b.select(b.selectedIndex),a.which===d.TAB&&b.options.tabDisabled===!1)return;break;case d.UP:b.moveUp();break;case d.DOWN:b.moveDown();break;default:return}a.stopImmediatePropagation(),a.preventDefault()}},onKeyUp:function(a){var b=this;if(!b.disabled){switch(a.which){case d.UP:case d.DOWN:return}clearInterval(b.onChangeInterval),b.currentValue!==b.el.val()&&(b.findBestHint(),b.options.deferRequestBy>0?b.onChangeInterval=setInterval(function(){b.onValueChange()},b.options.deferRequestBy):b.onValueChange())}},onValueChange:function(){var b,c=this,d=c.options,e=c.el.val(),f=c.getQuery(e);return c.selection&&c.currentValue!==f&&(c.selection=null,(d.onInvalidateSelection||a.noop).call(c.element)),clearInterval(c.onChangeInterval),c.currentValue=e,c.selectedIndex=-1,d.triggerSelectOnValidInput&&(b=c.findSuggestionIndex(f),-1!==b)?void c.select(b):void(f.lengthh&&(c.suggestions=c.suggestions.slice(0,h)),c},getSuggestions:function(b){var c,d,e,f,g=this,h=g.options,i=h.serviceUrl;if(h.params[h.paramName]=b,d=h.ignoreParams?null:h.params,g.isLocal?c=g.getSuggestionsLocal(b):(a.isFunction(i)&&(i=i.call(g.element,b)),e=i+"?"+a.param(d||{}),c=g.cachedResponse[e]),c&&a.isArray(c.suggestions))g.suggestions=c.suggestions,g.suggest();else if(!g.isBadQuery(b)){if(h.onSearchStart.call(g.element,h.params)===!1)return;g.currentRequest&&g.currentRequest.abort(),f={url:i,data:d,type:h.type,dataType:h.dataType},a.extend(f,h.ajaxSettings),g.currentRequest=a.ajax(f).done(function(a){var c;g.currentRequest=null,c=h.transformResult(a),g.processResponse(c,b,e),h.onSearchComplete.call(g.element,b,c.suggestions)}).fail(function(a,c,d){h.onSearchError.call(g.element,b,a,c,d)})}},isBadQuery:function(a){if(!this.options.preventBadQueries)return!1;for(var b=this.badQueries,c=b.length;c--;)if(0===a.indexOf(b[c]))return!0;return!1},hide:function(){var b=this;b.visible=!1,b.selectedIndex=-1,a(b.suggestionsContainer).hide(),b.signalHint(null)},suggest:function(){if(0===this.suggestions.length)return void(this.options.showNoSuggestionNotice?this.noSuggestions():this.hide());var b,c=this,d=c.options,e=d.formatResult,f=c.getQuery(c.currentValue),g=c.classes.suggestion,h=c.classes.selected,i=a(c.suggestionsContainer),j=a(c.noSuggestionsContainer),k=d.beforeRender,l="";return d.triggerSelectOnValidInput&&(b=c.findSuggestionIndex(f),-1!==b)?void c.select(b):(a.each(c.suggestions,function(a,b){l+=''+e(b,f)+"
"}),this.adjustContainerWidth(),j.detach(),i.html(l),d.autoSelectFirst&&(c.selectedIndex=0,i.children().first().addClass(h)),a.isFunction(k)&&k.call(c.element,i),c.fixPosition(),i.show(),c.visible=!0,void c.findBestHint())},noSuggestions:function(){var b=this,c=a(b.suggestionsContainer),d=a(b.noSuggestionsContainer);this.adjustContainerWidth(),d.detach(),c.empty(),c.append(d),b.fixPosition(),c.show(),b.visible=!0},adjustContainerWidth:function(){var b,c=this,d=c.options,e=a(c.suggestionsContainer);"auto"===d.width&&(b=c.el.outerWidth()-2,e.width(b>0?b:300))},findBestHint:function(){var b=this,c=b.el.val().toLowerCase(),d=null;c&&(a.each(b.suggestions,function(a,b){var e=0===b.value.toLowerCase().indexOf(c);return e&&(d=b),!e}),b.signalHint(d))},signalHint:function(b){var c="",d=this;b&&(c=d.currentValue+b.value.substr(d.currentValue.length)),d.hintValue!==c&&(d.hintValue=c,d.hint=b,(this.options.onHint||a.noop)(c))},verifySuggestionsFormat:function(b){return b.length&&"string"==typeof b[0]?a.map(b,function(a){return{value:a,data:null}}):b},validateOrientation:function(b,c){return b=a.trim(b||"").toLowerCase(),-1===a.inArray(b,["auto","bottom","top"])&&(b=c),b},processResponse:function(a,b,c){var d=this,e=d.options;a.suggestions=d.verifySuggestionsFormat(a.suggestions),e.noCache||(d.cachedResponse[c]=a,e.preventBadQueries&&0===a.suggestions.length&&d.badQueries.push(b)),b===d.getQuery(d.currentValue)&&(d.suggestions=a.suggestions,d.suggest())},activate:function(b){var c,d=this,e=d.classes.selected,f=a(d.suggestionsContainer),g=f.find("."+d.classes.suggestion);return f.find("."+e).removeClass(e),d.selectedIndex=b,-1!==d.selectedIndex&&g.length>d.selectedIndex?(c=g.get(d.selectedIndex),a(c).addClass(e),c):null},selectHint:function(){var b=this,c=a.inArray(b.hint,b.suggestions);b.select(c)},select:function(a){var b=this;b.hide(),b.onSelect(a)},moveUp:function(){var b=this;if(-1!==b.selectedIndex)return 0===b.selectedIndex?(a(b.suggestionsContainer).children().first().removeClass(b.classes.selected),b.selectedIndex=-1,b.el.val(b.currentValue),void b.findBestHint()):void b.adjustScroll(b.selectedIndex-1)},moveDown:function(){var a=this;a.selectedIndex!==a.suggestions.length-1&&a.adjustScroll(a.selectedIndex+1)},adjustScroll:function(b){var c,d,e,f=this,g=f.activate(b),h=25;g&&(c=g.offsetTop,d=a(f.suggestionsContainer).scrollTop(),e=d+f.options.maxHeight-h,d>c?a(f.suggestionsContainer).scrollTop(c):c>e&&a(f.suggestionsContainer).scrollTop(c-f.options.maxHeight+h),f.el.val(f.getValue(f.suggestions[b].value)),f.signalHint(null))},onSelect:function(b){var c=this,d=c.options.onSelect,e=c.suggestions[b];c.currentValue=c.getValue(e.value),c.currentValue!==c.el.val()&&c.el.val(c.currentValue),c.signalHint(null),c.suggestions=[],c.selection=e,a.isFunction(d)&&d.call(c.element,e)},getValue:function(a){var b,c,d=this,e=d.options.delimiter;return e?(b=d.currentValue,c=b.split(e),1===c.length?a:b.substr(0,b.length-c[c.length-1].length)+a):a},dispose:function(){var b=this;b.el.off(".autocomplete").removeData("autocomplete"),b.disableKillerFn(),a(window).off("resize.autocomplete",b.fixPositionCapture),a(b.suggestionsContainer).remove()}},a.fn.autocomplete=a.fn.devbridgeAutocomplete=function(c,d){var e="autocomplete";return 0===arguments.length?this.first().data(e):this.each(function(){var f=a(this),g=f.data(e);"string"==typeof c?g&&"function"==typeof g[c]&&g[c](d):(g&&g.dispose&&g.dispose(),g=new b(this,c),f.data(e,g))})}});
\ No newline at end of file
+!function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof exports&&"function"==typeof require?e(require("jquery")):e(jQuery)}(function(d){"use strict";var n={escapeRegExChars:function(e){return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&")},createNode:function(e){var t=document.createElement("div");return t.className=e,t.style.position="absolute",t.style.display="none",t}},o=27,s=9,i=13,a=38,u=39,l=40,e=d.noop;function r(e,t){var n=this;n.element=e,n.el=d(e),n.suggestions=[],n.badQueries=[],n.selectedIndex=-1,n.currentValue=n.element.value,n.timeoutId=null,n.cachedResponse={},n.onChangeTimeout=null,n.onChange=null,n.isLocal=!1,n.suggestionsContainer=null,n.noSuggestionsContainer=null,n.options=d.extend(!0,{},r.defaults,t),n.classes={selected:"autocomplete-selected",suggestion:"autocomplete-suggestion"},n.hint=null,n.hintValue="",n.selection=null,n.initialize(),n.setOptions(t)}r.utils=n,(d.Autocomplete=r).defaults={ajaxSettings:{},autoSelectFirst:!1,appendTo:"body",serviceUrl:null,lookup:null,onSelect:null,onHint:null,width:"auto",minChars:1,maxHeight:300,deferRequestBy:0,params:{},formatResult:function(e,t){return t?(t="("+n.escapeRegExChars(t)+")",e.value.replace(new RegExp(t,"gi"),"$1 ").replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/<(\/?strong)>/g,"<$1>")):e.value},formatGroup:function(e,t){return''+t+"
"},delimiter:null,zIndex:9999,type:"GET",noCache:!1,onSearchStart:e,onSearchComplete:e,onSearchError:e,preserveInput:!1,containerClass:"autocomplete-suggestions",tabDisabled:!1,dataType:"text",currentRequest:null,triggerSelectOnValidInput:!0,preventBadQueries:!0,lookupFilter:function(e,t,n){return-1!==e.value.toLowerCase().indexOf(n)},paramName:"query",transformResult:function(e){return"string"==typeof e?JSON.parse(e):e},showNoSuggestionNotice:!1,noSuggestionNotice:"No results",orientation:"bottom",forceFixPosition:!1},r.prototype={initialize:function(){var e,t=this,n="."+t.classes.suggestion,o=t.classes.selected,s=t.options;t.element.setAttribute("autocomplete","off"),t.noSuggestionsContainer=d('
').html(this.options.noSuggestionNotice).get(0),t.suggestionsContainer=r.utils.createNode(s.containerClass),(e=d(t.suggestionsContainer)).appendTo(s.appendTo||"body"),"auto"!==s.width&&e.css("width",s.width),e.on("mouseover.autocomplete",n,function(){t.activate(d(this).data("index"))}),e.on("mouseout.autocomplete",function(){t.selectedIndex=-1,e.children("."+o).removeClass(o)}),e.on("click.autocomplete",n,function(){t.select(d(this).data("index"))}),e.on("click.autocomplete",function(){clearTimeout(t.blurTimeoutId)}),t.fixPositionCapture=function(){t.visible&&t.fixPosition()},d(window).on("resize.autocomplete",t.fixPositionCapture),t.el.on("keydown.autocomplete",function(e){t.onKeyPress(e)}),t.el.on("keyup.autocomplete",function(e){t.onKeyUp(e)}),t.el.on("blur.autocomplete",function(){t.onBlur()}),t.el.on("focus.autocomplete",function(){t.onFocus()}),t.el.on("change.autocomplete",function(e){t.onKeyUp(e)}),t.el.on("input.autocomplete",function(e){t.onKeyUp(e)})},onFocus:function(){var e=this;e.disabled||(e.fixPosition(),e.el.val().length>=e.options.minChars&&e.onValueChange())},onBlur:function(){var e=this,t=e.options,n=e.el.val(),o=e.getQuery(n);e.blurTimeoutId=setTimeout(function(){e.hide(),e.selection&&e.currentValue!==o&&(t.onInvalidateSelection||d.noop).call(e.element)},200)},abortAjax:function(){var e=this;e.currentRequest&&(e.currentRequest.abort(),e.currentRequest=null)},setOptions:function(e){var t=this,e=d.extend({},t.options,e);t.isLocal=Array.isArray(e.lookup),t.isLocal&&(e.lookup=t.verifySuggestionsFormat(e.lookup)),e.orientation=t.validateOrientation(e.orientation,"bottom"),d(t.suggestionsContainer).css({"max-height":e.maxHeight+"px",width:e.width+"px","z-index":e.zIndex}),this.options=e},clearCache:function(){this.cachedResponse={},this.badQueries=[]},clear:function(){this.clearCache(),this.currentValue="",this.suggestions=[]},disable:function(){var e=this;e.disabled=!0,clearTimeout(e.onChangeTimeout),e.abortAjax()},enable:function(){this.disabled=!1},fixPosition:function(){var e,t,n,o,s,i,a,u,l=this,r=d(l.suggestionsContainer),c=r.parent().get(0);c!==document.body&&!l.options.forceFixPosition||(i=l.options.orientation,e=r.outerHeight(),t=l.el.outerHeight(),n={top:(u=l.el.offset()).top,left:u.left},"auto"===i&&(a=d(window).height(),o=-(s=d(window).scrollTop())+u.top-e,s=s+a-(u.top+t+e),i=Math.max(o,s)===o?"top":"bottom"),n.top+="top"===i?-e:t,c!==document.body&&(a=r.css("opacity"),l.visible||r.css("opacity",0).show(),u=r.offsetParent().offset(),n.top-=u.top,n.top+=c.scrollTop,n.left-=u.left,l.visible||r.css("opacity",a).hide()),"auto"===l.options.width&&(n.width=l.el.outerWidth()+"px"),r.css(n))},isCursorAtEnd:function(){var e=this.el.val().length,t=this.element.selectionStart;return"number"==typeof t?t===e:!document.selection||((t=document.selection.createRange()).moveStart("character",-e),e===t.text.length)},onKeyPress:function(e){var t=this;if(t.disabled||t.visible||e.which!==l||!t.currentValue){if(!t.disabled&&t.visible){switch(e.which){case o:t.el.val(t.currentValue),t.hide();break;case u:if(t.hint&&t.options.onHint&&t.isCursorAtEnd()){t.selectHint();break}return;case s:if(t.hint&&t.options.onHint)return void t.selectHint();if(-1===t.selectedIndex)return void t.hide();if(t.select(t.selectedIndex),!1===t.options.tabDisabled)return;break;case i:if(-1===t.selectedIndex)return void t.hide();t.select(t.selectedIndex);break;case a:t.moveUp();break;case l:t.moveDown();break;default:return}e.stopImmediatePropagation(),e.preventDefault()}}else t.suggest()},onKeyUp:function(e){var t=this;if(!t.disabled){switch(e.which){case a:case l:return}clearTimeout(t.onChangeTimeout),t.currentValue!==t.el.val()&&(t.findBestHint(),0s&&(e.suggestions=e.suggestions.slice(0,s)),e},getSuggestions:function(o){var e,t,n,s=this,i=s.options,a=i.serviceUrl;i.params[i.paramName]=o,!1!==i.onSearchStart.call(s.element,i.params)&&(e=i.ignoreParams?null:i.params,"function"==typeof i.lookup?i.lookup(o,function(e){s.suggestions=e.suggestions,s.suggest(),i.onSearchComplete.call(s.element,o,e.suggestions)}):(n=s.isLocal?s.getSuggestionsLocal(o):("function"==typeof a&&(a=a.call(s.element,o)),t=a+"?"+d.param(e||{}),s.cachedResponse[t]))&&Array.isArray(n.suggestions)?(s.suggestions=n.suggestions,s.suggest(),i.onSearchComplete.call(s.element,o,n.suggestions)):s.isBadQuery(o)?i.onSearchComplete.call(s.element,o,[]):(s.abortAjax(),n={url:a,data:e,type:i.type,dataType:i.dataType},d.extend(n,i.ajaxSettings),s.currentRequest=d.ajax(n).done(function(e){s.currentRequest=null,e=i.transformResult(e,o),s.processResponse(e,o,t),i.onSearchComplete.call(s.element,o,e.suggestions)}).fail(function(e,t,n){i.onSearchError.call(s.element,o,e,t,n)})))},isBadQuery:function(e){if(this.options.preventBadQueries)for(var t=this.badQueries,n=t.length;n--;)if(0===e.indexOf(t[n]))return!0;return!1},hide:function(){var e=this,t=d(e.suggestionsContainer);"function"==typeof e.options.onHide&&e.visible&&e.options.onHide.call(e.element,t),e.visible=!1,e.selectedIndex=-1,clearTimeout(e.onChangeTimeout),d(e.suggestionsContainer).hide(),e.onHint(null)},suggest:function(){var e,s,i,a,u,l,t,n,o,r,c,g;this.suggestions.length?(s=(e=this).options,i=s.groupBy,a=s.formatResult,u=e.getQuery(e.currentValue),l=e.classes.suggestion,t=e.classes.selected,n=d(e.suggestionsContainer),o=d(e.noSuggestionsContainer),r=s.beforeRender,c="",s.triggerSelectOnValidInput&&e.isExactMatch(u)?e.select(0):(d.each(e.suggestions,function(e,t){var n,o;i&&(c+=(o=(n=t).data[i],g===o?"":(g=o,s.formatGroup(n,g)))),c+=''+a(t,u,e)+"
"}),this.adjustContainerWidth(),o.detach(),n.html(c),"function"==typeof r&&r.call(e.element,n,e.suggestions),e.fixPosition(),n.show(),s.autoSelectFirst&&(e.selectedIndex=0,n.scrollTop(0),n.children("."+l).first().addClass(t)),e.visible=!0,e.findBestHint())):this.options.showNoSuggestionNotice?this.noSuggestions():this.hide()},noSuggestions:function(){var e=this,t=e.options.beforeRender,n=d(e.suggestionsContainer),o=d(e.noSuggestionsContainer);this.adjustContainerWidth(),o.detach(),n.empty(),n.append(o),"function"==typeof t&&t.call(e.element,n,e.suggestions),e.fixPosition(),n.show(),e.visible=!0},adjustContainerWidth:function(){var e,t=this.options,n=d(this.suggestionsContainer);"auto"===t.width?(e=this.el.outerWidth(),n.css("width",0t.selectedIndex?(o=s.get(t.selectedIndex),d(o).addClass(n),o):null},selectHint:function(){var e=d.inArray(this.hint,this.suggestions);this.select(e)},select:function(e){this.hide(),this.onSelect(e)},moveUp:function(){var e=this;-1!==e.selectedIndex&&(0===e.selectedIndex?(d(e.suggestionsContainer).children("."+e.classes.suggestion).first().removeClass(e.classes.selected),e.selectedIndex=-1,e.ignoreValueChange=!1,e.el.val(e.currentValue),e.findBestHint()):e.adjustScroll(e.selectedIndex-1))},moveDown:function(){this.selectedIndex!==this.suggestions.length-1&&this.adjustScroll(this.selectedIndex+1)},adjustScroll:function(e){var t,n,o,s=this,i=s.activate(e);i&&(t=d(i).outerHeight(),i=i.offsetTop,o=(n=d(s.suggestionsContainer).scrollTop())+s.options.maxHeight-t,iDynamic Width
-
-
+
+
diff --git a/package-lock.json b/package-lock.json
new file mode 100644
index 00000000..18bef099
--- /dev/null
+++ b/package-lock.json
@@ -0,0 +1,2220 @@
+{
+ "name": "devbridge-autocomplete",
+ "version": "1.5.0",
+ "lockfileVersion": 3,
+ "requires": true,
+ "packages": {
+ "": {
+ "name": "devbridge-autocomplete",
+ "version": "1.5.0",
+ "license": "MIT",
+ "devDependencies": {
+ "@types/jquery": "^3.5.32",
+ "eslint": "^9.30.1",
+ "grunt": "^1.6.1",
+ "grunt-contrib-uglify": "^5.2.2",
+ "prettier": "^3.6.2",
+ "typescript": "^5.8.3"
+ },
+ "peerDependencies": {
+ "jquery": ">=1.9"
+ }
+ },
+ "node_modules/@aashutoshrathi/word-wrap": {
+ "version": "1.2.6",
+ "resolved": "https://registry.npmjs.org/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz",
+ "integrity": "sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==",
+ "dev": true,
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/@eslint-community/eslint-utils": {
+ "version": "4.4.0",
+ "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz",
+ "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==",
+ "dev": true,
+ "dependencies": {
+ "eslint-visitor-keys": "^3.3.0"
+ },
+ "engines": {
+ "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
+ },
+ "peerDependencies": {
+ "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0"
+ }
+ },
+ "node_modules/@eslint-community/regexpp": {
+ "version": "4.12.1",
+ "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.1.tgz",
+ "integrity": "sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": "^12.0.0 || ^14.0.0 || >=16.0.0"
+ }
+ },
+ "node_modules/@eslint/config-array": {
+ "version": "0.21.0",
+ "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.21.0.tgz",
+ "integrity": "sha512-ENIdc4iLu0d93HeYirvKmrzshzofPw6VkZRKQGe9Nv46ZnWUzcF1xV01dcvEg/1wXUR61OmmlSfyeyO7EvjLxQ==",
+ "dev": true,
+ "license": "Apache-2.0",
+ "dependencies": {
+ "@eslint/object-schema": "^2.1.6",
+ "debug": "^4.3.1",
+ "minimatch": "^3.1.2"
+ },
+ "engines": {
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+ }
+ },
+ "node_modules/@eslint/config-array/node_modules/minimatch": {
+ "version": "3.1.2",
+ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz",
+ "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==",
+ "dev": true,
+ "license": "ISC",
+ "dependencies": {
+ "brace-expansion": "^1.1.7"
+ },
+ "engines": {
+ "node": "*"
+ }
+ },
+ "node_modules/@eslint/config-helpers": {
+ "version": "0.3.0",
+ "resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.3.0.tgz",
+ "integrity": "sha512-ViuymvFmcJi04qdZeDc2whTHryouGcDlaxPqarTD0ZE10ISpxGUVZGZDx4w01upyIynL3iu6IXH2bS1NhclQMw==",
+ "dev": true,
+ "license": "Apache-2.0",
+ "engines": {
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+ }
+ },
+ "node_modules/@eslint/core": {
+ "version": "0.14.0",
+ "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.14.0.tgz",
+ "integrity": "sha512-qIbV0/JZr7iSDjqAc60IqbLdsj9GDt16xQtWD+B78d/HAlvysGdZZ6rpJHGAc2T0FQx1X6thsSPdnoiGKdNtdg==",
+ "dev": true,
+ "license": "Apache-2.0",
+ "dependencies": {
+ "@types/json-schema": "^7.0.15"
+ },
+ "engines": {
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+ }
+ },
+ "node_modules/@eslint/eslintrc": {
+ "version": "3.3.1",
+ "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.3.1.tgz",
+ "integrity": "sha512-gtF186CXhIl1p4pJNGZw8Yc6RlshoePRvE0X91oPGb3vZ8pM3qOS9W9NGPat9LziaBV7XrJWGylNQXkGcnM3IQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "ajv": "^6.12.4",
+ "debug": "^4.3.2",
+ "espree": "^10.0.1",
+ "globals": "^14.0.0",
+ "ignore": "^5.2.0",
+ "import-fresh": "^3.2.1",
+ "js-yaml": "^4.1.0",
+ "minimatch": "^3.1.2",
+ "strip-json-comments": "^3.1.1"
+ },
+ "engines": {
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/eslint"
+ }
+ },
+ "node_modules/@eslint/eslintrc/node_modules/argparse": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz",
+ "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==",
+ "dev": true,
+ "license": "Python-2.0"
+ },
+ "node_modules/@eslint/eslintrc/node_modules/js-yaml": {
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz",
+ "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "argparse": "^2.0.1"
+ },
+ "bin": {
+ "js-yaml": "bin/js-yaml.js"
+ }
+ },
+ "node_modules/@eslint/eslintrc/node_modules/minimatch": {
+ "version": "3.1.2",
+ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz",
+ "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==",
+ "dev": true,
+ "license": "ISC",
+ "dependencies": {
+ "brace-expansion": "^1.1.7"
+ },
+ "engines": {
+ "node": "*"
+ }
+ },
+ "node_modules/@eslint/js": {
+ "version": "9.30.1",
+ "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.30.1.tgz",
+ "integrity": "sha512-zXhuECFlyep42KZUhWjfvsmXGX39W8K8LFb8AWXM9gSV9dQB+MrJGLKvW6Zw0Ggnbpw0VHTtrhFXYe3Gym18jg==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+ },
+ "funding": {
+ "url": "https://eslint.org/donate"
+ }
+ },
+ "node_modules/@eslint/object-schema": {
+ "version": "2.1.6",
+ "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.6.tgz",
+ "integrity": "sha512-RBMg5FRL0I0gs51M/guSAj5/e14VQ4tpZnQNWwuDT66P14I43ItmPfIZRhO9fUVIPOAQXU47atlywZ/czoqFPA==",
+ "dev": true,
+ "license": "Apache-2.0",
+ "engines": {
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+ }
+ },
+ "node_modules/@eslint/plugin-kit": {
+ "version": "0.3.3",
+ "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.3.3.tgz",
+ "integrity": "sha512-1+WqvgNMhmlAambTvT3KPtCl/Ibr68VldY2XY40SL1CE0ZXiakFR/cbTspaF5HsnpDMvcYYoJHfl4980NBjGag==",
+ "dev": true,
+ "license": "Apache-2.0",
+ "dependencies": {
+ "@eslint/core": "^0.15.1",
+ "levn": "^0.4.1"
+ },
+ "engines": {
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+ }
+ },
+ "node_modules/@eslint/plugin-kit/node_modules/@eslint/core": {
+ "version": "0.15.1",
+ "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.15.1.tgz",
+ "integrity": "sha512-bkOp+iumZCCbt1K1CmWf0R9pM5yKpDv+ZXtvSyQpudrI9kuFLp+bM2WOPXImuD/ceQuaa8f5pj93Y7zyECIGNA==",
+ "dev": true,
+ "license": "Apache-2.0",
+ "dependencies": {
+ "@types/json-schema": "^7.0.15"
+ },
+ "engines": {
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+ }
+ },
+ "node_modules/@humanfs/core": {
+ "version": "0.19.1",
+ "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.1.tgz",
+ "integrity": "sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA==",
+ "dev": true,
+ "license": "Apache-2.0",
+ "engines": {
+ "node": ">=18.18.0"
+ }
+ },
+ "node_modules/@humanfs/node": {
+ "version": "0.16.6",
+ "resolved": "https://registry.npmjs.org/@humanfs/node/-/node-0.16.6.tgz",
+ "integrity": "sha512-YuI2ZHQL78Q5HbhDiBA1X4LmYdXCKCMQIfw0pw7piHJwyREFebJUvrQN4cMssyES6x+vfUbx1CIpaQUKYdQZOw==",
+ "dev": true,
+ "license": "Apache-2.0",
+ "dependencies": {
+ "@humanfs/core": "^0.19.1",
+ "@humanwhocodes/retry": "^0.3.0"
+ },
+ "engines": {
+ "node": ">=18.18.0"
+ }
+ },
+ "node_modules/@humanfs/node/node_modules/@humanwhocodes/retry": {
+ "version": "0.3.1",
+ "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.3.1.tgz",
+ "integrity": "sha512-JBxkERygn7Bv/GbN5Rv8Ul6LVknS+5Bp6RgDC/O8gEBU/yeH5Ui5C/OlWrTb6qct7LjjfT6Re2NxB0ln0yYybA==",
+ "dev": true,
+ "license": "Apache-2.0",
+ "engines": {
+ "node": ">=18.18"
+ },
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/nzakas"
+ }
+ },
+ "node_modules/@humanwhocodes/module-importer": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz",
+ "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==",
+ "dev": true,
+ "engines": {
+ "node": ">=12.22"
+ },
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/nzakas"
+ }
+ },
+ "node_modules/@humanwhocodes/retry": {
+ "version": "0.4.3",
+ "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.4.3.tgz",
+ "integrity": "sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ==",
+ "dev": true,
+ "license": "Apache-2.0",
+ "engines": {
+ "node": ">=18.18"
+ },
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/nzakas"
+ }
+ },
+ "node_modules/@types/estree": {
+ "version": "1.0.8",
+ "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.8.tgz",
+ "integrity": "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/@types/jquery": {
+ "version": "3.5.32",
+ "resolved": "https://registry.npmjs.org/@types/jquery/-/jquery-3.5.32.tgz",
+ "integrity": "sha512-b9Xbf4CkMqS02YH8zACqN1xzdxc3cO735Qe5AbSUFmyOiaWAbcpqh9Wna+Uk0vgACvoQHpWDg2rGdHkYPLmCiQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@types/sizzle": "*"
+ }
+ },
+ "node_modules/@types/json-schema": {
+ "version": "7.0.15",
+ "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz",
+ "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/@types/sizzle": {
+ "version": "2.3.4",
+ "resolved": "https://registry.npmjs.org/@types/sizzle/-/sizzle-2.3.4.tgz",
+ "integrity": "sha512-jA2llq2zNkg8HrALI7DtWzhALcVH0l7i89yhY3iBdOz6cBPeACoFq+fkQrjHA39t1hnSFOboZ7A/AY5MMZSlag==",
+ "dev": true
+ },
+ "node_modules/abbrev": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz",
+ "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==",
+ "dev": true
+ },
+ "node_modules/acorn": {
+ "version": "8.15.0",
+ "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.15.0.tgz",
+ "integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==",
+ "dev": true,
+ "license": "MIT",
+ "bin": {
+ "acorn": "bin/acorn"
+ },
+ "engines": {
+ "node": ">=0.4.0"
+ }
+ },
+ "node_modules/acorn-jsx": {
+ "version": "5.3.2",
+ "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz",
+ "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==",
+ "dev": true,
+ "license": "MIT",
+ "peerDependencies": {
+ "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0"
+ }
+ },
+ "node_modules/ajv": {
+ "version": "6.12.6",
+ "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz",
+ "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "fast-deep-equal": "^3.1.1",
+ "fast-json-stable-stringify": "^2.0.0",
+ "json-schema-traverse": "^0.4.1",
+ "uri-js": "^4.2.2"
+ },
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/epoberezkin"
+ }
+ },
+ "node_modules/ansi-styles": {
+ "version": "4.3.0",
+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
+ "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
+ "dev": true,
+ "dependencies": {
+ "color-convert": "^2.0.1"
+ },
+ "engines": {
+ "node": ">=8"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/ansi-styles?sponsor=1"
+ }
+ },
+ "node_modules/argparse": {
+ "version": "1.0.10",
+ "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz",
+ "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==",
+ "dev": true,
+ "dependencies": {
+ "sprintf-js": "~1.0.2"
+ }
+ },
+ "node_modules/array-each": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/array-each/-/array-each-1.0.1.tgz",
+ "integrity": "sha512-zHjL5SZa68hkKHBFBK6DJCTtr9sfTCPCaph/L7tMSLcTFgy+zX7E+6q5UArbtOtMBCtxdICpfTCspRse+ywyXA==",
+ "dev": true,
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/array-slice": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/array-slice/-/array-slice-1.1.0.tgz",
+ "integrity": "sha512-B1qMD3RBP7O8o0H2KbrXDyB0IccejMF15+87Lvlor12ONPRHP6gTjXMNkt/d3ZuOGbAe66hFmaCfECI24Ufp6w==",
+ "dev": true,
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/async": {
+ "version": "3.2.4",
+ "resolved": "https://registry.npmjs.org/async/-/async-3.2.4.tgz",
+ "integrity": "sha512-iAB+JbDEGXhyIUavoDl9WP/Jj106Kz9DEn1DPgYw5ruDn0e3Wgi3sKFm55sASdGBNOQB8F59d9qQ7deqrHA8wQ==",
+ "dev": true
+ },
+ "node_modules/balanced-match": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
+ "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==",
+ "dev": true
+ },
+ "node_modules/brace-expansion": {
+ "version": "1.1.11",
+ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
+ "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
+ "dev": true,
+ "dependencies": {
+ "balanced-match": "^1.0.0",
+ "concat-map": "0.0.1"
+ }
+ },
+ "node_modules/braces": {
+ "version": "3.0.2",
+ "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz",
+ "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==",
+ "dev": true,
+ "dependencies": {
+ "fill-range": "^7.0.1"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/callsites": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz",
+ "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/chalk": {
+ "version": "4.1.2",
+ "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
+ "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
+ "dev": true,
+ "dependencies": {
+ "ansi-styles": "^4.1.0",
+ "supports-color": "^7.1.0"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/chalk?sponsor=1"
+ }
+ },
+ "node_modules/color-convert": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
+ "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
+ "dev": true,
+ "dependencies": {
+ "color-name": "~1.1.4"
+ },
+ "engines": {
+ "node": ">=7.0.0"
+ }
+ },
+ "node_modules/color-name": {
+ "version": "1.1.4",
+ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
+ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
+ "dev": true
+ },
+ "node_modules/colors": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/colors/-/colors-1.1.2.tgz",
+ "integrity": "sha512-ENwblkFQpqqia6b++zLD/KUWafYlVY/UNnAp7oz7LY7E924wmpye416wBOmvv/HMWzl8gL1kJlfvId/1Dg176w==",
+ "dev": true,
+ "engines": {
+ "node": ">=0.1.90"
+ }
+ },
+ "node_modules/concat-map": {
+ "version": "0.0.1",
+ "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
+ "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==",
+ "dev": true
+ },
+ "node_modules/cross-spawn": {
+ "version": "7.0.6",
+ "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz",
+ "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "path-key": "^3.1.0",
+ "shebang-command": "^2.0.0",
+ "which": "^2.0.1"
+ },
+ "engines": {
+ "node": ">= 8"
+ }
+ },
+ "node_modules/dateformat": {
+ "version": "4.6.3",
+ "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-4.6.3.tgz",
+ "integrity": "sha512-2P0p0pFGzHS5EMnhdxQi7aJN+iMheud0UhG4dlE1DLAlvL8JHjJJTX/CSm4JXwV0Ka5nGk3zC5mcb5bUQUxxMA==",
+ "dev": true,
+ "engines": {
+ "node": "*"
+ }
+ },
+ "node_modules/debug": {
+ "version": "4.4.1",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.1.tgz",
+ "integrity": "sha512-KcKCqiftBJcZr++7ykoDIEwSa3XWowTfNPo92BYxjXiyYEVrUQh2aLyhxBCwww+heortUFxEJYcRzosstTEBYQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "ms": "^2.1.3"
+ },
+ "engines": {
+ "node": ">=6.0"
+ },
+ "peerDependenciesMeta": {
+ "supports-color": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/deep-is": {
+ "version": "0.1.4",
+ "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz",
+ "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==",
+ "dev": true
+ },
+ "node_modules/detect-file": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/detect-file/-/detect-file-1.0.0.tgz",
+ "integrity": "sha512-DtCOLG98P007x7wiiOmfI0fi3eIKyWiLTGJ2MDnVi/E04lWGbf+JzrRHMm0rgIIZJGtHpKpbVgLWHrv8xXpc3Q==",
+ "dev": true,
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/duplexer": {
+ "version": "0.1.2",
+ "resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.2.tgz",
+ "integrity": "sha512-jtD6YG370ZCIi/9GTaJKQxWTZD045+4R4hTk/x1UyoqadyJ9x9CgSi1RlVDQF8U2sxLLSnFkCaMihqljHIWgMg==",
+ "dev": true
+ },
+ "node_modules/escape-string-regexp": {
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
+ "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==",
+ "dev": true,
+ "engines": {
+ "node": ">=0.8.0"
+ }
+ },
+ "node_modules/eslint": {
+ "version": "9.30.1",
+ "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.30.1.tgz",
+ "integrity": "sha512-zmxXPNMOXmwm9E0yQLi5uqXHs7uq2UIiqEKo3Gq+3fwo1XrJ+hijAZImyF7hclW3E6oHz43Yk3RP8at6OTKflQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@eslint-community/eslint-utils": "^4.2.0",
+ "@eslint-community/regexpp": "^4.12.1",
+ "@eslint/config-array": "^0.21.0",
+ "@eslint/config-helpers": "^0.3.0",
+ "@eslint/core": "^0.14.0",
+ "@eslint/eslintrc": "^3.3.1",
+ "@eslint/js": "9.30.1",
+ "@eslint/plugin-kit": "^0.3.1",
+ "@humanfs/node": "^0.16.6",
+ "@humanwhocodes/module-importer": "^1.0.1",
+ "@humanwhocodes/retry": "^0.4.2",
+ "@types/estree": "^1.0.6",
+ "@types/json-schema": "^7.0.15",
+ "ajv": "^6.12.4",
+ "chalk": "^4.0.0",
+ "cross-spawn": "^7.0.6",
+ "debug": "^4.3.2",
+ "escape-string-regexp": "^4.0.0",
+ "eslint-scope": "^8.4.0",
+ "eslint-visitor-keys": "^4.2.1",
+ "espree": "^10.4.0",
+ "esquery": "^1.5.0",
+ "esutils": "^2.0.2",
+ "fast-deep-equal": "^3.1.3",
+ "file-entry-cache": "^8.0.0",
+ "find-up": "^5.0.0",
+ "glob-parent": "^6.0.2",
+ "ignore": "^5.2.0",
+ "imurmurhash": "^0.1.4",
+ "is-glob": "^4.0.0",
+ "json-stable-stringify-without-jsonify": "^1.0.1",
+ "lodash.merge": "^4.6.2",
+ "minimatch": "^3.1.2",
+ "natural-compare": "^1.4.0",
+ "optionator": "^0.9.3"
+ },
+ "bin": {
+ "eslint": "bin/eslint.js"
+ },
+ "engines": {
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+ },
+ "funding": {
+ "url": "https://eslint.org/donate"
+ },
+ "peerDependencies": {
+ "jiti": "*"
+ },
+ "peerDependenciesMeta": {
+ "jiti": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/eslint-scope": {
+ "version": "8.4.0",
+ "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.4.0.tgz",
+ "integrity": "sha512-sNXOfKCn74rt8RICKMvJS7XKV/Xk9kA7DyJr8mJik3S7Cwgy3qlkkmyS2uQB3jiJg6VNdZd/pDBJu0nvG2NlTg==",
+ "dev": true,
+ "license": "BSD-2-Clause",
+ "dependencies": {
+ "esrecurse": "^4.3.0",
+ "estraverse": "^5.2.0"
+ },
+ "engines": {
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/eslint"
+ }
+ },
+ "node_modules/eslint-visitor-keys": {
+ "version": "3.4.3",
+ "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz",
+ "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==",
+ "dev": true,
+ "engines": {
+ "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/eslint"
+ }
+ },
+ "node_modules/eslint/node_modules/escape-string-regexp": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz",
+ "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==",
+ "dev": true,
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/eslint/node_modules/eslint-visitor-keys": {
+ "version": "4.2.1",
+ "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz",
+ "integrity": "sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==",
+ "dev": true,
+ "license": "Apache-2.0",
+ "engines": {
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/eslint"
+ }
+ },
+ "node_modules/eslint/node_modules/find-up": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz",
+ "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==",
+ "dev": true,
+ "dependencies": {
+ "locate-path": "^6.0.0",
+ "path-exists": "^4.0.0"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/eslint/node_modules/minimatch": {
+ "version": "3.1.2",
+ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz",
+ "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==",
+ "dev": true,
+ "dependencies": {
+ "brace-expansion": "^1.1.7"
+ },
+ "engines": {
+ "node": "*"
+ }
+ },
+ "node_modules/eslint/node_modules/path-exists": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz",
+ "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==",
+ "dev": true,
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/espree": {
+ "version": "10.4.0",
+ "resolved": "https://registry.npmjs.org/espree/-/espree-10.4.0.tgz",
+ "integrity": "sha512-j6PAQ2uUr79PZhBjP5C5fhl8e39FmRnOjsD5lGnWrFU8i2G776tBK7+nP8KuQUTTyAZUwfQqXAgrVH5MbH9CYQ==",
+ "dev": true,
+ "license": "BSD-2-Clause",
+ "dependencies": {
+ "acorn": "^8.15.0",
+ "acorn-jsx": "^5.3.2",
+ "eslint-visitor-keys": "^4.2.1"
+ },
+ "engines": {
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/eslint"
+ }
+ },
+ "node_modules/espree/node_modules/eslint-visitor-keys": {
+ "version": "4.2.1",
+ "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz",
+ "integrity": "sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==",
+ "dev": true,
+ "license": "Apache-2.0",
+ "engines": {
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/eslint"
+ }
+ },
+ "node_modules/esprima": {
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz",
+ "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==",
+ "dev": true,
+ "bin": {
+ "esparse": "bin/esparse.js",
+ "esvalidate": "bin/esvalidate.js"
+ },
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/esquery": {
+ "version": "1.5.0",
+ "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz",
+ "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==",
+ "dev": true,
+ "dependencies": {
+ "estraverse": "^5.1.0"
+ },
+ "engines": {
+ "node": ">=0.10"
+ }
+ },
+ "node_modules/esrecurse": {
+ "version": "4.3.0",
+ "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz",
+ "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==",
+ "dev": true,
+ "license": "BSD-2-Clause",
+ "dependencies": {
+ "estraverse": "^5.2.0"
+ },
+ "engines": {
+ "node": ">=4.0"
+ }
+ },
+ "node_modules/estraverse": {
+ "version": "5.3.0",
+ "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz",
+ "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==",
+ "dev": true,
+ "engines": {
+ "node": ">=4.0"
+ }
+ },
+ "node_modules/esutils": {
+ "version": "2.0.3",
+ "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz",
+ "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==",
+ "dev": true,
+ "license": "BSD-2-Clause",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/eventemitter2": {
+ "version": "0.4.14",
+ "resolved": "https://registry.npmjs.org/eventemitter2/-/eventemitter2-0.4.14.tgz",
+ "integrity": "sha512-K7J4xq5xAD5jHsGM5ReWXRTFa3JRGofHiMcVgQ8PRwgWxzjHpMWCIzsmyf60+mh8KLsqYPcjUMa0AC4hd6lPyQ==",
+ "dev": true
+ },
+ "node_modules/exit": {
+ "version": "0.1.2",
+ "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz",
+ "integrity": "sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ==",
+ "dev": true,
+ "engines": {
+ "node": ">= 0.8.0"
+ }
+ },
+ "node_modules/expand-tilde": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/expand-tilde/-/expand-tilde-2.0.2.tgz",
+ "integrity": "sha512-A5EmesHW6rfnZ9ysHQjPdJRni0SRar0tjtG5MNtm9n5TUvsYU8oozprtRD4AqHxcZWWlVuAmQo2nWKfN9oyjTw==",
+ "dev": true,
+ "dependencies": {
+ "homedir-polyfill": "^1.0.1"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/extend": {
+ "version": "3.0.2",
+ "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz",
+ "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==",
+ "dev": true
+ },
+ "node_modules/fast-deep-equal": {
+ "version": "3.1.3",
+ "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz",
+ "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/fast-json-stable-stringify": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz",
+ "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/fast-levenshtein": {
+ "version": "2.0.6",
+ "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz",
+ "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==",
+ "dev": true
+ },
+ "node_modules/figures": {
+ "version": "3.2.0",
+ "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz",
+ "integrity": "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==",
+ "dev": true,
+ "dependencies": {
+ "escape-string-regexp": "^1.0.5"
+ },
+ "engines": {
+ "node": ">=8"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/file-entry-cache": {
+ "version": "8.0.0",
+ "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz",
+ "integrity": "sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "flat-cache": "^4.0.0"
+ },
+ "engines": {
+ "node": ">=16.0.0"
+ }
+ },
+ "node_modules/fill-range": {
+ "version": "7.0.1",
+ "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz",
+ "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==",
+ "dev": true,
+ "dependencies": {
+ "to-regex-range": "^5.0.1"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/findup-sync": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-5.0.0.tgz",
+ "integrity": "sha512-MzwXju70AuyflbgeOhzvQWAvvQdo1XL0A9bVvlXsYcFEBM87WR4OakL4OfZq+QRmr+duJubio+UtNQCPsVESzQ==",
+ "dev": true,
+ "dependencies": {
+ "detect-file": "^1.0.0",
+ "is-glob": "^4.0.3",
+ "micromatch": "^4.0.4",
+ "resolve-dir": "^1.0.1"
+ },
+ "engines": {
+ "node": ">= 10.13.0"
+ }
+ },
+ "node_modules/fined": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/fined/-/fined-1.2.0.tgz",
+ "integrity": "sha512-ZYDqPLGxDkDhDZBjZBb+oD1+j0rA4E0pXY50eplAAOPg2N/gUBSSk5IM1/QhPfyVo19lJ+CvXpqfvk+b2p/8Ng==",
+ "dev": true,
+ "dependencies": {
+ "expand-tilde": "^2.0.2",
+ "is-plain-object": "^2.0.3",
+ "object.defaults": "^1.1.0",
+ "object.pick": "^1.2.0",
+ "parse-filepath": "^1.0.1"
+ },
+ "engines": {
+ "node": ">= 0.10"
+ }
+ },
+ "node_modules/flagged-respawn": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/flagged-respawn/-/flagged-respawn-1.0.1.tgz",
+ "integrity": "sha512-lNaHNVymajmk0OJMBn8fVUAU1BtDeKIqKoVhk4xAALB57aALg6b4W0MfJ/cUE0g9YBXy5XhSlPIpYIJ7HaY/3Q==",
+ "dev": true,
+ "engines": {
+ "node": ">= 0.10"
+ }
+ },
+ "node_modules/flat-cache": {
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-4.0.1.tgz",
+ "integrity": "sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "flatted": "^3.2.9",
+ "keyv": "^4.5.4"
+ },
+ "engines": {
+ "node": ">=16"
+ }
+ },
+ "node_modules/flatted": {
+ "version": "3.3.3",
+ "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.3.tgz",
+ "integrity": "sha512-GX+ysw4PBCz0PzosHDepZGANEuFCMLrnRTiEy9McGjmkCQYwRq4A/X786G/fjM/+OjsWSU1ZrY5qyARZmO/uwg==",
+ "dev": true,
+ "license": "ISC"
+ },
+ "node_modules/for-in": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz",
+ "integrity": "sha512-7EwmXrOjyL+ChxMhmG5lnW9MPt1aIeZEwKhQzoBUdTV0N3zuwWDZYVJatDvZ2OyzPUvdIAZDsCetk3coyMfcnQ==",
+ "dev": true,
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/for-own": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/for-own/-/for-own-1.0.0.tgz",
+ "integrity": "sha512-0OABksIGrxKK8K4kynWkQ7y1zounQxP+CWnyclVwj81KW3vlLlGUx57DKGcP/LH216GzqnstnPocF16Nxs0Ycg==",
+ "dev": true,
+ "dependencies": {
+ "for-in": "^1.0.1"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/fs.realpath": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
+ "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==",
+ "dev": true
+ },
+ "node_modules/getobject": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/getobject/-/getobject-1.0.2.tgz",
+ "integrity": "sha512-2zblDBaFcb3rB4rF77XVnuINOE2h2k/OnqXAiy0IrTxUfV1iFp3la33oAQVY9pCpWU268WFYVt2t71hlMuLsOg==",
+ "dev": true,
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/glob": {
+ "version": "7.1.7",
+ "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz",
+ "integrity": "sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==",
+ "dev": true,
+ "dependencies": {
+ "fs.realpath": "^1.0.0",
+ "inflight": "^1.0.4",
+ "inherits": "2",
+ "minimatch": "^3.0.4",
+ "once": "^1.3.0",
+ "path-is-absolute": "^1.0.0"
+ },
+ "engines": {
+ "node": "*"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/isaacs"
+ }
+ },
+ "node_modules/glob-parent": {
+ "version": "6.0.2",
+ "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz",
+ "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==",
+ "dev": true,
+ "dependencies": {
+ "is-glob": "^4.0.3"
+ },
+ "engines": {
+ "node": ">=10.13.0"
+ }
+ },
+ "node_modules/global-modules": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-1.0.0.tgz",
+ "integrity": "sha512-sKzpEkf11GpOFuw0Zzjzmt4B4UZwjOcG757PPvrfhxcLFbq0wpsgpOqxpxtxFiCG4DtG93M6XRVbF2oGdev7bg==",
+ "dev": true,
+ "dependencies": {
+ "global-prefix": "^1.0.1",
+ "is-windows": "^1.0.1",
+ "resolve-dir": "^1.0.0"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/global-prefix": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-1.0.2.tgz",
+ "integrity": "sha512-5lsx1NUDHtSjfg0eHlmYvZKv8/nVqX4ckFbM+FrGcQ+04KWcWFo9P5MxPZYSzUvyzmdTbI7Eix8Q4IbELDqzKg==",
+ "dev": true,
+ "dependencies": {
+ "expand-tilde": "^2.0.2",
+ "homedir-polyfill": "^1.0.1",
+ "ini": "^1.3.4",
+ "is-windows": "^1.0.1",
+ "which": "^1.2.14"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/global-prefix/node_modules/which": {
+ "version": "1.3.1",
+ "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz",
+ "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==",
+ "dev": true,
+ "dependencies": {
+ "isexe": "^2.0.0"
+ },
+ "bin": {
+ "which": "bin/which"
+ }
+ },
+ "node_modules/globals": {
+ "version": "14.0.0",
+ "resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz",
+ "integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/grunt": {
+ "version": "1.6.1",
+ "resolved": "https://registry.npmjs.org/grunt/-/grunt-1.6.1.tgz",
+ "integrity": "sha512-/ABUy3gYWu5iBmrUSRBP97JLpQUm0GgVveDCp6t3yRNIoltIYw7rEj3g5y1o2PGPR2vfTRGa7WC/LZHLTXnEzA==",
+ "dev": true,
+ "dependencies": {
+ "dateformat": "~4.6.2",
+ "eventemitter2": "~0.4.13",
+ "exit": "~0.1.2",
+ "findup-sync": "~5.0.0",
+ "glob": "~7.1.6",
+ "grunt-cli": "~1.4.3",
+ "grunt-known-options": "~2.0.0",
+ "grunt-legacy-log": "~3.0.0",
+ "grunt-legacy-util": "~2.0.1",
+ "iconv-lite": "~0.6.3",
+ "js-yaml": "~3.14.0",
+ "minimatch": "~3.0.4",
+ "nopt": "~3.0.6"
+ },
+ "bin": {
+ "grunt": "bin/grunt"
+ },
+ "engines": {
+ "node": ">=16"
+ }
+ },
+ "node_modules/grunt-cli": {
+ "version": "1.4.3",
+ "resolved": "https://registry.npmjs.org/grunt-cli/-/grunt-cli-1.4.3.tgz",
+ "integrity": "sha512-9Dtx/AhVeB4LYzsViCjUQkd0Kw0McN2gYpdmGYKtE2a5Yt7v1Q+HYZVWhqXc/kGnxlMtqKDxSwotiGeFmkrCoQ==",
+ "dev": true,
+ "dependencies": {
+ "grunt-known-options": "~2.0.0",
+ "interpret": "~1.1.0",
+ "liftup": "~3.0.1",
+ "nopt": "~4.0.1",
+ "v8flags": "~3.2.0"
+ },
+ "bin": {
+ "grunt": "bin/grunt"
+ },
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/grunt-cli/node_modules/nopt": {
+ "version": "4.0.3",
+ "resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.3.tgz",
+ "integrity": "sha512-CvaGwVMztSMJLOeXPrez7fyfObdZqNUK1cPAEzLHrTybIua9pMdmmPR5YwtfNftIOMv3DPUhFaxsZMNTQO20Kg==",
+ "dev": true,
+ "dependencies": {
+ "abbrev": "1",
+ "osenv": "^0.1.4"
+ },
+ "bin": {
+ "nopt": "bin/nopt.js"
+ }
+ },
+ "node_modules/grunt-contrib-uglify": {
+ "version": "5.2.2",
+ "resolved": "https://registry.npmjs.org/grunt-contrib-uglify/-/grunt-contrib-uglify-5.2.2.tgz",
+ "integrity": "sha512-ITxiWxrjjP+RZu/aJ5GLvdele+sxlznh+6fK9Qckio5ma8f7Iv8woZjRkGfafvpuygxNefOJNc+hfjjBayRn2Q==",
+ "dev": true,
+ "dependencies": {
+ "chalk": "^4.1.2",
+ "maxmin": "^3.0.0",
+ "uglify-js": "^3.16.1",
+ "uri-path": "^1.0.0"
+ },
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/grunt-known-options": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/grunt-known-options/-/grunt-known-options-2.0.0.tgz",
+ "integrity": "sha512-GD7cTz0I4SAede1/+pAbmJRG44zFLPipVtdL9o3vqx9IEyb7b4/Y3s7r6ofI3CchR5GvYJ+8buCSioDv5dQLiA==",
+ "dev": true,
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/grunt-legacy-log": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/grunt-legacy-log/-/grunt-legacy-log-3.0.0.tgz",
+ "integrity": "sha512-GHZQzZmhyq0u3hr7aHW4qUH0xDzwp2YXldLPZTCjlOeGscAOWWPftZG3XioW8MasGp+OBRIu39LFx14SLjXRcA==",
+ "dev": true,
+ "dependencies": {
+ "colors": "~1.1.2",
+ "grunt-legacy-log-utils": "~2.1.0",
+ "hooker": "~0.2.3",
+ "lodash": "~4.17.19"
+ },
+ "engines": {
+ "node": ">= 0.10.0"
+ }
+ },
+ "node_modules/grunt-legacy-log-utils": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/grunt-legacy-log-utils/-/grunt-legacy-log-utils-2.1.0.tgz",
+ "integrity": "sha512-lwquaPXJtKQk0rUM1IQAop5noEpwFqOXasVoedLeNzaibf/OPWjKYvvdqnEHNmU+0T0CaReAXIbGo747ZD+Aaw==",
+ "dev": true,
+ "dependencies": {
+ "chalk": "~4.1.0",
+ "lodash": "~4.17.19"
+ },
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/grunt-legacy-util": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/grunt-legacy-util/-/grunt-legacy-util-2.0.1.tgz",
+ "integrity": "sha512-2bQiD4fzXqX8rhNdXkAywCadeqiPiay0oQny77wA2F3WF4grPJXCvAcyoWUJV+po/b15glGkxuSiQCK299UC2w==",
+ "dev": true,
+ "dependencies": {
+ "async": "~3.2.0",
+ "exit": "~0.1.2",
+ "getobject": "~1.0.0",
+ "hooker": "~0.2.3",
+ "lodash": "~4.17.21",
+ "underscore.string": "~3.3.5",
+ "which": "~2.0.2"
+ },
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/gzip-size": {
+ "version": "5.1.1",
+ "resolved": "https://registry.npmjs.org/gzip-size/-/gzip-size-5.1.1.tgz",
+ "integrity": "sha512-FNHi6mmoHvs1mxZAds4PpdCS6QG8B4C1krxJsMutgxl5t3+GlRTzzI3NEkifXx2pVsOvJdOGSmIgDhQ55FwdPA==",
+ "dev": true,
+ "dependencies": {
+ "duplexer": "^0.1.1",
+ "pify": "^4.0.1"
+ },
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/has": {
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/has/-/has-1.0.4.tgz",
+ "integrity": "sha512-qdSAmqLF6209RFj4VVItywPMbm3vWylknmB3nvNiUIs72xAimcM8nVYxYr7ncvZq5qzk9MKIZR8ijqD/1QuYjQ==",
+ "dev": true,
+ "engines": {
+ "node": ">= 0.4.0"
+ }
+ },
+ "node_modules/has-flag": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
+ "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
+ "dev": true,
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/homedir-polyfill": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz",
+ "integrity": "sha512-eSmmWE5bZTK2Nou4g0AI3zZ9rswp7GRKoKXS1BLUkvPviOqs4YTN1djQIqrXy9k5gEtdLPy86JjRwsNM9tnDcA==",
+ "dev": true,
+ "dependencies": {
+ "parse-passwd": "^1.0.0"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/hooker": {
+ "version": "0.2.3",
+ "resolved": "https://registry.npmjs.org/hooker/-/hooker-0.2.3.tgz",
+ "integrity": "sha512-t+UerCsQviSymAInD01Pw+Dn/usmz1sRO+3Zk1+lx8eg+WKpD2ulcwWqHHL0+aseRBr+3+vIhiG1K1JTwaIcTA==",
+ "dev": true,
+ "engines": {
+ "node": "*"
+ }
+ },
+ "node_modules/iconv-lite": {
+ "version": "0.6.3",
+ "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz",
+ "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==",
+ "dev": true,
+ "dependencies": {
+ "safer-buffer": ">= 2.1.2 < 3.0.0"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/ignore": {
+ "version": "5.3.2",
+ "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz",
+ "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 4"
+ }
+ },
+ "node_modules/import-fresh": {
+ "version": "3.3.1",
+ "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.1.tgz",
+ "integrity": "sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "parent-module": "^1.0.0",
+ "resolve-from": "^4.0.0"
+ },
+ "engines": {
+ "node": ">=6"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/imurmurhash": {
+ "version": "0.1.4",
+ "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz",
+ "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==",
+ "dev": true,
+ "engines": {
+ "node": ">=0.8.19"
+ }
+ },
+ "node_modules/inflight": {
+ "version": "1.0.6",
+ "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
+ "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==",
+ "dev": true,
+ "dependencies": {
+ "once": "^1.3.0",
+ "wrappy": "1"
+ }
+ },
+ "node_modules/inherits": {
+ "version": "2.0.4",
+ "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
+ "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==",
+ "dev": true
+ },
+ "node_modules/ini": {
+ "version": "1.3.8",
+ "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz",
+ "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==",
+ "dev": true
+ },
+ "node_modules/interpret": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.1.0.tgz",
+ "integrity": "sha512-CLM8SNMDu7C5psFCn6Wg/tgpj/bKAg7hc2gWqcuR9OD5Ft9PhBpIu8PLicPeis+xDd6YX2ncI8MCA64I9tftIA==",
+ "dev": true
+ },
+ "node_modules/is-absolute": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/is-absolute/-/is-absolute-1.0.0.tgz",
+ "integrity": "sha512-dOWoqflvcydARa360Gvv18DZ/gRuHKi2NU/wU5X1ZFzdYfH29nkiNZsF3mp4OJ3H4yo9Mx8A/uAGNzpzPN3yBA==",
+ "dev": true,
+ "dependencies": {
+ "is-relative": "^1.0.0",
+ "is-windows": "^1.0.1"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/is-core-module": {
+ "version": "2.13.0",
+ "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.0.tgz",
+ "integrity": "sha512-Z7dk6Qo8pOCp3l4tsX2C5ZVas4V+UxwQodwZhLopL91TX8UyyHEXafPcyoeeWuLrwzHcr3igO78wNLwHJHsMCQ==",
+ "dev": true,
+ "dependencies": {
+ "has": "^1.0.3"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/is-extglob": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz",
+ "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==",
+ "dev": true,
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/is-glob": {
+ "version": "4.0.3",
+ "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz",
+ "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==",
+ "dev": true,
+ "dependencies": {
+ "is-extglob": "^2.1.1"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/is-number": {
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz",
+ "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==",
+ "dev": true,
+ "engines": {
+ "node": ">=0.12.0"
+ }
+ },
+ "node_modules/is-plain-object": {
+ "version": "2.0.4",
+ "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz",
+ "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==",
+ "dev": true,
+ "dependencies": {
+ "isobject": "^3.0.1"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/is-relative": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/is-relative/-/is-relative-1.0.0.tgz",
+ "integrity": "sha512-Kw/ReK0iqwKeu0MITLFuj0jbPAmEiOsIwyIXvvbfa6QfmN9pkD1M+8pdk7Rl/dTKbH34/XBFMbgD4iMJhLQbGA==",
+ "dev": true,
+ "dependencies": {
+ "is-unc-path": "^1.0.0"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/is-unc-path": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/is-unc-path/-/is-unc-path-1.0.0.tgz",
+ "integrity": "sha512-mrGpVd0fs7WWLfVsStvgF6iEJnbjDFZh9/emhRDcGWTduTfNHd9CHeUwH3gYIjdbwo4On6hunkztwOaAw0yllQ==",
+ "dev": true,
+ "dependencies": {
+ "unc-path-regex": "^0.1.2"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/is-windows": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz",
+ "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==",
+ "dev": true,
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/isexe": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
+ "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==",
+ "dev": true
+ },
+ "node_modules/isobject": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz",
+ "integrity": "sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg==",
+ "dev": true,
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/jquery": {
+ "version": "3.7.1",
+ "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.7.1.tgz",
+ "integrity": "sha512-m4avr8yL8kmFN8psrbFFFmB/If14iN5o9nw/NgnnM+kybDJpRsAynV2BsfpTYrTRysYUdADVD7CkUUizgkpLfg==",
+ "peer": true
+ },
+ "node_modules/js-yaml": {
+ "version": "3.14.1",
+ "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz",
+ "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==",
+ "dev": true,
+ "dependencies": {
+ "argparse": "^1.0.7",
+ "esprima": "^4.0.0"
+ },
+ "bin": {
+ "js-yaml": "bin/js-yaml.js"
+ }
+ },
+ "node_modules/json-buffer": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz",
+ "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/json-schema-traverse": {
+ "version": "0.4.1",
+ "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz",
+ "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/json-stable-stringify-without-jsonify": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz",
+ "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==",
+ "dev": true
+ },
+ "node_modules/keyv": {
+ "version": "4.5.4",
+ "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz",
+ "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "json-buffer": "3.0.1"
+ }
+ },
+ "node_modules/kind-of": {
+ "version": "6.0.3",
+ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz",
+ "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==",
+ "dev": true,
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/levn": {
+ "version": "0.4.1",
+ "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz",
+ "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==",
+ "dev": true,
+ "dependencies": {
+ "prelude-ls": "^1.2.1",
+ "type-check": "~0.4.0"
+ },
+ "engines": {
+ "node": ">= 0.8.0"
+ }
+ },
+ "node_modules/liftup": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/liftup/-/liftup-3.0.1.tgz",
+ "integrity": "sha512-yRHaiQDizWSzoXk3APcA71eOI/UuhEkNN9DiW2Tt44mhYzX4joFoCZlxsSOF7RyeLlfqzFLQI1ngFq3ggMPhOw==",
+ "dev": true,
+ "dependencies": {
+ "extend": "^3.0.2",
+ "findup-sync": "^4.0.0",
+ "fined": "^1.2.0",
+ "flagged-respawn": "^1.0.1",
+ "is-plain-object": "^2.0.4",
+ "object.map": "^1.0.1",
+ "rechoir": "^0.7.0",
+ "resolve": "^1.19.0"
+ },
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/liftup/node_modules/findup-sync": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-4.0.0.tgz",
+ "integrity": "sha512-6jvvn/12IC4quLBL1KNokxC7wWTvYncaVUYSoxWw7YykPLuRrnv4qdHcSOywOI5RpkOVGeQRtWM8/q+G6W6qfQ==",
+ "dev": true,
+ "dependencies": {
+ "detect-file": "^1.0.0",
+ "is-glob": "^4.0.0",
+ "micromatch": "^4.0.2",
+ "resolve-dir": "^1.0.1"
+ },
+ "engines": {
+ "node": ">= 8"
+ }
+ },
+ "node_modules/locate-path": {
+ "version": "6.0.0",
+ "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz",
+ "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==",
+ "dev": true,
+ "dependencies": {
+ "p-locate": "^5.0.0"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/lodash": {
+ "version": "4.17.21",
+ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
+ "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==",
+ "dev": true
+ },
+ "node_modules/lodash.merge": {
+ "version": "4.6.2",
+ "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz",
+ "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==",
+ "dev": true
+ },
+ "node_modules/make-iterator": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/make-iterator/-/make-iterator-1.0.1.tgz",
+ "integrity": "sha512-pxiuXh0iVEq7VM7KMIhs5gxsfxCux2URptUQaXo4iZZJxBAzTPOLE2BumO5dbfVYq/hBJFBR/a1mFDmOx5AGmw==",
+ "dev": true,
+ "dependencies": {
+ "kind-of": "^6.0.2"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/map-cache": {
+ "version": "0.2.2",
+ "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz",
+ "integrity": "sha512-8y/eV9QQZCiyn1SprXSrCmqJN0yNRATe+PO8ztwqrvrbdRLA3eYJF0yaR0YayLWkMbsQSKWS9N2gPcGEc4UsZg==",
+ "dev": true,
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/maxmin": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/maxmin/-/maxmin-3.0.0.tgz",
+ "integrity": "sha512-wcahMInmGtg/7c6a75fr21Ch/Ks1Tb+Jtoan5Ft4bAI0ZvJqyOw8kkM7e7p8hDSzY805vmxwHT50KcjGwKyJ0g==",
+ "dev": true,
+ "dependencies": {
+ "chalk": "^4.1.0",
+ "figures": "^3.2.0",
+ "gzip-size": "^5.1.1",
+ "pretty-bytes": "^5.3.0"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/micromatch": {
+ "version": "4.0.5",
+ "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz",
+ "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==",
+ "dev": true,
+ "dependencies": {
+ "braces": "^3.0.2",
+ "picomatch": "^2.3.1"
+ },
+ "engines": {
+ "node": ">=8.6"
+ }
+ },
+ "node_modules/minimatch": {
+ "version": "3.0.8",
+ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.8.tgz",
+ "integrity": "sha512-6FsRAQsxQ61mw+qP1ZzbL9Bc78x2p5OqNgNpnoAFLTrX8n5Kxph0CsnhmKKNXTWjXqU5L0pGPR7hYk+XWZr60Q==",
+ "dev": true,
+ "dependencies": {
+ "brace-expansion": "^1.1.7"
+ },
+ "engines": {
+ "node": "*"
+ }
+ },
+ "node_modules/ms": {
+ "version": "2.1.3",
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
+ "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/natural-compare": {
+ "version": "1.4.0",
+ "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz",
+ "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==",
+ "dev": true
+ },
+ "node_modules/nopt": {
+ "version": "3.0.6",
+ "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz",
+ "integrity": "sha512-4GUt3kSEYmk4ITxzB/b9vaIDfUVWN/Ml1Fwl11IlnIG2iaJ9O6WXZ9SrYM9NLI8OCBieN2Y8SWC2oJV0RQ7qYg==",
+ "dev": true,
+ "dependencies": {
+ "abbrev": "1"
+ },
+ "bin": {
+ "nopt": "bin/nopt.js"
+ }
+ },
+ "node_modules/object.defaults": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/object.defaults/-/object.defaults-1.1.0.tgz",
+ "integrity": "sha512-c/K0mw/F11k4dEUBMW8naXUuBuhxRCfG7W+yFy8EcijU/rSmazOUd1XAEEe6bC0OuXY4HUKjTJv7xbxIMqdxrA==",
+ "dev": true,
+ "dependencies": {
+ "array-each": "^1.0.1",
+ "array-slice": "^1.0.0",
+ "for-own": "^1.0.0",
+ "isobject": "^3.0.0"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/object.map": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/object.map/-/object.map-1.0.1.tgz",
+ "integrity": "sha512-3+mAJu2PLfnSVGHwIWubpOFLscJANBKuB/6A4CxBstc4aqwQY0FWcsppuy4jU5GSB95yES5JHSI+33AWuS4k6w==",
+ "dev": true,
+ "dependencies": {
+ "for-own": "^1.0.0",
+ "make-iterator": "^1.0.0"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/object.pick": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz",
+ "integrity": "sha512-tqa/UMy/CCoYmj+H5qc07qvSL9dqcs/WZENZ1JbtWBlATP+iVOe778gE6MSijnyCnORzDuX6hU+LA4SZ09YjFQ==",
+ "dev": true,
+ "dependencies": {
+ "isobject": "^3.0.1"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/once": {
+ "version": "1.4.0",
+ "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
+ "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==",
+ "dev": true,
+ "dependencies": {
+ "wrappy": "1"
+ }
+ },
+ "node_modules/optionator": {
+ "version": "0.9.3",
+ "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.3.tgz",
+ "integrity": "sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==",
+ "dev": true,
+ "dependencies": {
+ "@aashutoshrathi/word-wrap": "^1.2.3",
+ "deep-is": "^0.1.3",
+ "fast-levenshtein": "^2.0.6",
+ "levn": "^0.4.1",
+ "prelude-ls": "^1.2.1",
+ "type-check": "^0.4.0"
+ },
+ "engines": {
+ "node": ">= 0.8.0"
+ }
+ },
+ "node_modules/os-homedir": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz",
+ "integrity": "sha512-B5JU3cabzk8c67mRRd3ECmROafjYMXbuzlwtqdM8IbS8ktlTix8aFGb2bAGKrSRIlnfKwovGUUr72JUPyOb6kQ==",
+ "dev": true,
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/os-tmpdir": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz",
+ "integrity": "sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==",
+ "dev": true,
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/osenv": {
+ "version": "0.1.5",
+ "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz",
+ "integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==",
+ "dev": true,
+ "dependencies": {
+ "os-homedir": "^1.0.0",
+ "os-tmpdir": "^1.0.0"
+ }
+ },
+ "node_modules/p-limit": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz",
+ "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==",
+ "dev": true,
+ "dependencies": {
+ "yocto-queue": "^0.1.0"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/p-locate": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz",
+ "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==",
+ "dev": true,
+ "dependencies": {
+ "p-limit": "^3.0.2"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/parent-module": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz",
+ "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "callsites": "^3.0.0"
+ },
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/parse-filepath": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/parse-filepath/-/parse-filepath-1.0.2.tgz",
+ "integrity": "sha512-FwdRXKCohSVeXqwtYonZTXtbGJKrn+HNyWDYVcp5yuJlesTwNH4rsmRZ+GrKAPJ5bLpRxESMeS+Rl0VCHRvB2Q==",
+ "dev": true,
+ "dependencies": {
+ "is-absolute": "^1.0.0",
+ "map-cache": "^0.2.0",
+ "path-root": "^0.1.1"
+ },
+ "engines": {
+ "node": ">=0.8"
+ }
+ },
+ "node_modules/parse-passwd": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/parse-passwd/-/parse-passwd-1.0.0.tgz",
+ "integrity": "sha512-1Y1A//QUXEZK7YKz+rD9WydcE1+EuPr6ZBgKecAB8tmoW6UFv0NREVJe1p+jRxtThkcbbKkfwIbWJe/IeE6m2Q==",
+ "dev": true,
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/path-is-absolute": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
+ "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==",
+ "dev": true,
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/path-key": {
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz",
+ "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/path-parse": {
+ "version": "1.0.7",
+ "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz",
+ "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==",
+ "dev": true
+ },
+ "node_modules/path-root": {
+ "version": "0.1.1",
+ "resolved": "https://registry.npmjs.org/path-root/-/path-root-0.1.1.tgz",
+ "integrity": "sha512-QLcPegTHF11axjfojBIoDygmS2E3Lf+8+jI6wOVmNVenrKSo3mFdSGiIgdSHenczw3wPtlVMQaFVwGmM7BJdtg==",
+ "dev": true,
+ "dependencies": {
+ "path-root-regex": "^0.1.0"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/path-root-regex": {
+ "version": "0.1.2",
+ "resolved": "https://registry.npmjs.org/path-root-regex/-/path-root-regex-0.1.2.tgz",
+ "integrity": "sha512-4GlJ6rZDhQZFE0DPVKh0e9jmZ5egZfxTkp7bcRDuPlJXbAwhxcl2dINPUAsjLdejqaLsCeg8axcLjIbvBjN4pQ==",
+ "dev": true,
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/picomatch": {
+ "version": "2.3.1",
+ "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz",
+ "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==",
+ "dev": true,
+ "engines": {
+ "node": ">=8.6"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/jonschlinkert"
+ }
+ },
+ "node_modules/pify": {
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz",
+ "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==",
+ "dev": true,
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/prelude-ls": {
+ "version": "1.2.1",
+ "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz",
+ "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==",
+ "dev": true,
+ "engines": {
+ "node": ">= 0.8.0"
+ }
+ },
+ "node_modules/prettier": {
+ "version": "3.6.2",
+ "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.6.2.tgz",
+ "integrity": "sha512-I7AIg5boAr5R0FFtJ6rCfD+LFsWHp81dolrFD8S79U9tb8Az2nGrJncnMSnys+bpQJfRUzqs9hnA81OAA3hCuQ==",
+ "dev": true,
+ "license": "MIT",
+ "bin": {
+ "prettier": "bin/prettier.cjs"
+ },
+ "engines": {
+ "node": ">=14"
+ },
+ "funding": {
+ "url": "https://github.com/prettier/prettier?sponsor=1"
+ }
+ },
+ "node_modules/pretty-bytes": {
+ "version": "5.6.0",
+ "resolved": "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-5.6.0.tgz",
+ "integrity": "sha512-FFw039TmrBqFK8ma/7OL3sDz/VytdtJr044/QUJtH0wK9lb9jLq9tJyIxUwtQJHwar2BqtiA4iCWSwo9JLkzFg==",
+ "dev": true,
+ "engines": {
+ "node": ">=6"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/punycode": {
+ "version": "2.3.1",
+ "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz",
+ "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/rechoir": {
+ "version": "0.7.1",
+ "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.7.1.tgz",
+ "integrity": "sha512-/njmZ8s1wVeR6pjTZ+0nCnv8SpZNRMT2D1RLOJQESlYFDBvwpTA4KWJpZ+sBJ4+vhjILRcK7JIFdGCdxEAAitg==",
+ "dev": true,
+ "dependencies": {
+ "resolve": "^1.9.0"
+ },
+ "engines": {
+ "node": ">= 0.10"
+ }
+ },
+ "node_modules/resolve": {
+ "version": "1.22.6",
+ "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.6.tgz",
+ "integrity": "sha512-njhxM7mV12JfufShqGy3Rz8j11RPdLy4xi15UurGJeoHLfJpVXKdh3ueuOqbYUcDZnffr6X739JBo5LzyahEsw==",
+ "dev": true,
+ "dependencies": {
+ "is-core-module": "^2.13.0",
+ "path-parse": "^1.0.7",
+ "supports-preserve-symlinks-flag": "^1.0.0"
+ },
+ "bin": {
+ "resolve": "bin/resolve"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/resolve-dir": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/resolve-dir/-/resolve-dir-1.0.1.tgz",
+ "integrity": "sha512-R7uiTjECzvOsWSfdM0QKFNBVFcK27aHOUwdvK53BcW8zqnGdYp0Fbj82cy54+2A4P2tFM22J5kRfe1R+lM/1yg==",
+ "dev": true,
+ "dependencies": {
+ "expand-tilde": "^2.0.0",
+ "global-modules": "^1.0.0"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/resolve-from": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz",
+ "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/safer-buffer": {
+ "version": "2.1.2",
+ "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
+ "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==",
+ "dev": true
+ },
+ "node_modules/shebang-command": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz",
+ "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "shebang-regex": "^3.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/shebang-regex": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz",
+ "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/sprintf-js": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz",
+ "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==",
+ "dev": true
+ },
+ "node_modules/strip-json-comments": {
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz",
+ "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=8"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/supports-color": {
+ "version": "7.2.0",
+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
+ "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
+ "dev": true,
+ "dependencies": {
+ "has-flag": "^4.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/supports-preserve-symlinks-flag": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz",
+ "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==",
+ "dev": true,
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/to-regex-range": {
+ "version": "5.0.1",
+ "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
+ "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==",
+ "dev": true,
+ "dependencies": {
+ "is-number": "^7.0.0"
+ },
+ "engines": {
+ "node": ">=8.0"
+ }
+ },
+ "node_modules/type-check": {
+ "version": "0.4.0",
+ "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz",
+ "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==",
+ "dev": true,
+ "dependencies": {
+ "prelude-ls": "^1.2.1"
+ },
+ "engines": {
+ "node": ">= 0.8.0"
+ }
+ },
+ "node_modules/typescript": {
+ "version": "5.8.3",
+ "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.3.tgz",
+ "integrity": "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==",
+ "dev": true,
+ "license": "Apache-2.0",
+ "bin": {
+ "tsc": "bin/tsc",
+ "tsserver": "bin/tsserver"
+ },
+ "engines": {
+ "node": ">=14.17"
+ }
+ },
+ "node_modules/uglify-js": {
+ "version": "3.17.4",
+ "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.17.4.tgz",
+ "integrity": "sha512-T9q82TJI9e/C1TAxYvfb16xO120tMVFZrGA3f9/P4424DNu6ypK103y0GPFVa17yotwSyZW5iYXgjYHkGrJW/g==",
+ "dev": true,
+ "bin": {
+ "uglifyjs": "bin/uglifyjs"
+ },
+ "engines": {
+ "node": ">=0.8.0"
+ }
+ },
+ "node_modules/unc-path-regex": {
+ "version": "0.1.2",
+ "resolved": "https://registry.npmjs.org/unc-path-regex/-/unc-path-regex-0.1.2.tgz",
+ "integrity": "sha512-eXL4nmJT7oCpkZsHZUOJo8hcX3GbsiDOa0Qu9F646fi8dT3XuSVopVqAcEiVzSKKH7UoDti23wNX3qGFxcW5Qg==",
+ "dev": true,
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/underscore.string": {
+ "version": "3.3.6",
+ "resolved": "https://registry.npmjs.org/underscore.string/-/underscore.string-3.3.6.tgz",
+ "integrity": "sha512-VoC83HWXmCrF6rgkyxS9GHv8W9Q5nhMKho+OadDJGzL2oDYbYEppBaCMH6pFlwLeqj2QS+hhkw2kpXkSdD1JxQ==",
+ "dev": true,
+ "dependencies": {
+ "sprintf-js": "^1.1.1",
+ "util-deprecate": "^1.0.2"
+ },
+ "engines": {
+ "node": "*"
+ }
+ },
+ "node_modules/underscore.string/node_modules/sprintf-js": {
+ "version": "1.1.3",
+ "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.3.tgz",
+ "integrity": "sha512-Oo+0REFV59/rz3gfJNKQiBlwfHaSESl1pcGyABQsnnIfWOFt6JNj5gCog2U6MLZ//IGYD+nA8nI+mTShREReaA==",
+ "dev": true
+ },
+ "node_modules/uri-js": {
+ "version": "4.4.1",
+ "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz",
+ "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==",
+ "dev": true,
+ "license": "BSD-2-Clause",
+ "dependencies": {
+ "punycode": "^2.1.0"
+ }
+ },
+ "node_modules/uri-path": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/uri-path/-/uri-path-1.0.0.tgz",
+ "integrity": "sha512-8pMuAn4KacYdGMkFaoQARicp4HSw24/DHOVKWqVRJ8LhhAwPPFpdGvdL9184JVmUwe7vz7Z9n6IqI6t5n2ELdg==",
+ "dev": true,
+ "engines": {
+ "node": ">= 0.10"
+ }
+ },
+ "node_modules/util-deprecate": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
+ "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==",
+ "dev": true
+ },
+ "node_modules/v8flags": {
+ "version": "3.2.0",
+ "resolved": "https://registry.npmjs.org/v8flags/-/v8flags-3.2.0.tgz",
+ "integrity": "sha512-mH8etigqMfiGWdeXpaaqGfs6BndypxusHHcv2qSHyZkGEznCd/qAXCWWRzeowtL54147cktFOC4P5y+kl8d8Jg==",
+ "dev": true,
+ "dependencies": {
+ "homedir-polyfill": "^1.0.1"
+ },
+ "engines": {
+ "node": ">= 0.10"
+ }
+ },
+ "node_modules/which": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
+ "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==",
+ "dev": true,
+ "dependencies": {
+ "isexe": "^2.0.0"
+ },
+ "bin": {
+ "node-which": "bin/node-which"
+ },
+ "engines": {
+ "node": ">= 8"
+ }
+ },
+ "node_modules/wrappy": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
+ "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==",
+ "dev": true
+ },
+ "node_modules/yocto-queue": {
+ "version": "0.1.0",
+ "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz",
+ "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==",
+ "dev": true,
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ }
+ }
+}
diff --git a/package.json b/package.json
index 9b302ccd..31897a3c 100644
--- a/package.json
+++ b/package.json
@@ -1,16 +1,43 @@
{
"name": "devbridge-autocomplete",
- "version": "1.2.14",
+ "version": "1.5.0",
"description": "Autocomplete provides suggestions while you type into the text field.",
"homepage": "https://github.com/devbridge/jQuery-Autocomplete",
"author": "Tomas Kirda (https://twitter.com/tkirda)",
"main": "dist/jquery.autocomplete.js",
+ "types": "./typings/jquery.autocomplete.d.ts",
"license": "MIT",
- "dependencies": {
- "jquery": ">=1.7"
+ "keywords": [
+ "jquery-plugin"
+ ],
+ "scripts": {
+ "build": "grunt build",
+ "format": "prettier --write ./src/**",
+ "lint": "eslint ./src"
+ },
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/devbridge/jQuery-Autocomplete.git"
+ },
+ "peerDependencies": {
+ "jquery": ">=1.9"
},
"devDependencies": {
- "grunt": "^0.4.5",
- "grunt-contrib-uglify": "^0.5.1"
- }
-}
+ "@types/jquery": "^3.5.32",
+ "eslint": "^9.30.1",
+ "grunt": "^1.6.1",
+ "grunt-contrib-uglify": "^5.2.2",
+ "prettier": "^3.6.2",
+ "typescript": "^5.8.3"
+ },
+ "prettier": {
+ "printWidth": 100,
+ "trailingComma": "es5",
+ "tabWidth": 4
+ },
+ "files": [
+ "dist/",
+ "typings/jquery-autocomplete/*.d.ts",
+ "readme.md"
+ ]
+}
\ No newline at end of file
diff --git a/readme.md b/readme.md
index 9ea85382..05723b98 100644
--- a/readme.md
+++ b/readme.md
@@ -1,194 +1,271 @@
-#Ajax AutoComplete for jQuery
+# Ajax Autocomplete for jQuery
-Ajax Autocomplete for jQuery allows you to easily create
+Ajax Autocomplete for jQuery allows you to easily create
autocomplete/autosuggest boxes for text input fields.
-Has no dependencies other than jQuery.
-
-The standard jquery.autocomplete.js file is around 2.7KB when minified via Closure Compiler and gzipped.
-
-##API
-
-* `$(selector).autocomplete(options);`
- * Sets up autocomplete for input field(s).
- * `options`: An object literal which defines the settings to use for the autocomplete plugin.
- * `serviceUrl`: Server side URL or callback function that returns serviceUrl string. Optional if local lookup data is provided.
- * `ajaxSettings`: Any additional [Ajax Settings](http://api.jquery.com/jquery.ajax/#jQuery-ajax-settings) that configure the jQuery Ajax request.
- * `lookup`: Lookup array for the suggestions. It may be array of strings or `suggestion` object literals.
- * `suggestion`: An object literal with the following format: `{ value: 'string', data: any }`.
- * `lookupFilter`: `function (suggestion, query, queryLowerCase) {}` filter function for local lookups. By default it does partial string match (case insensitive).
- * `lookupLimit`: Number of maximum results to display for local lookup. Default: no limit.
- * `onSelect`: `function (suggestion) {}` Callback function invoked when user selects suggestion
- from the list. `this` inside callback refers to input HtmlElement.
- * `minChars`: Minimum number of characters required to trigger autosuggest. Default: `1`.
- * `maxHeight`: Maximum height of the suggestions container in pixels. Default: `300`.
- * `deferRequestBy`: Number of miliseconds to defer ajax request. Default: `0`.
- * `width`: Suggestions container width in pixels, e.g.: 300. Default: `auto`, takes input field width.
- * `params`: Additional parameters to pass with the request, optional.
- * `formatResult`: `function (suggestion, currentValue) {}` custom function to
- format suggestion entry inside suggestions container, optional.
- * `delimiter`: String or RegExp, that splits input value and takes last part to as query for suggestions.
- Useful when for example you need to fill list of coma separated values.
- * `zIndex`: 'z-index' for suggestions container. Default: `9999`.
- * `type`: Ajax request type to get suggestions. Default: `GET`.
- * `noCache`: Boolean value indicating whether to cache suggestion results. Default `false`.
- * `onSearchStart`: `function (query) {}` called before ajax request. `this` is bound to input element.
- * `onSearchComplete`: `function (query, suggestions) {}` called after ajax response is processed. `this` is bound to input element. `suggestions` is an array containing the results.
- * `onSearchError`: `function (query, jqXHR, textStatus, errorThrown) {}` called if ajax request fails. `this` is bound to input element.
- * `onInvalidateSelection`: `function () {}` called when input is altered after selection has been made. `this` is bound to input element.
- * `triggerSelectOnValidInput`: Boolean value indicating if `select` should be triggered if it matches suggestion. Default `true`.
- * `preventBadQueries`: Boolean value indicating if it shoud prevent future ajax requests for queries with the same root if no results were returned. E.g. if `Jam` returns no suggestions, it will not fire for any future query that starts with `Jam`. Default `true`.
- * `beforeRender`: `function (container) {}` called before displaying the suggestions. You may manipulate suggestions DOM before it is displayed.
- * `tabDisabled`: Default `false`. Set to true to leave the cursor in the input field after the user tabs to select a suggestion.
- * `paramName`: Default `query`. The name of the request parameter that contains the query.
- * `transformResult`: `function(response, originalQuery) {}` called after the result of the query is ready. Converts the result into response.suggestions format.
- * `autoSelectFirst`: if set to `true`, first item will be selected when showing suggestions. Default value `false`.
- * `appendTo`: container where suggestions will be appended. Default value `document.body`. Can be jQuery object, selector or html element. Make sure to set `position: absolute` or `position: relative` for that element.
- * `dataType`: type of data returned from server. Either 'text' (default) or 'jsonp', which will cause the autocomplete to use jsonp. You may return a json object in your callback when using jsonp.
- * `showNoSuggestionNotice`: Default `false`. When no matching results, display a notification label.
- * `noSuggestionNotice`: Default `No results`. Text or htmlString or Element or jQuery object for no matching results label.
- * `forceFixPosition`: Default: `false`. Suggestions are automatically positioned when their container is appended to body (look at `appendTo` option), in other cases suggestions are rendered but no positioning is applied.
- Set this option to force auto positioning in other cases.
- * `orientation`: Default `bottom`. Vertical orientation of the displayed suggestions, available values are `auto`, `top`, `bottom`.
- If set to `auto`, the suggestions will be orientated it the way that place them closer to middle of the view port.
- * `groupBy`: property name of the suggestion `data` object, by which results should be grouped.
+It has no dependencies other than jQuery.
+
+The standard jquery.autocomplete.js file is around 13KB when minified.
+
+## API
+The following sets up autocomplete for input fields where `options` is an object literal that defines the settings to use for the autocomplete plugin. All available option settings are shown in the tables below.
+```js
+$(selector).autocomplete(options);
+```
+### General settings (local and Ajax)
+| Setting | Default | Description |
+| :--- | :--- | :--- |
+| `noCache` | `false` | Boolean value indicating whether to cache suggestion results |
+| `delimiter` | optional | String or RegExp, that splits input value and takes last part to as query for suggestions. Useful when for example you need to fill list of comma separated values. |
+| `minChars` | `1` | Minimum number of characters required to trigger autosuggest |
+| `triggerSelectOnValidInput` | `true` | Boolean value indicating if `select` should be triggered if it matches suggestion |
+| `preventBadQueries` | `true` | Boolean value indicating if it should prevent future Ajax requests for queries with the same root if no results were returned. E.g. if `Jam` returns no suggestions, it will not fire for any future query that starts with `Jam` |
+| `autoSelectFirst` | `false` | If set to `true`, first item will be selected when showing suggestions |
+| `beforeRender` | optional | `function (container, suggestions) {}` called before displaying the suggestions. You may manipulate suggestions DOM before it is displayed |
+| `formatResult` | optional | `function (suggestion, currentValue) {}` custom function to format suggestion entry inside suggestions container |
+| `formatGroup` | optional | `function (suggestion, category) {}` custom function to format group header |
+| `groupBy` | optional | property name of the suggestion `data` object, by which results should be grouped |
+| `maxHeight` | `300` | Maximum height of the suggestions container in pixels |
+| `width` | `auto` | Suggestions container width in pixels, e.g.: 300, `flex` for max suggestion size and `auto` takes input field width |
+| `zIndex` | `9999` | 'z-index' for suggestions container |
+| `appendTo` | optional | Container where suggestions will be appended. Default value `document.body`. Can be jQuery object, selector or HTML element. Make sure to set `position: absolute` or `position: relative` for that element |
+| `forceFixPosition` | `false` | Suggestions are automatically positioned when their container is appended to body (look at `appendTo` option), in other cases suggestions are rendered but no positioning is applied. Set this option to force auto positioning in other cases |
+| `orientation` | `bottom` | Vertical orientation of the displayed suggestions, available values are `auto`, `top`, `bottom`. If set to `auto`, the suggestions will be orientated it the way that place them closer to middle of the view port |
+| `preserveInput` | `false` | If `true`, input value stays the same when navigating over suggestions |
+| `showNoSuggestionNotice` | `false` | When no matching results, display a notification label |
+| `noSuggestionNotice` | `No results` | Text or htmlString or Element or jQuery object for no matching results label |
+| `onInvalidateSelection` | optional | `function () {}` called when input is altered after selection has been made. `this` is bound to input element |
+| `tabDisabled` | `false` | Set to true to leave the cursor in the input field after the user tabs to select a suggestion |
+
+
+### Event function settings (local and Ajax)
+| Event setting | Function description |
+| :--- | :--- |
+| `onSearchStart` | `function (params) {}` called before Ajax request. `this` is bound to input element |
+| `onHint` | `function (hint) {}` used to change input value to first suggestion automatically. `this` is bound to input element |
+| `onSearchComplete` | `function (query, suggestions) {}` called after Ajax response is processed. `this` is bound to input element. `suggestions` is an array containing the results |
+| `transformResult` | `function(response, originalQuery) {}` called after the result of the query is ready. Converts the result into response.suggestions format |
+| `onSelect` | `function (suggestion) {}` Callback function invoked when user selects suggestion from the list. `this` inside callback refers to input HtmlElement.|
+| `onSearchError` | `function (query, jqXHR, textStatus, errorThrown) {}` called if Ajax request fails. `this` is bound to input element |
+| `onHide` | `function (container) {}` called before container will be hidden |
+
+
+### Local only settings
+| Setting | Default | Description |
+| :--- | :--- | :--- |
+| `lookupLimit` | `no limit` | Number of maximum results to display for local lookup |
+| `lookup` | n/a | Callback function or lookup array for the suggestions. It may be array of strings or `suggestion` object literals |
+| `suggestion` | n/a | Not a settings, but in the context of above row, a suggestion is an object literal with the following format: `{ value: 'string', data: any }` |
+| `lookupFilter` | n/a | `function (suggestion, query, queryLowerCase) {}` filter function for local lookups. By default it does partial string match (case insensitive) |
+
+### Ajax only settings
+| Setting | Default | Description |
+| :--- | :--- | :--- |
+| `serviceUrl` | n/a | Server side URL or callback function that returns serviceUrl string |
+| `type` | `GET` | Ajax request type to get suggestions |
+| `dataType` | `text` | type of data returned from server. Either `text`, `json` or `jsonp`, which will cause the autocomplete to use jsonp. You may return a json object in your callback when using jsonp |
+| `paramName` | `query` | The name of the request parameter that contains the query |
+| `params` | optional | Additional parameters to pass with the request |
+| `deferRequestBy` | `0` | Number of miliseconds to defer Ajax request |
+| `ajaxSettings` | optional | Any additional [Ajax Settings](http://api.jquery.com/jquery.ajax/#jQuery-ajax-settings) that configure the jQuery Ajax request |
+
+## Default Options
+
+Default options for all instances can be accessed via `$.Autocomplete.defaults`.
+
+## Instance Methods
Autocomplete instance has following methods:
* `setOptions(options)`: you may update any option at any time. Options are listed above.
-* `clear`: clears suggestion cache and current suggestions suggestions.
+* `clear`: clears suggestion cache and current suggestions.
* `clearCache`: clears suggestion cache.
* `disable`: deactivate autocomplete.
* `enable`: activates autocomplete if it was deactivated before.
* `hide`: hides suggestions.
* `dispose`: destroys autocomplete instance. All events are detached and suggestion containers removed.
-There are two ways that you can invoke Autocomplete method. One is calling autocomplete on jQuery object and passing method name as string literal.
+There are two ways that you can invoke Autocomplete method. One is calling autocomplete on jQuery object and passing method name as string literal.
If method has arguments, arguments are passed as consecutive parameters:
- $('#autocomplete').autocomplete('disable');
- $('#autocomplete').autocomplete('setOptions', options);
+```javascript
+$('#autocomplete').autocomplete('disable');
+$('#autocomplete').autocomplete('setOptions', options);
+```
Or you can get Autocomplete instance by calling autcomplete on jQuery object without any parameters and then invoke desired method.
- $('#autocomplete').autocomplete().disable();
- $('#autocomplete').autocomplete().setOptions(options);
+```javascript
+$('#autocomplete').autocomplete().disable();
+$('#autocomplete').autocomplete().setOptions(options);
+```
-##Usage
+## Usage
Html:
-
+```html
+
+```
Ajax lookup:
- $('#autocomplete').autocomplete({
- serviceUrl: '/autocomplete/countries',
- onSelect: function (suggestion) {
- alert('You selected: ' + suggestion.value + ', ' + suggestion.data);
- }
- });
-
-Local lookup (no ajax):
-
- var countries = [
- { value: 'Andorra', data: 'AD' },
- // ...
- { value: 'Zimbabwe', data: 'ZZ' }
- ];
-
- $('#autocomplete').autocomplete({
- lookup: countries,
- onSelect: function (suggestion) {
- alert('You selected: ' + suggestion.value + ', ' + suggestion.data);
- }
- });
+```javascript
+$('#autocomplete').autocomplete({
+ serviceUrl: '/autocomplete/countries',
+ onSelect: function (suggestion) {
+ alert('You selected: ' + suggestion.value + ', ' + suggestion.data);
+ }
+});
+```
+
+Local lookup (no Ajax):
+
+```javascript
+var countries = [
+ { value: 'Andorra', data: 'AD' },
+ // ...
+ { value: 'Zimbabwe', data: 'ZZ' }
+];
+
+$('#autocomplete').autocomplete({
+ lookup: countries,
+ onSelect: function (suggestion) {
+ alert('You selected: ' + suggestion.value + ', ' + suggestion.data);
+ }
+});
+```
+
+Custom lookup function:
+```javascript
+
+$('#autocomplete').autocomplete({
+ lookup: function (query, done) {
+ // Do Ajax call or lookup locally, when done,
+ // call the callback and pass your results:
+ var result = {
+ suggestions: [
+ { "value": "United Arab Emirates", "data": "AE" },
+ { "value": "United Kingdom", "data": "UK" },
+ { "value": "United States", "data": "US" }
+ ]
+ };
+
+ done(result);
+ },
+ onSelect: function (suggestion) {
+ alert('You selected: ' + suggestion.value + ', ' + suggestion.data);
+ }
+});
+```
-##Styling
+## Styling
-Generated HTML markup for suggestions is displayed bellow. You may style it any way you'd like.
+Generated HTML markup for suggestions is displayed below. You may style it any way you'd like.
-
-
NHL
-
...
-
...
-
...
-
+```html
+
+
NHL
+
...
+
...
+
...
+
+```
Style sample:
- .autocomplete-suggestions { border: 1px solid #999; background: #FFF; overflow: auto; }
- .autocomplete-suggestion { padding: 2px 5px; white-space: nowrap; overflow: hidden; }
- .autocomplete-selected { background: #F0F0F0; }
- .autocomplete-suggestions strong { font-weight: normal; color: #3399FF; }
- .autocomplete-group { padding: 2px 5px; }
- .autocomplete-group strong { display: block; border-bottom: 1px solid #000; }
+```css
+.autocomplete-suggestions { border: 1px solid #999; background: #FFF; overflow: auto; }
+.autocomplete-suggestion { padding: 2px 5px; white-space: nowrap; overflow: hidden; }
+.autocomplete-selected { background: #F0F0F0; }
+.autocomplete-suggestions strong { font-weight: normal; color: #3399FF; }
+.autocomplete-group { padding: 2px 5px; }
+.autocomplete-group strong { display: block; border-bottom: 1px solid #000; }
+```
-##Response Format
+## Response Format
Response from the server must be JSON formatted following JavaScript object:
- {
- // Query is not required as of version 1.2.5
- "query": "Unit",
- "suggestions": [
- { "value": "United Arab Emirates", "data": "AE" },
- { "value": "United Kingdom", "data": "UK" },
- { "value": "United States", "data": "US" }
- ]
- }
+```javascript
+{
+ // Query is not required as of version 1.2.5
+ "query": "Unit",
+ "suggestions": [
+ { "value": "United Arab Emirates", "data": "AE" },
+ { "value": "United Kingdom", "data": "UK" },
+ { "value": "United States", "data": "US" }
+ ]
+}
+```
-Data can be any value or object. Data object is passed to formatResults function
-and onSelect callback. Alternatively, if there is no data you can
+Data can be any value or object. Data object is passed to formatResults function
+and onSelect callback. Alternatively, if there is no data you can
supply just a string array for suggestions:
- {
- "query": "Unit",
- "suggestions": ["United Arab Emirates", "United Kingdom", "United States"]
- }
+```json
+{
+ "query": "Unit",
+ "suggestions": ["United Arab Emirates", "United Kingdom", "United States"]
+}
+```
## Non standard query/results
-If your ajax service expects the query in a different format, and returns data in a different format than the standard response,
+If your Ajax service expects the query in a different format, and returns data in a different format than the standard response,
you can supply the "paramName" and "transformResult" options:
- $('#autocomplete').autocomplete({
- paramName: 'searchString',
- transformResult: function(response) {
- return {
- suggestions: $.map(response.myData, function(dataItem) {
- return { value: dataItem.valueField, data: dataItem.dataField };
- })
- };
- }
- })
+```javascript
+$('#autocomplete').autocomplete({
+ paramName: 'searchString',
+ transformResult: function(response) {
+ return {
+ suggestions: $.map(response.myData, function(dataItem) {
+ return { value: dataItem.valueField, data: dataItem.dataField };
+ })
+ };
+ }
+})
+```
## Grouping Results
Specify `groupBy` option of you data property if you wish results to be displayed in groups. For example, set `groupBy: 'category'` if your suggestion data format is:
- [
- { value: 'Chicago Blackhawks', data: { category: 'NHL' } },
- { value: 'Chicago Bulls', data: { category: 'NBA' } }
- ]
+```javascript
+[
+ { value: 'Chicago Blackhawks', data: { category: 'NHL' } },
+ { value: 'Chicago Bulls', data: { category: 'NBA' } }
+]
+```
Results will be formatted into two groups **NHL** and **NBA**.
-##Known Issues
+## Known Issues
If you use it with jQuery UI library it also has plugin named `autocomplete`. In this case you can use plugin alias `devbridgeAutocomplete`:
- $('.autocomplete').devbridgeAutocomplete({ ... });
+```javascript
+$('.autocomplete').devbridgeAutocomplete({ ... });
+```
+
+It seems that for mobile Safari click events are only triggered if the CSS of the object being tapped has the cursor set to pointer:
+
+ .autocomplete-suggestion {
+ cursor: pointer;
+ }
+
+See issue #542
-##License
+## License
-Ajax Autocomplete for jQuery is freely distributable under the
+Ajax Autocomplete for jQuery is freely distributable under the
terms of an MIT-style [license](https://github.com/devbridge/jQuery-Autocomplete/blob/master/dist/license.txt).
-Copyright notice and permission notice shall be included in all
+Copyright notice and permission notice shall be included in all
copies or substantial portions of the Software.
-##Authors
+## Authors
Tomas Kirda / [@tkirda](https://twitter.com/tkirda)
diff --git a/scripts/countries.js b/scripts/countries.js
index 1e5bee6a..7d41ee4e 100644
--- a/scripts/countries.js
+++ b/scripts/countries.js
@@ -1,5 +1,6 @@
var countries = {
"AD": "Andorra",
+ "A2": "Andorra Test",
"AE": "United Arab Emirates",
"AF": "Afghanistan",
"AG": "Antigua and Barbuda",
diff --git a/scripts/jquery-1.8.2.min.js b/scripts/jquery-1.8.2.min.js
deleted file mode 100644
index bc3fbc81..00000000
--- a/scripts/jquery-1.8.2.min.js
+++ /dev/null
@@ -1,2 +0,0 @@
-/*! jQuery v1.8.2 jquery.com | jquery.org/license */
-(function(a,b){function G(a){var b=F[a]={};return p.each(a.split(s),function(a,c){b[c]=!0}),b}function J(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(I,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:+d+""===d?+d:H.test(d)?p.parseJSON(d):d}catch(f){}p.data(a,c,d)}else d=b}return d}function K(a){var b;for(b in a){if(b==="data"&&p.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function ba(){return!1}function bb(){return!0}function bh(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function bi(a,b){do a=a[b];while(a&&a.nodeType!==1);return a}function bj(a,b,c){b=b||0;if(p.isFunction(b))return p.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c});if(b.nodeType)return p.grep(a,function(a,d){return a===b===c});if(typeof b=="string"){var d=p.grep(a,function(a){return a.nodeType===1});if(be.test(b))return p.filter(b,d,!c);b=p.filter(b,d)}return p.grep(a,function(a,d){return p.inArray(a,b)>=0===c})}function bk(a){var b=bl.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}function bC(a,b){return a.getElementsByTagName(b)[0]||a.appendChild(a.ownerDocument.createElement(b))}function bD(a,b){if(b.nodeType!==1||!p.hasData(a))return;var c,d,e,f=p._data(a),g=p._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;d").appendTo(e.body),c=b.css("display");b.remove();if(c==="none"||c===""){bI=e.body.appendChild(bI||p.extend(e.createElement("iframe"),{frameBorder:0,width:0,height:0}));if(!bJ||!bI.createElement)bJ=(bI.contentWindow||bI.contentDocument).document,bJ.write(""),bJ.close();b=bJ.body.appendChild(bJ.createElement(a)),c=bH(b,"display"),e.body.removeChild(bI)}return bS[a]=c,c}function ci(a,b,c,d){var e;if(p.isArray(b))p.each(b,function(b,e){c||ce.test(a)?d(a,e):ci(a+"["+(typeof e=="object"?b:"")+"]",e,c,d)});else if(!c&&p.type(b)==="object")for(e in b)ci(a+"["+e+"]",b[e],c,d);else d(a,b)}function cz(a){return function(b,c){typeof b!="string"&&(c=b,b="*");var d,e,f,g=b.toLowerCase().split(s),h=0,i=g.length;if(p.isFunction(c))for(;h<1&&f?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:p.extend({},b),opts:p.extend(!0,{specialEasing:{}},c),originalProperties:b,originalOptions:c,startTime:cN||cU(),duration:c.duration,tweens:[],createTween:function(b,c,d){var e=p.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(e),e},stop:function(b){var c=0,d=b?j.tweens.length:0;for(;c)[^>]*$|#([\w\-]*)$)/,v=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,w=/^[\],:{}\s]*$/,x=/(?:^|:|,)(?:\s*\[)+/g,y=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,z=/"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g,A=/^-ms-/,B=/-([\da-z])/gi,C=function(a,b){return(b+"").toUpperCase()},D=function(){e.addEventListener?(e.removeEventListener("DOMContentLoaded",D,!1),p.ready()):e.readyState==="complete"&&(e.detachEvent("onreadystatechange",D),p.ready())},E={};p.fn=p.prototype={constructor:p,init:function(a,c,d){var f,g,h,i;if(!a)return this;if(a.nodeType)return this.context=this[0]=a,this.length=1,this;if(typeof a=="string"){a.charAt(0)==="<"&&a.charAt(a.length-1)===">"&&a.length>=3?f=[null,a,null]:f=u.exec(a);if(f&&(f[1]||!c)){if(f[1])return c=c instanceof p?c[0]:c,i=c&&c.nodeType?c.ownerDocument||c:e,a=p.parseHTML(f[1],i,!0),v.test(f[1])&&p.isPlainObject(c)&&this.attr.call(a,c,!0),p.merge(this,a);g=e.getElementById(f[2]);if(g&&g.parentNode){if(g.id!==f[2])return d.find(a);this.length=1,this[0]=g}return this.context=e,this.selector=a,this}return!c||c.jquery?(c||d).find(a):this.constructor(c).find(a)}return p.isFunction(a)?d.ready(a):(a.selector!==b&&(this.selector=a.selector,this.context=a.context),p.makeArray(a,this))},selector:"",jquery:"1.8.2",length:0,size:function(){return this.length},toArray:function(){return k.call(this)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=p.merge(this.constructor(),a);return d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")"),d},each:function(a,b){return p.each(this,a,b)},ready:function(a){return p.ready.promise().done(a),this},eq:function(a){return a=+a,a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(k.apply(this,arguments),"slice",k.call(arguments).join(","))},map:function(a){return this.pushStack(p.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:j,sort:[].sort,splice:[].splice},p.fn.init.prototype=p.fn,p.extend=p.fn.extend=function(){var a,c,d,e,f,g,h=arguments[0]||{},i=1,j=arguments.length,k=!1;typeof h=="boolean"&&(k=h,h=arguments[1]||{},i=2),typeof h!="object"&&!p.isFunction(h)&&(h={}),j===i&&(h=this,--i);for(;i0)return;d.resolveWith(e,[p]),p.fn.trigger&&p(e).trigger("ready").off("ready")},isFunction:function(a){return p.type(a)==="function"},isArray:Array.isArray||function(a){return p.type(a)==="array"},isWindow:function(a){return a!=null&&a==a.window},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):E[m.call(a)]||"object"},isPlainObject:function(a){if(!a||p.type(a)!=="object"||a.nodeType||p.isWindow(a))return!1;try{if(a.constructor&&!n.call(a,"constructor")&&!n.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||n.call(a,d)},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},error:function(a){throw new Error(a)},parseHTML:function(a,b,c){var d;return!a||typeof a!="string"?null:(typeof b=="boolean"&&(c=b,b=0),b=b||e,(d=v.exec(a))?[b.createElement(d[1])]:(d=p.buildFragment([a],b,c?null:[]),p.merge([],(d.cacheable?p.clone(d.fragment):d.fragment).childNodes)))},parseJSON:function(b){if(!b||typeof b!="string")return null;b=p.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(w.test(b.replace(y,"@").replace(z,"]").replace(x,"")))return(new Function("return "+b))();p.error("Invalid JSON: "+b)},parseXML:function(c){var d,e;if(!c||typeof c!="string")return null;try{a.DOMParser?(e=new DOMParser,d=e.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(f){d=b}return(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&p.error("Invalid XML: "+c),d},noop:function(){},globalEval:function(b){b&&r.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(A,"ms-").replace(B,C)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,c,d){var e,f=0,g=a.length,h=g===b||p.isFunction(a);if(d){if(h){for(e in a)if(c.apply(a[e],d)===!1)break}else for(;f0&&a[0]&&a[i-1]||i===0||p.isArray(a));if(j)for(;h-1)i.splice(c,1),e&&(c<=g&&g--,c<=h&&h--)}),this},has:function(a){return p.inArray(a,i)>-1},empty:function(){return i=[],this},disable:function(){return i=j=c=b,this},disabled:function(){return!i},lock:function(){return j=b,c||l.disable(),this},locked:function(){return!j},fireWith:function(a,b){return b=b||[],b=[a,b.slice?b.slice():b],i&&(!d||j)&&(e?j.push(b):k(b)),this},fire:function(){return l.fireWith(this,arguments),this},fired:function(){return!!d}};return l},p.extend({Deferred:function(a){var b=[["resolve","done",p.Callbacks("once memory"),"resolved"],["reject","fail",p.Callbacks("once memory"),"rejected"],["notify","progress",p.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return p.Deferred(function(c){p.each(b,function(b,d){var f=d[0],g=a[b];e[d[1]](p.isFunction(g)?function(){var a=g.apply(this,arguments);a&&p.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f+"With"](this===e?c:this,[a])}:c[f])}),a=null}).promise()},promise:function(a){return a!=null?p.extend(a,d):d}},e={};return d.pipe=d.then,p.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[a^1][2].disable,b[2][2].lock),e[f[0]]=g.fire,e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=k.call(arguments),d=c.length,e=d!==1||a&&p.isFunction(a.promise)?d:0,f=e===1?a:p.Deferred(),g=function(a,b,c){return function(d){b[a]=this,c[a]=arguments.length>1?k.call(arguments):d,c===h?f.notifyWith(b,c):--e||f.resolveWith(b,c)}},h,i,j;if(d>1){h=new Array(d),i=new Array(d),j=new Array(d);for(;ba ",c=n.getElementsByTagName("*"),d=n.getElementsByTagName("a")[0],d.style.cssText="top:1px;float:left;opacity:.5";if(!c||!c.length)return{};f=e.createElement("select"),g=f.appendChild(e.createElement("option")),h=n.getElementsByTagName("input")[0],b={leadingWhitespace:n.firstChild.nodeType===3,tbody:!n.getElementsByTagName("tbody").length,htmlSerialize:!!n.getElementsByTagName("link").length,style:/top/.test(d.getAttribute("style")),hrefNormalized:d.getAttribute("href")==="/a",opacity:/^0.5/.test(d.style.opacity),cssFloat:!!d.style.cssFloat,checkOn:h.value==="on",optSelected:g.selected,getSetAttribute:n.className!=="t",enctype:!!e.createElement("form").enctype,html5Clone:e.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",boxModel:e.compatMode==="CSS1Compat",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},h.checked=!0,b.noCloneChecked=h.cloneNode(!0).checked,f.disabled=!0,b.optDisabled=!g.disabled;try{delete n.test}catch(o){b.deleteExpando=!1}!n.addEventListener&&n.attachEvent&&n.fireEvent&&(n.attachEvent("onclick",m=function(){b.noCloneEvent=!1}),n.cloneNode(!0).fireEvent("onclick"),n.detachEvent("onclick",m)),h=e.createElement("input"),h.value="t",h.setAttribute("type","radio"),b.radioValue=h.value==="t",h.setAttribute("checked","checked"),h.setAttribute("name","t"),n.appendChild(h),i=e.createDocumentFragment(),i.appendChild(n.lastChild),b.checkClone=i.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=h.checked,i.removeChild(h),i.appendChild(n);if(n.attachEvent)for(k in{submit:!0,change:!0,focusin:!0})j="on"+k,l=j in n,l||(n.setAttribute(j,"return;"),l=typeof n[j]=="function"),b[k+"Bubbles"]=l;return p(function(){var c,d,f,g,h="padding:0;margin:0;border:0;display:block;overflow:hidden;",i=e.getElementsByTagName("body")[0];if(!i)return;c=e.createElement("div"),c.style.cssText="visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px",i.insertBefore(c,i.firstChild),d=e.createElement("div"),c.appendChild(d),d.innerHTML="",f=d.getElementsByTagName("td"),f[0].style.cssText="padding:0;margin:0;border:0;display:none",l=f[0].offsetHeight===0,f[0].style.display="",f[1].style.display="none",b.reliableHiddenOffsets=l&&f[0].offsetHeight===0,d.innerHTML="",d.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",b.boxSizing=d.offsetWidth===4,b.doesNotIncludeMarginInBodyOffset=i.offsetTop!==1,a.getComputedStyle&&(b.pixelPosition=(a.getComputedStyle(d,null)||{}).top!=="1%",b.boxSizingReliable=(a.getComputedStyle(d,null)||{width:"4px"}).width==="4px",g=e.createElement("div"),g.style.cssText=d.style.cssText=h,g.style.marginRight=g.style.width="0",d.style.width="1px",d.appendChild(g),b.reliableMarginRight=!parseFloat((a.getComputedStyle(g,null)||{}).marginRight)),typeof d.style.zoom!="undefined"&&(d.innerHTML="",d.style.cssText=h+"width:1px;padding:1px;display:inline;zoom:1",b.inlineBlockNeedsLayout=d.offsetWidth===3,d.style.display="block",d.style.overflow="visible",d.innerHTML="
",d.firstChild.style.width="5px",b.shrinkWrapBlocks=d.offsetWidth!==3,c.style.zoom=1),i.removeChild(c),c=d=f=g=null}),i.removeChild(n),c=d=f=g=h=i=n=null,b}();var H=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,I=/([A-Z])/g;p.extend({cache:{},deletedIds:[],uuid:0,expando:"jQuery"+(p.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){return a=a.nodeType?p.cache[a[p.expando]]:a[p.expando],!!a&&!K(a)},data:function(a,c,d,e){if(!p.acceptData(a))return;var f,g,h=p.expando,i=typeof c=="string",j=a.nodeType,k=j?p.cache:a,l=j?a[h]:a[h]&&h;if((!l||!k[l]||!e&&!k[l].data)&&i&&d===b)return;l||(j?a[h]=l=p.deletedIds.pop()||p.guid++:l=h),k[l]||(k[l]={},j||(k[l].toJSON=p.noop));if(typeof c=="object"||typeof c=="function")e?k[l]=p.extend(k[l],c):k[l].data=p.extend(k[l].data,c);return f=k[l],e||(f.data||(f.data={}),f=f.data),d!==b&&(f[p.camelCase(c)]=d),i?(g=f[c],g==null&&(g=f[p.camelCase(c)])):g=f,g},removeData:function(a,b,c){if(!p.acceptData(a))return;var d,e,f,g=a.nodeType,h=g?p.cache:a,i=g?a[p.expando]:p.expando;if(!h[i])return;if(b){d=c?h[i]:h[i].data;if(d){p.isArray(b)||(b in d?b=[b]:(b=p.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,f=b.length;e1,null,!1))},removeData:function(a){return this.each(function(){p.removeData(this,a)})}}),p.extend({queue:function(a,b,c){var d;if(a)return b=(b||"fx")+"queue",d=p._data(a,b),c&&(!d||p.isArray(c)?d=p._data(a,b,p.makeArray(c)):d.push(c)),d||[]},dequeue:function(a,b){b=b||"fx";var c=p.queue(a,b),d=c.length,e=c.shift(),f=p._queueHooks(a,b),g=function(){p.dequeue(a,b)};e==="inprogress"&&(e=c.shift(),d--),e&&(b==="fx"&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return p._data(a,c)||p._data(a,c,{empty:p.Callbacks("once memory").add(function(){p.removeData(a,b+"queue",!0),p.removeData(a,c,!0)})})}}),p.fn.extend({queue:function(a,c){var d=2;return typeof a!="string"&&(c=a,a="fx",d--),arguments.length1)},removeAttr:function(a){return this.each(function(){p.removeAttr(this,a)})},prop:function(a,b){return p.access(this,p.prop,a,b,arguments.length>1)},removeProp:function(a){return a=p.propFix[a]||a,this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,f,g,h;if(p.isFunction(a))return this.each(function(b){p(this).addClass(a.call(this,b,this.className))});if(a&&typeof a=="string"){b=a.split(s);for(c=0,d=this.length;c<0&&(f+=b[g]+" ");e.className=p.trim(f)}}}return this},removeClass:function(a){var c,d,e,f,g,h,i;if(p.isFunction(a))return this.each(function(b){p(this).removeClass(a.call(this,b,this.className))});if(a&&typeof a=="string"||a===b){c=(a||"").split(s);for(h=0,i=this.length;h=0)d=d.replace(" "+c[f]+" "," ");e.className=a?p.trim(d):""}}}return this},toggleClass:function(a,b){var c=typeof a,d=typeof b=="boolean";return p.isFunction(a)?this.each(function(c){p(this).toggleClass(a.call(this,c,this.className,b),b)}):this.each(function(){if(c==="string"){var e,f=0,g=p(this),h=b,i=a.split(s);while(e=i[f++])h=d?h:!g.hasClass(e),g[h?"addClass":"removeClass"](e)}else if(c==="undefined"||c==="boolean")this.className&&p._data(this,"__className__",this.className),this.className=this.className||a===!1?"":p._data(this,"__className__")||""})},hasClass:function(a){var b=" "+a+" ",c=0,d=this.length;for(;c=0)return!0;return!1},val:function(a){var c,d,e,f=this[0];if(!arguments.length){if(f)return c=p.valHooks[f.type]||p.valHooks[f.nodeName.toLowerCase()],c&&"get"in c&&(d=c.get(f,"value"))!==b?d:(d=f.value,typeof d=="string"?d.replace(P,""):d==null?"":d);return}return e=p.isFunction(a),this.each(function(d){var f,g=p(this);if(this.nodeType!==1)return;e?f=a.call(this,d,g.val()):f=a,f==null?f="":typeof f=="number"?f+="":p.isArray(f)&&(f=p.map(f,function(a){return a==null?"":a+""})),c=p.valHooks[this.type]||p.valHooks[this.nodeName.toLowerCase()];if(!c||!("set"in c)||c.set(this,f,"value")===b)this.value=f})}}),p.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,f=a.selectedIndex,g=[],h=a.options,i=a.type==="select-one";if(f<0)return null;c=i?f:0,d=i?f+1:h.length;for(;c=0}),c.length||(a.selectedIndex=-1),c}}},attrFn:{},attr:function(a,c,d,e){var f,g,h,i=a.nodeType;if(!a||i===3||i===8||i===2)return;if(e&&p.isFunction(p.fn[c]))return p(a)[c](d);if(typeof a.getAttribute=="undefined")return p.prop(a,c,d);h=i!==1||!p.isXMLDoc(a),h&&(c=c.toLowerCase(),g=p.attrHooks[c]||(T.test(c)?M:L));if(d!==b){if(d===null){p.removeAttr(a,c);return}return g&&"set"in g&&h&&(f=g.set(a,d,c))!==b?f:(a.setAttribute(c,d+""),d)}return g&&"get"in g&&h&&(f=g.get(a,c))!==null?f:(f=a.getAttribute(c),f===null?b:f)},removeAttr:function(a,b){var c,d,e,f,g=0;if(b&&a.nodeType===1){d=b.split(s);for(;g=0}})});var V=/^(?:textarea|input|select)$/i,W=/^([^\.]*|)(?:\.(.+)|)$/,X=/(?:^|\s)hover(\.\S+|)\b/,Y=/^key/,Z=/^(?:mouse|contextmenu)|click/,$=/^(?:focusinfocus|focusoutblur)$/,_=function(a){return p.event.special.hover?a:a.replace(X,"mouseenter$1 mouseleave$1")};p.event={add:function(a,c,d,e,f){var g,h,i,j,k,l,m,n,o,q,r;if(a.nodeType===3||a.nodeType===8||!c||!d||!(g=p._data(a)))return;d.handler&&(o=d,d=o.handler,f=o.selector),d.guid||(d.guid=p.guid++),i=g.events,i||(g.events=i={}),h=g.handle,h||(g.handle=h=function(a){return typeof p!="undefined"&&(!a||p.event.triggered!==a.type)?p.event.dispatch.apply(h.elem,arguments):b},h.elem=a),c=p.trim(_(c)).split(" ");for(j=0;j=0&&(s=s.slice(0,-1),i=!0),s.indexOf(".")>=0&&(t=s.split("."),s=t.shift(),t.sort());if((!f||p.event.customEvent[s])&&!p.event.global[s])return;c=typeof c=="object"?c[p.expando]?c:new p.Event(s,c):new p.Event(s),c.type=s,c.isTrigger=!0,c.exclusive=i,c.namespace=t.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+t.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,m=s.indexOf(":")<0?"on"+s:"";if(!f){h=p.cache;for(j in h)h[j].events&&h[j].events[s]&&p.event.trigger(c,d,h[j].handle.elem,!0);return}c.result=b,c.target||(c.target=f),d=d!=null?p.makeArray(d):[],d.unshift(c),n=p.event.special[s]||{};if(n.trigger&&n.trigger.apply(f,d)===!1)return;q=[[f,n.bindType||s]];if(!g&&!n.noBubble&&!p.isWindow(f)){r=n.delegateType||s,k=$.test(r+s)?f:f.parentNode;for(l=f;k;k=k.parentNode)q.push([k,r]),l=k;l===(f.ownerDocument||e)&&q.push([l.defaultView||l.parentWindow||a,r])}for(j=0;j=0:p.find(m,this,null,[f]).length),h[m]&&j.push(l);j.length&&u.push({elem:f,matches:j})}o.length>q&&u.push({elem:this,matches:o.slice(q)});for(d=0;d0?this.on(b,null,a,c):this.trigger(b)},Y.test(b)&&(p.event.fixHooks[b]=p.event.keyHooks),Z.test(b)&&(p.event.fixHooks[b]=p.event.mouseHooks)}),function(a,b){function bc(a,b,c,d){c=c||[],b=b||r;var e,f,i,j,k=b.nodeType;if(!a||typeof a!="string")return c;if(k!==1&&k!==9)return[];i=g(b);if(!i&&!d)if(e=P.exec(a))if(j=e[1]){if(k===9){f=b.getElementById(j);if(!f||!f.parentNode)return c;if(f.id===j)return c.push(f),c}else if(b.ownerDocument&&(f=b.ownerDocument.getElementById(j))&&h(b,f)&&f.id===j)return c.push(f),c}else{if(e[2])return w.apply(c,x.call(b.getElementsByTagName(a),0)),c;if((j=e[3])&&_&&b.getElementsByClassName)return w.apply(c,x.call(b.getElementsByClassName(j),0)),c}return bp(a.replace(L,"$1"),b,c,d,i)}function bd(a){return function(b){var c=b.nodeName.toLowerCase();return c==="input"&&b.type===a}}function be(a){return function(b){var c=b.nodeName.toLowerCase();return(c==="input"||c==="button")&&b.type===a}}function bf(a){return z(function(b){return b=+b,z(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function bg(a,b,c){if(a===b)return c;var d=a.nextSibling;while(d){if(d===b)return-1;d=d.nextSibling}return 1}function bh(a,b){var c,d,f,g,h,i,j,k=C[o][a];if(k)return b?0:k.slice(0);h=a,i=[],j=e.preFilter;while(h){if(!c||(d=M.exec(h)))d&&(h=h.slice(d[0].length)),i.push(f=[]);c=!1;if(d=N.exec(h))f.push(c=new q(d.shift())),h=h.slice(c.length),c.type=d[0].replace(L," ");for(g in e.filter)(d=W[g].exec(h))&&(!j[g]||(d=j[g](d,r,!0)))&&(f.push(c=new q(d.shift())),h=h.slice(c.length),c.type=g,c.matches=d);if(!c)break}return b?h.length:h?bc.error(a):C(a,i).slice(0)}function bi(a,b,d){var e=b.dir,f=d&&b.dir==="parentNode",g=u++;return b.first?function(b,c,d){while(b=b[e])if(f||b.nodeType===1)return a(b,c,d)}:function(b,d,h){if(!h){var i,j=t+" "+g+" ",k=j+c;while(b=b[e])if(f||b.nodeType===1){if((i=b[o])===k)return b.sizset;if(typeof i=="string"&&i.indexOf(j)===0){if(b.sizset)return b}else{b[o]=k;if(a(b,d,h))return b.sizset=!0,b;b.sizset=!1}}}else while(b=b[e])if(f||b.nodeType===1)if(a(b,d,h))return b}}function bj(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function bk(a,b,c,d,e){var f,g=[],h=0,i=a.length,j=b!=null;for(;h-1},h,!0),m=[function(a,c,d){return!g&&(d||c!==l)||((b=c).nodeType?j(a,c,d):k(a,c,d))}];for(;i1&&bj(m),i>1&&a.slice(0,i-1).join("").replace(L,"$1"),c,i0,f=a.length>0,g=function(h,i,j,k,m){var n,o,p,q=[],s=0,u="0",x=h&&[],y=m!=null,z=l,A=h||f&&e.find.TAG("*",m&&i.parentNode||i),B=t+=z==null?1:Math.E;y&&(l=i!==r&&i,c=g.el);for(;(n=A[u])!=null;u++){if(f&&n){for(o=0;p=a[o];o++)if(p(n,i,j)){k.push(n);break}y&&(t=B,c=++g.el)}d&&((n=!p&&n)&&s--,h&&x.push(n))}s+=u;if(d&&u!==s){for(o=0;p=b[o];o++)p(x,q,i,j);if(h){if(s>0)while(u--)!x[u]&&!q[u]&&(q[u]=v.call(k));q=bk(q)}w.apply(k,q),y&&!h&&q.length>0&&s+b.length>1&&bc.uniqueSort(k)}return y&&(t=B,l=z),x};return g.el=0,d?z(g):g}function bo(a,b,c,d){var e=0,f=b.length;for(;e2&&(j=h[0]).type==="ID"&&b.nodeType===9&&!f&&e.relative[h[1].type]){b=e.find.ID(j.matches[0].replace(V,""),b,f)[0];if(!b)return c;a=a.slice(h.shift().length)}for(g=W.POS.test(a)?-1:h.length-1;g>=0;g--){j=h[g];if(e.relative[k=j.type])break;if(l=e.find[k])if(d=l(j.matches[0].replace(V,""),R.test(h[0].type)&&b.parentNode||b,f)){h.splice(g,1),a=d.length&&h.join("");if(!a)return w.apply(c,x.call(d,0)),c;break}}}return i(a,m)(d,b,f,c,R.test(a)),c}function bq(){}var c,d,e,f,g,h,i,j,k,l,m=!0,n="undefined",o=("sizcache"+Math.random()).replace(".",""),q=String,r=a.document,s=r.documentElement,t=0,u=0,v=[].pop,w=[].push,x=[].slice,y=[].indexOf||function(a){var b=0,c=this.length;for(;be.cacheLength&&delete a[b.shift()],a[c]=d},a)},B=A(),C=A(),D=A(),E="[\\x20\\t\\r\\n\\f]",F="(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",G=F.replace("w","w#"),H="([*^$|!~]?=)",I="\\["+E+"*("+F+")"+E+"*(?:"+H+E+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+G+")|)|)"+E+"*\\]",J=":("+F+")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|([^()[\\]]*|(?:(?:"+I+")|[^:]|\\\\.)*|.*))\\)|)",K=":(even|odd|eq|gt|lt|nth|first|last)(?:\\("+E+"*((?:-\\d)?\\d*)"+E+"*\\)|)(?=[^-]|$)",L=new RegExp("^"+E+"+|((?:^|[^\\\\])(?:\\\\.)*)"+E+"+$","g"),M=new RegExp("^"+E+"*,"+E+"*"),N=new RegExp("^"+E+"*([\\x20\\t\\r\\n\\f>+~])"+E+"*"),O=new RegExp(J),P=/^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,Q=/^:not/,R=/[\x20\t\r\n\f]*[+~]/,S=/:not\($/,T=/h\d/i,U=/input|select|textarea|button/i,V=/\\(?!\\)/g,W={ID:new RegExp("^#("+F+")"),CLASS:new RegExp("^\\.("+F+")"),NAME:new RegExp("^\\[name=['\"]?("+F+")['\"]?\\]"),TAG:new RegExp("^("+F.replace("w","w*")+")"),ATTR:new RegExp("^"+I),PSEUDO:new RegExp("^"+J),POS:new RegExp(K,"i"),CHILD:new RegExp("^:(only|nth|first|last)-child(?:\\("+E+"*(even|odd|(([+-]|)(\\d*)n|)"+E+"*(?:([+-]|)"+E+"*(\\d+)|))"+E+"*\\)|)","i"),needsContext:new RegExp("^"+E+"*[>+~]|"+K,"i")},X=function(a){var b=r.createElement("div");try{return a(b)}catch(c){return!1}finally{b=null}},Y=X(function(a){return a.appendChild(r.createComment("")),!a.getElementsByTagName("*").length}),Z=X(function(a){return a.innerHTML=" ",a.firstChild&&typeof a.firstChild.getAttribute!==n&&a.firstChild.getAttribute("href")==="#"}),$=X(function(a){a.innerHTML=" ";var b=typeof a.lastChild.getAttribute("multiple");return b!=="boolean"&&b!=="string"}),_=X(function(a){return a.innerHTML="
",!a.getElementsByClassName||!a.getElementsByClassName("e").length?!1:(a.lastChild.className="e",a.getElementsByClassName("e").length===2)}),ba=X(function(a){a.id=o+0,a.innerHTML="
",s.insertBefore(a,s.firstChild);var b=r.getElementsByName&&r.getElementsByName(o).length===2+r.getElementsByName(o+0).length;return d=!r.getElementById(o),s.removeChild(a),b});try{x.call(s.childNodes,0)[0].nodeType}catch(bb){x=function(a){var b,c=[];for(;b=this[a];a++)c.push(b);return c}}bc.matches=function(a,b){return bc(a,null,null,b)},bc.matchesSelector=function(a,b){return bc(b,null,null,[a]).length>0},f=bc.getText=function(a){var b,c="",d=0,e=a.nodeType;if(e){if(e===1||e===9||e===11){if(typeof a.textContent=="string")return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=f(a)}else if(e===3||e===4)return a.nodeValue}else for(;b=a[d];d++)c+=f(b);return c},g=bc.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?b.nodeName!=="HTML":!1},h=bc.contains=s.contains?function(a,b){var c=a.nodeType===9?a.documentElement:a,d=b&&b.parentNode;return a===d||!!(d&&d.nodeType===1&&c.contains&&c.contains(d))}:s.compareDocumentPosition?function(a,b){return b&&!!(a.compareDocumentPosition(b)&16)}:function(a,b){while(b=b.parentNode)if(b===a)return!0;return!1},bc.attr=function(a,b){var c,d=g(a);return d||(b=b.toLowerCase()),(c=e.attrHandle[b])?c(a):d||$?a.getAttribute(b):(c=a.getAttributeNode(b),c?typeof a[b]=="boolean"?a[b]?b:null:c.specified?c.value:null:null)},e=bc.selectors={cacheLength:50,createPseudo:z,match:W,attrHandle:Z?{}:{href:function(a){return a.getAttribute("href",2)},type:function(a){return a.getAttribute("type")}},find:{ID:d?function(a,b,c){if(typeof b.getElementById!==n&&!c){var d=b.getElementById(a);return d&&d.parentNode?[d]:[]}}:function(a,c,d){if(typeof c.getElementById!==n&&!d){var e=c.getElementById(a);return e?e.id===a||typeof e.getAttributeNode!==n&&e.getAttributeNode("id").value===a?[e]:b:[]}},TAG:Y?function(a,b){if(typeof b.getElementsByTagName!==n)return b.getElementsByTagName(a)}:function(a,b){var c=b.getElementsByTagName(a);if(a==="*"){var d,e=[],f=0;for(;d=c[f];f++)d.nodeType===1&&e.push(d);return e}return c},NAME:ba&&function(a,b){if(typeof b.getElementsByName!==n)return b.getElementsByName(name)},CLASS:_&&function(a,b,c){if(typeof b.getElementsByClassName!==n&&!c)return b.getElementsByClassName(a)}},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(V,""),a[3]=(a[4]||a[5]||"").replace(V,""),a[2]==="~="&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),a[1]==="nth"?(a[2]||bc.error(a[0]),a[3]=+(a[3]?a[4]+(a[5]||1):2*(a[2]==="even"||a[2]==="odd")),a[4]=+(a[6]+a[7]||a[2]==="odd")):a[2]&&bc.error(a[0]),a},PSEUDO:function(a){var b,c;if(W.CHILD.test(a[0]))return null;if(a[3])a[2]=a[3];else if(b=a[4])O.test(b)&&(c=bh(b,!0))&&(c=b.indexOf(")",b.length-c)-b.length)&&(b=b.slice(0,c),a[0]=a[0].slice(0,c)),a[2]=b;return a.slice(0,3)}},filter:{ID:d?function(a){return a=a.replace(V,""),function(b){return b.getAttribute("id")===a}}:function(a){return a=a.replace(V,""),function(b){var c=typeof b.getAttributeNode!==n&&b.getAttributeNode("id");return c&&c.value===a}},TAG:function(a){return a==="*"?function(){return!0}:(a=a.replace(V,"").toLowerCase(),function(b){return b.nodeName&&b.nodeName.toLowerCase()===a})},CLASS:function(a){var b=B[o][a];return b||(b=B(a,new RegExp("(^|"+E+")"+a+"("+E+"|$)"))),function(a){return b.test(a.className||typeof a.getAttribute!==n&&a.getAttribute("class")||"")}},ATTR:function(a,b,c){return function(d,e){var f=bc.attr(d,a);return f==null?b==="!=":b?(f+="",b==="="?f===c:b==="!="?f!==c:b==="^="?c&&f.indexOf(c)===0:b==="*="?c&&f.indexOf(c)>-1:b==="$="?c&&f.substr(f.length-c.length)===c:b==="~="?(" "+f+" ").indexOf(c)>-1:b==="|="?f===c||f.substr(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d){return a==="nth"?function(a){var b,e,f=a.parentNode;if(c===1&&d===0)return!0;if(f){e=0;for(b=f.firstChild;b;b=b.nextSibling)if(b.nodeType===1){e++;if(a===b)break}}return e-=d,e===c||e%c===0&&e/c>=0}:function(b){var c=b;switch(a){case"only":case"first":while(c=c.previousSibling)if(c.nodeType===1)return!1;if(a==="first")return!0;c=b;case"last":while(c=c.nextSibling)if(c.nodeType===1)return!1;return!0}}},PSEUDO:function(a,b){var c,d=e.pseudos[a]||e.setFilters[a.toLowerCase()]||bc.error("unsupported pseudo: "+a);return d[o]?d(b):d.length>1?(c=[a,a,"",b],e.setFilters.hasOwnProperty(a.toLowerCase())?z(function(a,c){var e,f=d(a,b),g=f.length;while(g--)e=y.call(a,f[g]),a[e]=!(c[e]=f[g])}):function(a){return d(a,0,c)}):d}},pseudos:{not:z(function(a){var b=[],c=[],d=i(a.replace(L,"$1"));return d[o]?z(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)if(f=g[h])a[h]=!(b[h]=f)}):function(a,e,f){return b[0]=a,d(b,null,f,c),!c.pop()}}),has:z(function(a){return function(b){return bc(a,b).length>0}}),contains:z(function(a){return function(b){return(b.textContent||b.innerText||f(b)).indexOf(a)>-1}}),enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&!!a.checked||b==="option"&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},parent:function(a){return!e.pseudos.empty(a)},empty:function(a){var b;a=a.firstChild;while(a){if(a.nodeName>"@"||(b=a.nodeType)===3||b===4)return!1;a=a.nextSibling}return!0},header:function(a){return T.test(a.nodeName)},text:function(a){var b,c;return a.nodeName.toLowerCase()==="input"&&(b=a.type)==="text"&&((c=a.getAttribute("type"))==null||c.toLowerCase()===b)},radio:bd("radio"),checkbox:bd("checkbox"),file:bd("file"),password:bd("password"),image:bd("image"),submit:be("submit"),reset:be("reset"),button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&a.type==="button"||b==="button"},input:function(a){return U.test(a.nodeName)},focus:function(a){var b=a.ownerDocument;return a===b.activeElement&&(!b.hasFocus||b.hasFocus())&&(!!a.type||!!a.href)},active:function(a){return a===a.ownerDocument.activeElement},first:bf(function(a,b,c){return[0]}),last:bf(function(a,b,c){return[b-1]}),eq:bf(function(a,b,c){return[c<0?c+b:c]}),even:bf(function(a,b,c){for(var d=0;d=0;)a.push(d);return a}),gt:bf(function(a,b,c){for(var d=c<0?c+b:c;++d ",a.querySelectorAll("[selected]").length||e.push("\\["+E+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),a.querySelectorAll(":checked").length||e.push(":checked")}),X(function(a){a.innerHTML="
",a.querySelectorAll("[test^='']").length&&e.push("[*^$]="+E+"*(?:\"\"|'')"),a.innerHTML=" ",a.querySelectorAll(":enabled").length||e.push(":enabled",":disabled")}),e=new RegExp(e.join("|")),bp=function(a,d,f,g,h){if(!g&&!h&&(!e||!e.test(a))){var i,j,k=!0,l=o,m=d,n=d.nodeType===9&&a;if(d.nodeType===1&&d.nodeName.toLowerCase()!=="object"){i=bh(a),(k=d.getAttribute("id"))?l=k.replace(c,"\\$&"):d.setAttribute("id",l),l="[id='"+l+"'] ",j=i.length;while(j--)i[j]=l+i[j].join("");m=R.test(a)&&d.parentNode||d,n=i.join(",")}if(n)try{return w.apply(f,x.call(m.querySelectorAll(n),0)),f}catch(p){}finally{k||d.removeAttribute("id")}}return b(a,d,f,g,h)},h&&(X(function(b){a=h.call(b,"div");try{h.call(b,"[test!='']:sizzle"),f.push("!=",J)}catch(c){}}),f=new RegExp(f.join("|")),bc.matchesSelector=function(b,c){c=c.replace(d,"='$1']");if(!g(b)&&!f.test(c)&&(!e||!e.test(c)))try{var i=h.call(b,c);if(i||a||b.document&&b.document.nodeType!==11)return i}catch(j){}return bc(c,null,null,[b]).length>0})}(),e.pseudos.nth=e.pseudos.eq,e.filters=bq.prototype=e.pseudos,e.setFilters=new bq,bc.attr=p.attr,p.find=bc,p.expr=bc.selectors,p.expr[":"]=p.expr.pseudos,p.unique=bc.uniqueSort,p.text=bc.getText,p.isXMLDoc=bc.isXML,p.contains=bc.contains}(a);var bc=/Until$/,bd=/^(?:parents|prev(?:Until|All))/,be=/^.[^:#\[\.,]*$/,bf=p.expr.match.needsContext,bg={children:!0,contents:!0,next:!0,prev:!0};p.fn.extend({find:function(a){var b,c,d,e,f,g,h=this;if(typeof a!="string")return p(a).filter(function(){for(b=0,c=h.length;b0)for(e=d;e=0:p.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c,d=0,e=this.length,f=[],g=bf.test(a)||typeof a!="string"?p(a,b||this.context):0;for(;d-1:p.find.matchesSelector(c,a)){f.push(c);break}c=c.parentNode}}return f=f.length>1?p.unique(f):f,this.pushStack(f,"closest",a)},index:function(a){return a?typeof a=="string"?p.inArray(this[0],p(a)):p.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.prevAll().length:-1},add:function(a,b){var c=typeof a=="string"?p(a,b):p.makeArray(a&&a.nodeType?[a]:a),d=p.merge(this.get(),c);return this.pushStack(bh(c[0])||bh(d[0])?d:p.unique(d))},addBack:function(a){return this.add(a==null?this.prevObject:this.prevObject.filter(a))}}),p.fn.andSelf=p.fn.addBack,p.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return p.dir(a,"parentNode")},parentsUntil:function(a,b,c){return p.dir(a,"parentNode",c)},next:function(a){return bi(a,"nextSibling")},prev:function(a){return bi(a,"previousSibling")},nextAll:function(a){return p.dir(a,"nextSibling")},prevAll:function(a){return p.dir(a,"previousSibling")},nextUntil:function(a,b,c){return p.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return p.dir(a,"previousSibling",c)},siblings:function(a){return p.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return p.sibling(a.firstChild)},contents:function(a){return p.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:p.merge([],a.childNodes)}},function(a,b){p.fn[a]=function(c,d){var e=p.map(this,b,c);return bc.test(a)||(d=c),d&&typeof d=="string"&&(e=p.filter(d,e)),e=this.length>1&&!bg[a]?p.unique(e):e,this.length>1&&bd.test(a)&&(e=e.reverse()),this.pushStack(e,a,k.call(arguments).join(","))}}),p.extend({filter:function(a,b,c){return c&&(a=":not("+a+")"),b.length===1?p.find.matchesSelector(b[0],a)?[b[0]]:[]:p.find.matches(a,b)},dir:function(a,c,d){var e=[],f=a[c];while(f&&f.nodeType!==9&&(d===b||f.nodeType!==1||!p(f).is(d)))f.nodeType===1&&e.push(f),f=f[c];return e},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var bl="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",bm=/ jQuery\d+="(?:null|\d+)"/g,bn=/^\s+/,bo=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,bp=/<([\w:]+)/,bq=/<(?:"+bl+")[\\s/>]","i"),bv=/^(?:checkbox|radio)$/,bw=/checked\s*(?:[^=]|=\s*.checked.)/i,bx=/\/(java|ecma)script/i,by=/^\s*\s*$/g,bz={option:[1,""," "],legend:[1,""," "],thead:[1,""],tr:[2,""],td:[3,""],col:[2,""],area:[1,""," "],_default:[0,"",""]},bA=bk(e),bB=bA.appendChild(e.createElement("div"));bz.optgroup=bz.option,bz.tbody=bz.tfoot=bz.colgroup=bz.caption=bz.thead,bz.th=bz.td,p.support.htmlSerialize||(bz._default=[1,"X","
"]),p.fn.extend({text:function(a){return p.access(this,function(a){return a===b?p.text(this):this.empty().append((this[0]&&this[0].ownerDocument||e).createTextNode(a))},null,a,arguments.length)},wrapAll:function(a){if(p.isFunction(a))return this.each(function(b){p(this).wrapAll(a.call(this,b))});if(this[0]){var b=p(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){return p.isFunction(a)?this.each(function(b){p(this).wrapInner(a.call(this,b))}):this.each(function(){var b=p(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=p.isFunction(a);return this.each(function(c){p(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){p.nodeName(this,"body")||p(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){(this.nodeType===1||this.nodeType===11)&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){(this.nodeType===1||this.nodeType===11)&&this.insertBefore(a,this.firstChild)})},before:function(){if(!bh(this[0]))return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=p.clean(arguments);return this.pushStack(p.merge(a,this),"before",this.selector)}},after:function(){if(!bh(this[0]))return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=p.clean(arguments);return this.pushStack(p.merge(this,a),"after",this.selector)}},remove:function(a,b){var c,d=0;for(;(c=this[d])!=null;d++)if(!a||p.filter(a,[c]).length)!b&&c.nodeType===1&&(p.cleanData(c.getElementsByTagName("*")),p.cleanData([c])),c.parentNode&&c.parentNode.removeChild(c);return this},empty:function(){var a,b=0;for(;(a=this[b])!=null;b++){a.nodeType===1&&p.cleanData(a.getElementsByTagName("*"));while(a.firstChild)a.removeChild(a.firstChild)}return this},clone:function(a,b){return a=a==null?!1:a,b=b==null?a:b,this.map(function(){return p.clone(this,a,b)})},html:function(a){return p.access(this,function(a){var c=this[0]||{},d=0,e=this.length;if(a===b)return c.nodeType===1?c.innerHTML.replace(bm,""):b;if(typeof a=="string"&&!bs.test(a)&&(p.support.htmlSerialize||!bu.test(a))&&(p.support.leadingWhitespace||!bn.test(a))&&!bz[(bp.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(bo,"<$1>$2>");try{for(;d1&&typeof j=="string"&&bw.test(j))return this.each(function(){p(this).domManip(a,c,d)});if(p.isFunction(j))return this.each(function(e){var f=p(this);a[0]=j.call(this,e,c?f.html():b),f.domManip(a,c,d)});if(this[0]){e=p.buildFragment(a,this,k),g=e.fragment,f=g.firstChild,g.childNodes.length===1&&(g=f);if(f){c=c&&p.nodeName(f,"tr");for(h=e.cacheable||l-1;i0?this.clone(!0):this).get(),p(g[e])[b](d),f=f.concat(d);return this.pushStack(f,a,g.selector)}}),p.extend({clone:function(a,b,c){var d,e,f,g;p.support.html5Clone||p.isXMLDoc(a)||!bu.test("<"+a.nodeName+">")?g=a.cloneNode(!0):(bB.innerHTML=a.outerHTML,bB.removeChild(g=bB.firstChild));if((!p.support.noCloneEvent||!p.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!p.isXMLDoc(a)){bE(a,g),d=bF(a),e=bF(g);for(f=0;d[f];++f)e[f]&&bE(d[f],e[f])}if(b){bD(a,g);if(c){d=bF(a),e=bF(g);for(f=0;d[f];++f)bD(d[f],e[f])}}return d=e=null,g},clean:function(a,b,c,d){var f,g,h,i,j,k,l,m,n,o,q,r,s=b===e&&bA,t=[];if(!b||typeof b.createDocumentFragment=="undefined")b=e;for(f=0;(h=a[f])!=null;f++){typeof h=="number"&&(h+="");if(!h)continue;if(typeof h=="string")if(!br.test(h))h=b.createTextNode(h);else{s=s||bk(b),l=b.createElement("div"),s.appendChild(l),h=h.replace(bo,"<$1>$2>"),i=(bp.exec(h)||["",""])[1].toLowerCase(),j=bz[i]||bz._default,k=j[0],l.innerHTML=j[1]+h+j[2];while(k--)l=l.lastChild;if(!p.support.tbody){m=bq.test(h),n=i==="table"&&!m?l.firstChild&&l.firstChild.childNodes:j[1]===""&&!m?l.childNodes:[];for(g=n.length-1;g>=0;--g)p.nodeName(n[g],"tbody")&&!n[g].childNodes.length&&n[g].parentNode.removeChild(n[g])}!p.support.leadingWhitespace&&bn.test(h)&&l.insertBefore(b.createTextNode(bn.exec(h)[0]),l.firstChild),h=l.childNodes,l.parentNode.removeChild(l)}h.nodeType?t.push(h):p.merge(t,h)}l&&(h=l=s=null);if(!p.support.appendChecked)for(f=0;(h=t[f])!=null;f++)p.nodeName(h,"input")?bG(h):typeof h.getElementsByTagName!="undefined"&&p.grep(h.getElementsByTagName("input"),bG);if(c){q=function(a){if(!a.type||bx.test(a.type))return d?d.push(a.parentNode?a.parentNode.removeChild(a):a):c.appendChild(a)};for(f=0;(h=t[f])!=null;f++)if(!p.nodeName(h,"script")||!q(h))c.appendChild(h),typeof h.getElementsByTagName!="undefined"&&(r=p.grep(p.merge([],h.getElementsByTagName("script")),q),t.splice.apply(t,[f+1,0].concat(r)),f+=r.length)}return t},cleanData:function(a,b){var c,d,e,f,g=0,h=p.expando,i=p.cache,j=p.support.deleteExpando,k=p.event.special;for(;(e=a[g])!=null;g++)if(b||p.acceptData(e)){d=e[h],c=d&&i[d];if(c){if(c.events)for(f in c.events)k[f]?p.event.remove(e,f):p.removeEvent(e,f,c.handle);i[d]&&(delete i[d],j?delete e[h]:e.removeAttribute?e.removeAttribute(h):e[h]=null,p.deletedIds.push(d))}}}}),function(){var a,b;p.uaMatch=function(a){a=a.toLowerCase();var b=/(chrome)[ \/]([\w.]+)/.exec(a)||/(webkit)[ \/]([\w.]+)/.exec(a)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(a)||/(msie) ([\w.]+)/.exec(a)||a.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},a=p.uaMatch(g.userAgent),b={},a.browser&&(b[a.browser]=!0,b.version=a.version),b.chrome?b.webkit=!0:b.webkit&&(b.safari=!0),p.browser=b,p.sub=function(){function a(b,c){return new a.fn.init(b,c)}p.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.sub=this.sub,a.fn.init=function c(c,d){return d&&d instanceof p&&!(d instanceof a)&&(d=a(d)),p.fn.init.call(this,c,d,b)},a.fn.init.prototype=a.fn;var b=a(e);return a}}();var bH,bI,bJ,bK=/alpha\([^)]*\)/i,bL=/opacity=([^)]*)/,bM=/^(top|right|bottom|left)$/,bN=/^(none|table(?!-c[ea]).+)/,bO=/^margin/,bP=new RegExp("^("+q+")(.*)$","i"),bQ=new RegExp("^("+q+")(?!px)[a-z%]+$","i"),bR=new RegExp("^([-+])=("+q+")","i"),bS={},bT={position:"absolute",visibility:"hidden",display:"block"},bU={letterSpacing:0,fontWeight:400},bV=["Top","Right","Bottom","Left"],bW=["Webkit","O","Moz","ms"],bX=p.fn.toggle;p.fn.extend({css:function(a,c){return p.access(this,function(a,c,d){return d!==b?p.style(a,c,d):p.css(a,c)},a,c,arguments.length>1)},show:function(){return b$(this,!0)},hide:function(){return b$(this)},toggle:function(a,b){var c=typeof a=="boolean";return p.isFunction(a)&&p.isFunction(b)?bX.apply(this,arguments):this.each(function(){(c?a:bZ(this))?p(this).show():p(this).hide()})}}),p.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=bH(a,"opacity");return c===""?"1":c}}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":p.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!a||a.nodeType===3||a.nodeType===8||!a.style)return;var f,g,h,i=p.camelCase(c),j=a.style;c=p.cssProps[i]||(p.cssProps[i]=bY(j,i)),h=p.cssHooks[c]||p.cssHooks[i];if(d===b)return h&&"get"in h&&(f=h.get(a,!1,e))!==b?f:j[c];g=typeof d,g==="string"&&(f=bR.exec(d))&&(d=(f[1]+1)*f[2]+parseFloat(p.css(a,c)),g="number");if(d==null||g==="number"&&isNaN(d))return;g==="number"&&!p.cssNumber[i]&&(d+="px");if(!h||!("set"in h)||(d=h.set(a,d,e))!==b)try{j[c]=d}catch(k){}},css:function(a,c,d,e){var f,g,h,i=p.camelCase(c);return c=p.cssProps[i]||(p.cssProps[i]=bY(a.style,i)),h=p.cssHooks[c]||p.cssHooks[i],h&&"get"in h&&(f=h.get(a,!0,e)),f===b&&(f=bH(a,c)),f==="normal"&&c in bU&&(f=bU[c]),d||e!==b?(g=parseFloat(f),d||p.isNumeric(g)?g||0:f):f},swap:function(a,b,c){var d,e,f={};for(e in b)f[e]=a.style[e],a.style[e]=b[e];d=c.call(a);for(e in b)a.style[e]=f[e];return d}}),a.getComputedStyle?bH=function(b,c){var d,e,f,g,h=a.getComputedStyle(b,null),i=b.style;return h&&(d=h[c],d===""&&!p.contains(b.ownerDocument,b)&&(d=p.style(b,c)),bQ.test(d)&&bO.test(c)&&(e=i.width,f=i.minWidth,g=i.maxWidth,i.minWidth=i.maxWidth=i.width=d,d=h.width,i.width=e,i.minWidth=f,i.maxWidth=g)),d}:e.documentElement.currentStyle&&(bH=function(a,b){var c,d,e=a.currentStyle&&a.currentStyle[b],f=a.style;return e==null&&f&&f[b]&&(e=f[b]),bQ.test(e)&&!bM.test(b)&&(c=f.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),f.left=b==="fontSize"?"1em":e,e=f.pixelLeft+"px",f.left=c,d&&(a.runtimeStyle.left=d)),e===""?"auto":e}),p.each(["height","width"],function(a,b){p.cssHooks[b]={get:function(a,c,d){if(c)return a.offsetWidth===0&&bN.test(bH(a,"display"))?p.swap(a,bT,function(){return cb(a,b,d)}):cb(a,b,d)},set:function(a,c,d){return b_(a,c,d?ca(a,b,d,p.support.boxSizing&&p.css(a,"boxSizing")==="border-box"):0)}}}),p.support.opacity||(p.cssHooks.opacity={get:function(a,b){return bL.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=p.isNumeric(b)?"alpha(opacity="+b*100+")":"",f=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&p.trim(f.replace(bK,""))===""&&c.removeAttribute){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bK.test(f)?f.replace(bK,e):f+" "+e}}),p(function(){p.support.reliableMarginRight||(p.cssHooks.marginRight={get:function(a,b){return p.swap(a,{display:"inline-block"},function(){if(b)return bH(a,"marginRight")})}}),!p.support.pixelPosition&&p.fn.position&&p.each(["top","left"],function(a,b){p.cssHooks[b]={get:function(a,c){if(c){var d=bH(a,b);return bQ.test(d)?p(a).position()[b]+"px":d}}}})}),p.expr&&p.expr.filters&&(p.expr.filters.hidden=function(a){return a.offsetWidth===0&&a.offsetHeight===0||!p.support.reliableHiddenOffsets&&(a.style&&a.style.display||bH(a,"display"))==="none"},p.expr.filters.visible=function(a){return!p.expr.filters.hidden(a)}),p.each({margin:"",padding:"",border:"Width"},function(a,b){p.cssHooks[a+b]={expand:function(c){var d,e=typeof c=="string"?c.split(" "):[c],f={};for(d=0;d<4;d++)f[a+bV[d]+b]=e[d]||e[d-2]||e[0];return f}},bO.test(a)||(p.cssHooks[a+b].set=b_)});var cd=/%20/g,ce=/\[\]$/,cf=/\r?\n/g,cg=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,ch=/^(?:select|textarea)/i;p.fn.extend({serialize:function(){return p.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?p.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||ch.test(this.nodeName)||cg.test(this.type))}).map(function(a,b){var c=p(this).val();return c==null?null:p.isArray(c)?p.map(c,function(a,c){return{name:b.name,value:a.replace(cf,"\r\n")}}):{name:b.name,value:c.replace(cf,"\r\n")}}).get()}}),p.param=function(a,c){var d,e=[],f=function(a,b){b=p.isFunction(b)?b():b==null?"":b,e[e.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=p.ajaxSettings&&p.ajaxSettings.traditional);if(p.isArray(a)||a.jquery&&!p.isPlainObject(a))p.each(a,function(){f(this.name,this.value)});else for(d in a)ci(d,a[d],c,f);return e.join("&").replace(cd,"+")};var cj,ck,cl=/#.*$/,cm=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,cn=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,co=/^(?:GET|HEAD)$/,cp=/^\/\//,cq=/\?/,cr=/
-
-
-
+
+
diff --git a/src/jquery.autocomplete.d.ts b/src/jquery.autocomplete.d.ts
deleted file mode 100644
index 83b09476..00000000
--- a/src/jquery.autocomplete.d.ts
+++ /dev/null
@@ -1,40 +0,0 @@
-
-interface JQueryAutocompleteOptions {
- serviceUrl?: string;
- lookup?: AutocompleteSuggestion[];
- lookupFilter? (suggestion: AutocompleteSuggestion, query: string, queryLowercase: string): any;
- onSelect? (suggestion: AutocompleteSuggestion): void;
- minChars: number;
- maxHeight: number;
- deferRequestBy?: number;
- width?: number;
- params?: Object;
- formatResult? (suggestion: AutocompleteSuggestion, currentValue: string): string;
- delimiter?: any;
- zIndex?: number;
- type?: string;
- noCache?: bool;
- onSearchStart? (query: string): void;
- onSearchComplete? (query: string): void;
- tabDisabled?: bool;
- paramName?: string;
- transformResult? (response: any, originalQuery: string): AutocompleteSuggestion[];
- autoSelectFirst?: bool;
- appendTo: any;
- dataType: string;
-}
-
-interface AutocompleteSuggestion {
- value: string;
- data: any;
-}
-
-interface AutocompleteInstance {
- setOptions(options: JQueryAutocompleteOptions): void;
- clear(): void;
- clearCache(): void;
- disable(): void;
- enable(): void;
- hide(): void;
- dispose(): void;
-}
diff --git a/src/jquery.autocomplete.js b/src/jquery.autocomplete.js
index c4864db9..0328168d 100644
--- a/src/jquery.autocomplete.js
+++ b/src/jquery.autocomplete.js
@@ -1,955 +1,1045 @@
/**
-* Ajax Autocomplete for jQuery, version %version%
-* (c) 2014 Tomas Kirda
-*
-* Ajax Autocomplete for jQuery is freely distributable under the terms of an MIT-style license.
-* For details, see the web site: https://github.com/devbridge/jQuery-Autocomplete
-*/
-
-/*jslint browser: true, white: true, plusplus: true */
-/*global define, window, document, jQuery, exports */
+ * Ajax Autocomplete for jQuery, version %version%
+ * (c) 2017 Tomas Kirda
+ *
+ * Ajax Autocomplete for jQuery is freely distributable under the terms of an MIT-style license.
+ * For details, see the web site: https://github.com/devbridge/jQuery-Autocomplete
+ */
// Expose plugin as an AMD module if AMD loader is present:
(function (factory) {
- 'use strict';
- if (typeof define === 'function' && define.amd) {
+ "use strict";
+ if (typeof define === "function" && define.amd) {
// AMD. Register as an anonymous module.
- define(['jquery'], factory);
- } else if (typeof exports === 'object' && typeof require === 'function') {
+ define(["jquery"], factory);
+ } else if (typeof exports === "object" && typeof require === "function") {
// Browserify
- factory(require('jquery'));
+ factory(require("jquery"));
} else {
// Browser globals
factory(jQuery);
}
-}(function ($) {
- 'use strict';
-
- var
- utils = (function () {
- return {
+})(
+ /**
+ * @param {jQuery} $
+ */
+ function ($) {
+ "use strict";
+
+ var utils = {
escapeRegExChars: function (value) {
- return value.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
+ return value.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&");
},
createNode: function (containerClass) {
- var div = document.createElement('div');
+ var div = document.createElement("div");
div.className = containerClass;
- div.style.position = 'absolute';
- div.style.display = 'none';
+ div.style.position = "absolute";
+ div.style.display = "none";
return div;
- }
- };
- }()),
-
- keys = {
- ESC: 27,
- TAB: 9,
- RETURN: 13,
- LEFT: 37,
- UP: 38,
- RIGHT: 39,
- DOWN: 40
- };
-
- function Autocomplete(el, options) {
- var noop = function () { },
- that = this,
- defaults = {
- ajaxSettings: {},
- autoSelectFirst: false,
- appendTo: document.body,
- serviceUrl: null,
- lookup: null,
- onSelect: null,
- width: 'auto',
- minChars: 1,
- maxHeight: 300,
- deferRequestBy: 0,
- params: {},
- formatResult: Autocomplete.formatResult,
- delimiter: null,
- zIndex: 9999,
- type: 'GET',
- noCache: false,
- onSearchStart: noop,
- onSearchComplete: noop,
- onSearchError: noop,
- containerClass: 'autocomplete-suggestions',
- tabDisabled: false,
- dataType: 'text',
- currentRequest: null,
- triggerSelectOnValidInput: true,
- preventBadQueries: true,
- lookupFilter: function (suggestion, originalQuery, queryLowerCase) {
- return suggestion.value.toLowerCase().indexOf(queryLowerCase) !== -1;
- },
- paramName: 'query',
- transformResult: function (response) {
- return typeof response === 'string' ? $.parseJSON(response) : response;
},
- showNoSuggestionNotice: false,
- noSuggestionNotice: 'No results',
- orientation: 'bottom',
- forceFixPosition: false
+ },
+ keys = { ESC: 27, TAB: 9, RETURN: 13, LEFT: 37, UP: 38, RIGHT: 39, DOWN: 40 },
+ noop = $.noop;
+
+ function Autocomplete(el, options) {
+ var that = this;
+
+ // Shared variables:
+ that.element = el;
+ that.el = $(el);
+ that.suggestions = [];
+ that.badQueries = [];
+ that.selectedIndex = -1;
+ that.currentValue = that.element.value;
+ that.timeoutId = null;
+ that.cachedResponse = {};
+ that.onChangeTimeout = null;
+ that.onChange = null;
+ that.isLocal = false;
+ that.suggestionsContainer = null;
+ that.noSuggestionsContainer = null;
+ that.options = $.extend(true, {}, Autocomplete.defaults, options);
+ that.classes = {
+ selected: "autocomplete-selected",
+ suggestion: "autocomplete-suggestion",
};
+ that.hint = null;
+ that.hintValue = "";
+ that.selection = null;
+
+ // Initialize and set options:
+ that.initialize();
+ that.setOptions(options);
+ }
- // Shared variables:
- that.element = el;
- that.el = $(el);
- that.suggestions = [];
- that.badQueries = [];
- that.selectedIndex = -1;
- that.currentValue = that.element.value;
- that.intervalId = 0;
- that.cachedResponse = {};
- that.onChangeInterval = null;
- that.onChange = null;
- that.isLocal = false;
- that.suggestionsContainer = null;
- that.noSuggestionsContainer = null;
- that.options = $.extend({}, defaults, options);
- that.classes = {
- selected: 'autocomplete-selected',
- suggestion: 'autocomplete-suggestion'
+ Autocomplete.utils = utils;
+
+ $.Autocomplete = Autocomplete;
+
+ Autocomplete.defaults = {
+ ajaxSettings: {},
+ autoSelectFirst: false,
+ appendTo: "body",
+ serviceUrl: null,
+ lookup: null,
+ onSelect: null,
+ onHint: null,
+ width: "auto",
+ minChars: 1,
+ maxHeight: 300,
+ deferRequestBy: 0,
+ params: {},
+ formatResult: _formatResult,
+ formatGroup: _formatGroup,
+ delimiter: null,
+ zIndex: 9999,
+ type: "GET",
+ noCache: false,
+ onSearchStart: noop,
+ onSearchComplete: noop,
+ onSearchError: noop,
+ preserveInput: false,
+ containerClass: "autocomplete-suggestions",
+ tabDisabled: false,
+ dataType: "text",
+ currentRequest: null,
+ triggerSelectOnValidInput: true,
+ preventBadQueries: true,
+ lookupFilter: _lookupFilter,
+ paramName: "query",
+ transformResult: _transformResult,
+ showNoSuggestionNotice: false,
+ noSuggestionNotice: "No results",
+ orientation: "bottom",
+ forceFixPosition: false,
};
- that.hint = null;
- that.hintValue = '';
- that.selection = null;
- // Initialize and set options:
- that.initialize();
- that.setOptions(options);
- }
+ function _lookupFilter(suggestion, originalQuery, queryLowerCase) {
+ return suggestion.value.toLowerCase().indexOf(queryLowerCase) !== -1;
+ }
- Autocomplete.utils = utils;
+ function _transformResult(response) {
+ return typeof response === "string" ? JSON.parse(response) : response;
+ }
- $.Autocomplete = Autocomplete;
+ function _formatResult(suggestion, currentValue) {
+ // Do not replace anything if the current value is empty
+ if (!currentValue) {
+ return suggestion.value;
+ }
+
+ var pattern = "(" + utils.escapeRegExChars(currentValue) + ")";
+
+ return suggestion.value
+ .replace(new RegExp(pattern, "gi"), "$1 ")
+ .replace(/&/g, "&")
+ .replace(//g, ">")
+ .replace(/"/g, """)
+ .replace(/<(\/?strong)>/g, "<$1>");
+ }
- Autocomplete.formatResult = function (suggestion, currentValue) {
- var pattern = '(' + utils.escapeRegExChars(currentValue) + ')';
+ function _formatGroup(suggestion, category) {
+ return '' + category + "
";
+ }
+
+ Autocomplete.prototype = {
+ initialize: function () {
+ var that = this,
+ suggestionSelector = "." + that.classes.suggestion,
+ selected = that.classes.selected,
+ options = that.options,
+ container;
- return suggestion.value.replace(new RegExp(pattern, 'gi'), '$1<\/strong>');
- };
+ that.element.setAttribute("autocomplete", "off");
- Autocomplete.prototype = {
+ // html() deals with many types: htmlString or Element or Array or jQuery
+ that.noSuggestionsContainer = $('
')
+ .html(this.options.noSuggestionNotice)
+ .get(0);
- killerFn: null,
+ that.suggestionsContainer = Autocomplete.utils.createNode(options.containerClass);
- initialize: function () {
- var that = this,
- suggestionSelector = '.' + that.classes.suggestion,
- selected = that.classes.selected,
- options = that.options,
- container;
+ container = $(that.suggestionsContainer);
- // Remove autocomplete attribute to prevent native suggestions:
- that.element.setAttribute('autocomplete', 'off');
+ container.appendTo(options.appendTo || "body");
- that.killerFn = function (e) {
- if ($(e.target).closest('.' + that.options.containerClass).length === 0) {
- that.killSuggestions();
- that.disableKillerFn();
+ // Only set width if it was provided:
+ if (options.width !== "auto") {
+ container.css("width", options.width);
}
- };
- // html() deals with many types: htmlString or Element or Array or jQuery
- that.noSuggestionsContainer = $('
')
- .html(this.options.noSuggestionNotice).get(0);
+ // Listen for mouse over event on suggestions list:
+ container.on("mouseover.autocomplete", suggestionSelector, function () {
+ that.activate($(this).data("index"));
+ });
- that.suggestionsContainer = Autocomplete.utils.createNode(options.containerClass);
+ // Deselect active element when mouse leaves suggestions container:
+ container.on("mouseout.autocomplete", function () {
+ that.selectedIndex = -1;
+ container.children("." + selected).removeClass(selected);
+ });
- container = $(that.suggestionsContainer);
+ // Listen for click event on suggestions list:
+ container.on("click.autocomplete", suggestionSelector, function () {
+ that.select($(this).data("index"));
+ });
- container.appendTo(options.appendTo);
+ container.on("click.autocomplete", function () {
+ clearTimeout(that.blurTimeoutId);
+ });
- // Only set width if it was provided:
- if (options.width !== 'auto') {
- container.width(options.width);
- }
+ that.fixPositionCapture = function () {
+ if (that.visible) {
+ that.fixPosition();
+ }
+ };
- // Listen for mouse over event on suggestions list:
- container.on('mouseover.autocomplete', suggestionSelector, function () {
- that.activate($(this).data('index'));
- });
+ $(window).on("resize.autocomplete", that.fixPositionCapture);
- // Deselect active element when mouse leaves suggestions container:
- container.on('mouseout.autocomplete', function () {
- that.selectedIndex = -1;
- container.children('.' + selected).removeClass(selected);
- });
+ that.el.on("keydown.autocomplete", function (e) {
+ that.onKeyPress(e);
+ });
+ that.el.on("keyup.autocomplete", function (e) {
+ that.onKeyUp(e);
+ });
+ that.el.on("blur.autocomplete", function () {
+ that.onBlur();
+ });
+ that.el.on("focus.autocomplete", function () {
+ that.onFocus();
+ });
+ that.el.on("change.autocomplete", function (e) {
+ that.onKeyUp(e);
+ });
+ that.el.on("input.autocomplete", function (e) {
+ that.onKeyUp(e);
+ });
+ },
- // Listen for click event on suggestions list:
- container.on('click.autocomplete', suggestionSelector, function () {
- that.select($(this).data('index'));
- });
+ onFocus: function () {
+ var that = this;
- that.fixPositionCapture = function () {
- if (that.visible) {
- that.fixPosition();
+ if (that.disabled) {
+ return;
}
- };
- $(window).on('resize.autocomplete', that.fixPositionCapture);
+ that.fixPosition();
- that.el.on('keydown.autocomplete', function (e) { that.onKeyPress(e); });
- that.el.on('keyup.autocomplete', function (e) { that.onKeyUp(e); });
- that.el.on('blur.autocomplete', function () { that.onBlur(); });
- that.el.on('focus.autocomplete', function () { that.onFocus(); });
- that.el.on('change.autocomplete', function (e) { that.onKeyUp(e); });
- },
-
- onFocus: function () {
- var that = this;
- that.fixPosition();
- if (that.options.minChars <= that.el.val().length) {
- that.onValueChange();
- }
- },
+ if (that.el.val().length >= that.options.minChars) {
+ that.onValueChange();
+ }
+ },
- onBlur: function () {
- this.enableKillerFn();
- },
+ onBlur: function () {
+ var that = this,
+ options = that.options,
+ value = that.el.val(),
+ query = that.getQuery(value);
- setOptions: function (suppliedOptions) {
- var that = this,
- options = that.options;
+ // If user clicked on a suggestion, hide() will
+ // be canceled, otherwise close suggestions
+ that.blurTimeoutId = setTimeout(function () {
+ that.hide();
- $.extend(options, suppliedOptions);
+ if (that.selection && that.currentValue !== query) {
+ (options.onInvalidateSelection || $.noop).call(that.element);
+ }
+ }, 200);
+ },
- that.isLocal = $.isArray(options.lookup);
+ abortAjax: function () {
+ var that = this;
+ if (that.currentRequest) {
+ that.currentRequest.abort();
+ that.currentRequest = null;
+ }
+ },
- if (that.isLocal) {
- options.lookup = that.verifySuggestionsFormat(options.lookup);
- }
+ setOptions: function (suppliedOptions) {
+ var that = this,
+ options = $.extend({}, that.options, suppliedOptions);
- options.orientation = that.validateOrientation(options.orientation, 'bottom');
+ that.isLocal = Array.isArray(options.lookup);
- // Adjust height, width and z-index:
- $(that.suggestionsContainer).css({
- 'max-height': options.maxHeight + 'px',
- 'width': options.width + 'px',
- 'z-index': options.zIndex
- });
- },
+ if (that.isLocal) {
+ options.lookup = that.verifySuggestionsFormat(options.lookup);
+ }
+ options.orientation = that.validateOrientation(options.orientation, "bottom");
- clearCache: function () {
- this.cachedResponse = {};
- this.badQueries = [];
- },
+ // Adjust height, width and z-index:
+ $(that.suggestionsContainer).css({
+ "max-height": options.maxHeight + "px",
+ width: options.width + "px",
+ "z-index": options.zIndex,
+ });
- clear: function () {
- this.clearCache();
- this.currentValue = '';
- this.suggestions = [];
- },
+ this.options = options;
+ },
+
+ clearCache: function () {
+ this.cachedResponse = {};
+ this.badQueries = [];
+ },
+
+ clear: function () {
+ this.clearCache();
+ this.currentValue = "";
+ this.suggestions = [];
+ },
+
+ disable: function () {
+ var that = this;
+ that.disabled = true;
+ clearTimeout(that.onChangeTimeout);
+ that.abortAjax();
+ },
+
+ enable: function () {
+ this.disabled = false;
+ },
+
+ fixPosition: function () {
+ // Use only when container has already its content
+
+ var that = this,
+ $container = $(that.suggestionsContainer),
+ containerParent = $container.parent().get(0);
+ // Fix position automatically when appended to body.
+ // In other cases force parameter must be given.
+ if (containerParent !== document.body && !that.options.forceFixPosition) {
+ return;
+ }
- disable: function () {
- var that = this;
- that.disabled = true;
- clearInterval(that.onChangeInterval);
- if (that.currentRequest) {
- that.currentRequest.abort();
- }
- },
-
- enable: function () {
- this.disabled = false;
- },
-
- fixPosition: function () {
- // Use only when container has already its content
-
- var that = this,
- $container = $(that.suggestionsContainer),
- containerParent = $container.parent().get(0);
- // Fix position automatically when appended to body.
- // In other cases force parameter must be given.
- if (containerParent !== document.body && !that.options.forceFixPosition)
- return;
-
- // Choose orientation
- var orientation = that.options.orientation,
- containerHeight = $container.outerHeight(),
- height = that.el.outerHeight(),
- offset = that.el.offset(),
- styles = { 'top': offset.top, 'left': offset.left };
-
- if (orientation == 'auto') {
- var viewPortHeight = $(window).height(),
- scrollTop = $(window).scrollTop(),
- topOverflow = -scrollTop + offset.top - containerHeight,
- bottomOverflow = scrollTop + viewPortHeight - (offset.top + height + containerHeight);
-
- orientation = (Math.max(topOverflow, bottomOverflow) === topOverflow)
- ? 'top'
- : 'bottom';
- }
+ // Choose orientation
+ var orientation = that.options.orientation,
+ containerHeight = $container.outerHeight(),
+ height = that.el.outerHeight(),
+ offset = that.el.offset(),
+ styles = { top: offset.top, left: offset.left };
+
+ if (orientation === "auto") {
+ var viewPortHeight = $(window).height(),
+ scrollTop = $(window).scrollTop(),
+ topOverflow = -scrollTop + offset.top - containerHeight,
+ bottomOverflow =
+ scrollTop + viewPortHeight - (offset.top + height + containerHeight);
+
+ orientation =
+ Math.max(topOverflow, bottomOverflow) === topOverflow ? "top" : "bottom";
+ }
- if (orientation === 'top') {
- styles.top += -containerHeight;
- } else {
- styles.top += height;
- }
+ if (orientation === "top") {
+ styles.top += -containerHeight;
+ } else {
+ styles.top += height;
+ }
- // If container is not positioned to body,
- // correct its position using offset parent offset
- if(containerParent !== document.body) {
- var opacity = $container.css('opacity'),
- parentOffsetDiff;
+ // If container is not positioned to body,
+ // correct its position using offset parent offset
+ if (containerParent !== document.body) {
+ var opacity = $container.css("opacity"),
+ parentOffsetDiff;
- if (!that.visible){
- $container.css('opacity', 0).show();
+ if (!that.visible) {
+ $container.css("opacity", 0).show();
}
- parentOffsetDiff = $container.offsetParent().offset();
- styles.top -= parentOffsetDiff.top;
- styles.left -= parentOffsetDiff.left;
+ parentOffsetDiff = $container.offsetParent().offset();
+ styles.top -= parentOffsetDiff.top;
+ styles.top += containerParent.scrollTop;
+ styles.left -= parentOffsetDiff.left;
- if (!that.visible){
- $container.css('opacity', opacity).hide();
+ if (!that.visible) {
+ $container.css("opacity", opacity).hide();
+ }
}
- }
- // -2px to account for suggestions border.
- if (that.options.width === 'auto') {
- styles.width = (that.el.outerWidth() - 2) + 'px';
- }
-
- $container.css(styles);
- },
+ if (that.options.width === "auto") {
+ styles.width = that.el.outerWidth() + "px";
+ }
- enableKillerFn: function () {
- var that = this;
- $(document).on('click.autocomplete', that.killerFn);
- },
+ $container.css(styles);
+ },
- disableKillerFn: function () {
- var that = this;
- $(document).off('click.autocomplete', that.killerFn);
- },
+ isCursorAtEnd: function () {
+ var that = this,
+ valLength = that.el.val().length,
+ selectionStart = that.element.selectionStart,
+ range;
- killSuggestions: function () {
- var that = this;
- that.stopKillSuggestions();
- that.intervalId = window.setInterval(function () {
- that.hide();
- that.stopKillSuggestions();
- }, 50);
- },
-
- stopKillSuggestions: function () {
- window.clearInterval(this.intervalId);
- },
-
- isCursorAtEnd: function () {
- var that = this,
- valLength = that.el.val().length,
- selectionStart = that.element.selectionStart,
- range;
-
- if (typeof selectionStart === 'number') {
- return selectionStart === valLength;
- }
- if (document.selection) {
- range = document.selection.createRange();
- range.moveStart('character', -valLength);
- return valLength === range.text.length;
- }
- return true;
- },
+ if (typeof selectionStart === "number") {
+ return selectionStart === valLength;
+ }
+ if (document.selection) {
+ range = document.selection.createRange();
+ range.moveStart("character", -valLength);
+ return valLength === range.text.length;
+ }
+ return true;
+ },
- onKeyPress: function (e) {
- var that = this;
+ onKeyPress: function (e) {
+ var that = this;
- // If suggestions are hidden and user presses arrow down, display suggestions:
- if (!that.disabled && !that.visible && e.which === keys.DOWN && that.currentValue) {
- that.suggest();
- return;
- }
-
- if (that.disabled || !that.visible) {
- return;
- }
+ // If suggestions are hidden and user presses arrow down, display suggestions:
+ if (!that.disabled && !that.visible && e.which === keys.DOWN && that.currentValue) {
+ that.suggest();
+ return;
+ }
- switch (e.which) {
- case keys.ESC:
- that.el.val(that.currentValue);
- that.hide();
- break;
- case keys.RIGHT:
- if (that.hint && that.options.onHint && that.isCursorAtEnd()) {
- that.selectHint();
- break;
- }
+ if (that.disabled || !that.visible) {
return;
- case keys.TAB:
- if (that.hint && that.options.onHint) {
- that.selectHint();
- return;
- }
- // Fall through to RETURN
- case keys.RETURN:
- if (that.selectedIndex === -1) {
+ }
+
+ switch (e.which) {
+ case keys.ESC:
+ that.el.val(that.currentValue);
that.hide();
+ break;
+ case keys.RIGHT:
+ if (that.hint && that.options.onHint && that.isCursorAtEnd()) {
+ that.selectHint();
+ break;
+ }
return;
- }
- that.select(that.selectedIndex);
- if (e.which === keys.TAB && that.options.tabDisabled === false) {
+ case keys.TAB:
+ if (that.hint && that.options.onHint) {
+ that.selectHint();
+ return;
+ }
+ if (that.selectedIndex === -1) {
+ that.hide();
+ return;
+ }
+ that.select(that.selectedIndex);
+ if (that.options.tabDisabled === false) {
+ return;
+ }
+ break;
+ case keys.RETURN:
+ if (that.selectedIndex === -1) {
+ that.hide();
+ return;
+ }
+ that.select(that.selectedIndex);
+ break;
+ case keys.UP:
+ that.moveUp();
+ break;
+ case keys.DOWN:
+ that.moveDown();
+ break;
+ default:
return;
- }
- break;
- case keys.UP:
- that.moveUp();
- break;
- case keys.DOWN:
- that.moveDown();
- break;
- default:
+ }
+
+ // Cancel event if function did not return:
+ e.stopImmediatePropagation();
+ e.preventDefault();
+ },
+
+ onKeyUp: function (e) {
+ var that = this;
+
+ if (that.disabled) {
return;
- }
+ }
- // Cancel event if function did not return:
- e.stopImmediatePropagation();
- e.preventDefault();
- },
+ switch (e.which) {
+ case keys.UP:
+ case keys.DOWN:
+ return;
+ }
- onKeyUp: function (e) {
- var that = this;
+ clearTimeout(that.onChangeTimeout);
- if (that.disabled) {
- return;
- }
+ if (that.currentValue !== that.el.val()) {
+ that.findBestHint();
+ if (that.options.deferRequestBy > 0) {
+ // Defer lookup in case when value changes very quickly:
+ that.onChangeTimeout = setTimeout(function () {
+ that.onValueChange();
+ }, that.options.deferRequestBy);
+ } else {
+ that.onValueChange();
+ }
+ }
+ },
- switch (e.which) {
- case keys.UP:
- case keys.DOWN:
+ onValueChange: function () {
+ if (this.ignoreValueChange) {
+ this.ignoreValueChange = false;
return;
- }
+ }
- clearInterval(that.onChangeInterval);
+ var that = this,
+ options = that.options,
+ value = that.el.val(),
+ query = that.getQuery(value);
- if (that.currentValue !== that.el.val()) {
- that.findBestHint();
- if (that.options.deferRequestBy > 0) {
- // Defer lookup in case when value changes very quickly:
- that.onChangeInterval = setInterval(function () {
- that.onValueChange();
- }, that.options.deferRequestBy);
- } else {
- that.onValueChange();
+ if (that.selection && that.currentValue !== query) {
+ that.selection = null;
+ (options.onInvalidateSelection || $.noop).call(that.element);
}
- }
- },
-
- onValueChange: function () {
- var that = this,
- options = that.options,
- value = that.el.val(),
- query = that.getQuery(value),
- index;
-
- if (that.selection && that.currentValue !== query) {
- that.selection = null;
- (options.onInvalidateSelection || $.noop).call(that.element);
- }
- clearInterval(that.onChangeInterval);
- that.currentValue = value;
- that.selectedIndex = -1;
+ clearTimeout(that.onChangeTimeout);
+ that.currentValue = value;
+ that.selectedIndex = -1;
- // Check existing suggestion for the match before proceeding:
- if (options.triggerSelectOnValidInput) {
- index = that.findSuggestionIndex(query);
- if (index !== -1) {
- that.select(index);
+ // Check existing suggestion for the match before proceeding:
+ if (options.triggerSelectOnValidInput && that.isExactMatch(query)) {
+ that.select(0);
return;
}
- }
- if (query.length < options.minChars) {
- that.hide();
- } else {
- that.getSuggestions(query);
- }
- },
+ if (query.length < options.minChars) {
+ that.hide();
+ } else {
+ that.getSuggestions(query);
+ }
+ },
- findSuggestionIndex: function (query) {
- var that = this,
- index = -1,
- queryLowerCase = query.toLowerCase();
+ isExactMatch: function (query) {
+ var suggestions = this.suggestions;
- $.each(that.suggestions, function (i, suggestion) {
- if (suggestion.value.toLowerCase() === queryLowerCase) {
- index = i;
- return false;
- }
- });
+ return (
+ suggestions.length === 1 &&
+ suggestions[0].value.toLowerCase() === query.toLowerCase()
+ );
+ },
- return index;
- },
+ getQuery: function (value) {
+ var delimiter = this.options.delimiter,
+ parts;
- getQuery: function (value) {
- var delimiter = this.options.delimiter,
- parts;
+ if (!delimiter) {
+ return value;
+ }
+ parts = value.split(delimiter);
+ return parts[parts.length - 1].trim();
+ },
+
+ getSuggestionsLocal: function (query) {
+ var that = this,
+ options = that.options,
+ queryLowerCase = query.toLowerCase(),
+ filter = options.lookupFilter,
+ limit = parseInt(options.lookupLimit, 10),
+ data;
+
+ data = {
+ suggestions: $.grep(options.lookup, function (suggestion) {
+ return filter(suggestion, query, queryLowerCase);
+ }),
+ };
- if (!delimiter) {
- return value;
- }
- parts = value.split(delimiter);
- return $.trim(parts[parts.length - 1]);
- },
-
- getSuggestionsLocal: function (query) {
- var that = this,
- options = that.options,
- queryLowerCase = query.toLowerCase(),
- filter = options.lookupFilter,
- limit = parseInt(options.lookupLimit, 10),
- data;
-
- data = {
- suggestions: $.grep(options.lookup, function (suggestion) {
- return filter(suggestion, query, queryLowerCase);
- })
- };
+ if (limit && data.suggestions.length > limit) {
+ data.suggestions = data.suggestions.slice(0, limit);
+ }
- if (limit && data.suggestions.length > limit) {
- data.suggestions = data.suggestions.slice(0, limit);
- }
+ return data;
+ },
- return data;
- },
+ getSuggestions: function (q) {
+ var response,
+ that = this,
+ options = that.options,
+ serviceUrl = options.serviceUrl,
+ params,
+ cacheKey,
+ ajaxSettings;
- getSuggestions: function (q) {
- var response,
- that = this,
- options = that.options,
- serviceUrl = options.serviceUrl,
- params,
- cacheKey,
- ajaxSettings;
+ options.params[options.paramName] = q;
- options.params[options.paramName] = q;
- params = options.ignoreParams ? null : options.params;
+ if (options.onSearchStart.call(that.element, options.params) === false) {
+ return;
+ }
- if (options.onSearchStart.call(that.element, options.params) === false) {
- return;
- }
+ params = options.ignoreParams ? null : options.params;
- if (that.isLocal) {
- response = that.getSuggestionsLocal(q);
- } else {
- if ($.isFunction(serviceUrl)) {
- serviceUrl = serviceUrl.call(that.element, q);
+ if (typeof options.lookup === "function") {
+ options.lookup(q, function (data) {
+ that.suggestions = data.suggestions;
+ that.suggest();
+ options.onSearchComplete.call(that.element, q, data.suggestions);
+ });
+ return;
}
- cacheKey = serviceUrl + '?' + $.param(params || {});
- response = that.cachedResponse[cacheKey];
- }
- if (response && $.isArray(response.suggestions)) {
- that.suggestions = response.suggestions;
- that.suggest();
- options.onSearchComplete.call(that.element, q, response.suggestions);
- } else if (!that.isBadQuery(q)) {
- if (that.currentRequest) {
- that.currentRequest.abort();
+ if (that.isLocal) {
+ response = that.getSuggestionsLocal(q);
+ } else {
+ if (typeof serviceUrl === "function") {
+ serviceUrl = serviceUrl.call(that.element, q);
+ }
+ cacheKey = serviceUrl + "?" + $.param(params || {});
+ response = that.cachedResponse[cacheKey];
}
- ajaxSettings = {
- url: serviceUrl,
- data: params,
- type: options.type,
- dataType: options.dataType
- };
+ if (response && Array.isArray(response.suggestions)) {
+ that.suggestions = response.suggestions;
+ that.suggest();
+ options.onSearchComplete.call(that.element, q, response.suggestions);
+ } else if (!that.isBadQuery(q)) {
+ that.abortAjax();
+
+ ajaxSettings = {
+ url: serviceUrl,
+ data: params,
+ type: options.type,
+ dataType: options.dataType,
+ };
+
+ $.extend(ajaxSettings, options.ajaxSettings);
+
+ that.currentRequest = $.ajax(ajaxSettings)
+ .done(function (data) {
+ var result;
+ that.currentRequest = null;
+ result = options.transformResult(data, q);
+ that.processResponse(result, q, cacheKey);
+ options.onSearchComplete.call(that.element, q, result.suggestions);
+ })
+ .fail(function (jqXHR, textStatus, errorThrown) {
+ options.onSearchError.call(
+ that.element,
+ q,
+ jqXHR,
+ textStatus,
+ errorThrown
+ );
+ });
+ } else {
+ options.onSearchComplete.call(that.element, q, []);
+ }
+ },
+
+ isBadQuery: function (q) {
+ if (!this.options.preventBadQueries) {
+ return false;
+ }
- $.extend(ajaxSettings, options.ajaxSettings);
+ var badQueries = this.badQueries,
+ i = badQueries.length;
- that.currentRequest = $.ajax(ajaxSettings).done(function (data) {
- var result;
- that.currentRequest = null;
- result = options.transformResult(data);
- that.processResponse(result, q, cacheKey);
- options.onSearchComplete.call(that.element, q, result.suggestions);
- }).fail(function (jqXHR, textStatus, errorThrown) {
- options.onSearchError.call(that.element, q, jqXHR, textStatus, errorThrown);
- });
- } else {
- options.onSearchComplete.call(that.element, q, []);
- }
- },
+ while (i--) {
+ if (q.indexOf(badQueries[i]) === 0) {
+ return true;
+ }
+ }
- isBadQuery: function (q) {
- if (!this.options.preventBadQueries){
return false;
- }
+ },
- var badQueries = this.badQueries,
- i = badQueries.length;
+ hide: function () {
+ var that = this,
+ container = $(that.suggestionsContainer);
- while (i--) {
- if (q.indexOf(badQueries[i]) === 0) {
- return true;
+ if (typeof that.options.onHide === "function" && that.visible) {
+ that.options.onHide.call(that.element, container);
}
- }
-
- return false;
- },
- hide: function () {
- var that = this;
- that.visible = false;
- that.selectedIndex = -1;
- clearInterval(that.onChangeInterval);
- $(that.suggestionsContainer).hide();
- that.signalHint(null);
- },
-
- suggest: function () {
- if (this.suggestions.length === 0) {
- this.options.showNoSuggestionNotice ? this.noSuggestions() : this.hide();
- return;
- }
+ that.visible = false;
+ that.selectedIndex = -1;
+ clearTimeout(that.onChangeTimeout);
+ $(that.suggestionsContainer).hide();
+ that.onHint(null);
+ },
+
+ suggest: function () {
+ if (!this.suggestions.length) {
+ if (this.options.showNoSuggestionNotice) {
+ this.noSuggestions();
+ } else {
+ this.hide();
+ }
+ return;
+ }
- var that = this,
- options = that.options,
- groupBy = options.groupBy,
- formatResult = options.formatResult,
- value = that.getQuery(that.currentValue),
- className = that.classes.suggestion,
- classSelected = that.classes.selected,
- container = $(that.suggestionsContainer),
- noSuggestionsContainer = $(that.noSuggestionsContainer),
- beforeRender = options.beforeRender,
- html = '',
- category,
- formatGroup = function (suggestion, index) {
+ var that = this,
+ options = that.options,
+ groupBy = options.groupBy,
+ formatResult = options.formatResult,
+ value = that.getQuery(that.currentValue),
+ className = that.classes.suggestion,
+ classSelected = that.classes.selected,
+ container = $(that.suggestionsContainer),
+ noSuggestionsContainer = $(that.noSuggestionsContainer),
+ beforeRender = options.beforeRender,
+ html = "",
+ category,
+ formatGroup = function (suggestion) {
var currentCategory = suggestion.data[groupBy];
- if (category === currentCategory){
- return '';
+ if (category === currentCategory) {
+ return "";
}
category = currentCategory;
- return '' + category + '
';
- },
- index;
+ return options.formatGroup(suggestion, category);
+ };
- if (options.triggerSelectOnValidInput) {
- index = that.findSuggestionIndex(value);
- if (index !== -1) {
- that.select(index);
+ if (options.triggerSelectOnValidInput && that.isExactMatch(value)) {
+ that.select(0);
return;
}
- }
- // Build suggestions inner HTML:
- $.each(that.suggestions, function (i, suggestion) {
- if (groupBy){
- html += formatGroup(suggestion, value, i);
- }
+ // Build suggestions inner HTML:
+ $.each(that.suggestions, function (i, suggestion) {
+ if (groupBy) {
+ html += formatGroup(suggestion, value, i);
+ }
- html += '' + formatResult(suggestion, value) + '
';
- });
+ html +=
+ '' +
+ formatResult(suggestion, value, i) +
+ "
";
+ });
- this.adjustContainerWidth();
+ this.adjustContainerWidth();
- noSuggestionsContainer.detach();
- container.html(html);
+ noSuggestionsContainer.detach();
+ container.html(html);
- // Select first value by default:
- if (options.autoSelectFirst) {
- that.selectedIndex = 0;
- container.children().first().addClass(classSelected);
- }
+ if (typeof beforeRender === "function") {
+ beforeRender.call(that.element, container, that.suggestions);
+ }
- if ($.isFunction(beforeRender)) {
- beforeRender.call(that.element, container);
- }
+ that.fixPosition();
+ container.show();
+
+ // Select first value by default:
+ if (options.autoSelectFirst) {
+ that.selectedIndex = 0;
+ container.scrollTop(0);
+ container
+ .children("." + className)
+ .first()
+ .addClass(classSelected);
+ }
- that.fixPosition();
+ that.visible = true;
+ that.findBestHint();
+ },
- container.show();
- that.visible = true;
+ noSuggestions: function () {
+ var that = this,
+ beforeRender = that.options.beforeRender,
+ container = $(that.suggestionsContainer),
+ noSuggestionsContainer = $(that.noSuggestionsContainer);
- that.findBestHint();
- },
+ this.adjustContainerWidth();
- noSuggestions: function() {
- var that = this,
- container = $(that.suggestionsContainer),
- noSuggestionsContainer = $(that.noSuggestionsContainer);
+ // Some explicit steps. Be careful here as it easy to get
+ // noSuggestionsContainer removed from DOM if not detached properly.
+ noSuggestionsContainer.detach();
- this.adjustContainerWidth();
+ // clean suggestions if any
+ container.empty();
+ container.append(noSuggestionsContainer);
- // Some explicit steps. Be careful here as it easy to get
- // noSuggestionsContainer removed from DOM if not detached properly.
- noSuggestionsContainer.detach();
- container.empty(); // clean suggestions if any
- container.append(noSuggestionsContainer);
+ if (typeof beforeRender === "function") {
+ beforeRender.call(that.element, container, that.suggestions);
+ }
- that.fixPosition();
+ that.fixPosition();
+
+ container.show();
+ that.visible = true;
+ },
+
+ adjustContainerWidth: function () {
+ var that = this,
+ options = that.options,
+ width,
+ container = $(that.suggestionsContainer);
+
+ // If width is auto, adjust width before displaying suggestions,
+ // because if instance was created before input had width, it will be zero.
+ // Also it adjusts if input width has changed.
+ if (options.width === "auto") {
+ width = that.el.outerWidth();
+ container.css("width", width > 0 ? width : 300);
+ } else if (options.width === "flex") {
+ // Trust the source! Unset the width property so it will be the max length
+ // the containing elements.
+ container.css("width", "");
+ }
+ },
- container.show();
- that.visible = true;
- },
+ findBestHint: function () {
+ var that = this,
+ value = that.el.val().toLowerCase(),
+ bestMatch = null;
- adjustContainerWidth: function() {
- var that = this,
- options = that.options,
- width,
- container = $(that.suggestionsContainer);
+ if (!value) {
+ return;
+ }
- // If width is auto, adjust width before displaying suggestions,
- // because if instance was created before input had width, it will be zero.
- // Also it adjusts if input width has changed.
- // -2px to account for suggestions border.
- if (options.width === 'auto') {
- width = that.el.outerWidth() - 2;
- container.width(width > 0 ? width : 300);
- }
- },
+ $.each(that.suggestions, function (i, suggestion) {
+ var foundMatch = suggestion.value.toLowerCase().indexOf(value) === 0;
+ if (foundMatch) {
+ bestMatch = suggestion;
+ }
+ return !foundMatch;
+ });
- findBestHint: function () {
- var that = this,
- value = that.el.val().toLowerCase(),
- bestMatch = null;
+ that.onHint(bestMatch);
+ },
- if (!value) {
- return;
- }
+ onHint: function (suggestion) {
+ var that = this,
+ onHintCallback = that.options.onHint,
+ hintValue = "";
- $.each(that.suggestions, function (i, suggestion) {
- var foundMatch = suggestion.value.toLowerCase().indexOf(value) === 0;
- if (foundMatch) {
- bestMatch = suggestion;
+ if (suggestion) {
+ hintValue =
+ that.currentValue + suggestion.value.substr(that.currentValue.length);
+ }
+ if (that.hintValue !== hintValue) {
+ that.hintValue = hintValue;
+ that.hint = suggestion;
+ if (typeof onHintCallback === "function") {
+ onHintCallback.call(that.element, hintValue);
+ }
+ }
+ },
+
+ verifySuggestionsFormat: function (suggestions) {
+ // If suggestions is string array, convert them to supported format:
+ if (suggestions.length && typeof suggestions[0] === "string") {
+ return $.map(suggestions, function (value) {
+ return { value: value, data: null };
+ });
}
- return !foundMatch;
- });
-
- that.signalHint(bestMatch);
- },
- signalHint: function (suggestion) {
- var hintValue = '',
- that = this;
- if (suggestion) {
- hintValue = that.currentValue + suggestion.value.substr(that.currentValue.length);
- }
- if (that.hintValue !== hintValue) {
- that.hintValue = hintValue;
- that.hint = suggestion;
- (this.options.onHint || $.noop)(hintValue);
- }
- },
+ return suggestions;
+ },
- verifySuggestionsFormat: function (suggestions) {
- // If suggestions is string array, convert them to supported format:
- if (suggestions.length && typeof suggestions[0] === 'string') {
- return $.map(suggestions, function (value) {
- return { value: value, data: null };
- });
- }
+ validateOrientation: function (orientation, fallback) {
+ orientation = (orientation || "").trim().toLowerCase();
- return suggestions;
- },
+ if ($.inArray(orientation, ["auto", "bottom", "top"]) === -1) {
+ orientation = fallback;
+ }
- validateOrientation: function(orientation, fallback) {
- orientation = $.trim(orientation || '').toLowerCase();
+ return orientation;
+ },
- if($.inArray(orientation, ['auto', 'bottom', 'top']) === -1){
- orientation = fallback;
- }
+ processResponse: function (result, originalQuery, cacheKey) {
+ var that = this,
+ options = that.options;
- return orientation;
- },
+ result.suggestions = that.verifySuggestionsFormat(result.suggestions);
- processResponse: function (result, originalQuery, cacheKey) {
- var that = this,
- options = that.options;
-
- result.suggestions = that.verifySuggestionsFormat(result.suggestions);
+ // Cache results if cache is not disabled:
+ if (!options.noCache) {
+ that.cachedResponse[cacheKey] = result;
+ if (options.preventBadQueries && !result.suggestions.length) {
+ that.badQueries.push(originalQuery);
+ }
+ }
- // Cache results if cache is not disabled:
- if (!options.noCache) {
- that.cachedResponse[cacheKey] = result;
- if (options.preventBadQueries && result.suggestions.length === 0) {
- that.badQueries.push(originalQuery);
+ // Return if originalQuery is not matching current query:
+ if (originalQuery !== that.getQuery(that.currentValue)) {
+ return;
}
- }
- // Return if originalQuery is not matching current query:
- if (originalQuery !== that.getQuery(that.currentValue)) {
- return;
- }
+ that.suggestions = result.suggestions;
+ that.suggest();
+ },
- that.suggestions = result.suggestions;
- that.suggest();
- },
+ activate: function (index) {
+ var that = this,
+ activeItem,
+ selected = that.classes.selected,
+ container = $(that.suggestionsContainer),
+ children = container.find("." + that.classes.suggestion);
- activate: function (index) {
- var that = this,
- activeItem,
- selected = that.classes.selected,
- container = $(that.suggestionsContainer),
- children = container.find('.' + that.classes.suggestion);
+ container.find("." + selected).removeClass(selected);
- container.find('.' + selected).removeClass(selected);
+ that.selectedIndex = index;
- that.selectedIndex = index;
+ if (that.selectedIndex !== -1 && children.length > that.selectedIndex) {
+ activeItem = children.get(that.selectedIndex);
+ $(activeItem).addClass(selected);
+ return activeItem;
+ }
- if (that.selectedIndex !== -1 && children.length > that.selectedIndex) {
- activeItem = children.get(that.selectedIndex);
- $(activeItem).addClass(selected);
- return activeItem;
- }
+ return null;
+ },
- return null;
- },
+ selectHint: function () {
+ var that = this,
+ i = $.inArray(that.hint, that.suggestions);
- selectHint: function () {
- var that = this,
- i = $.inArray(that.hint, that.suggestions);
+ that.select(i);
+ },
- that.select(i);
- },
+ select: function (i) {
+ var that = this;
+ that.hide();
+ that.onSelect(i);
+ },
- select: function (i) {
- var that = this;
- that.hide();
- that.onSelect(i);
- },
+ moveUp: function () {
+ var that = this;
- moveUp: function () {
- var that = this;
+ if (that.selectedIndex === -1) {
+ return;
+ }
- if (that.selectedIndex === -1) {
- return;
- }
+ if (that.selectedIndex === 0) {
+ $(that.suggestionsContainer)
+ .children("." + that.classes.suggestion)
+ .first()
+ .removeClass(that.classes.selected);
+ that.selectedIndex = -1;
+ that.ignoreValueChange = false;
+ that.el.val(that.currentValue);
+ that.findBestHint();
+ return;
+ }
- if (that.selectedIndex === 0) {
- $(that.suggestionsContainer).children().first().removeClass(that.classes.selected);
- that.selectedIndex = -1;
- that.el.val(that.currentValue);
- that.findBestHint();
- return;
- }
+ that.adjustScroll(that.selectedIndex - 1);
+ },
- that.adjustScroll(that.selectedIndex - 1);
- },
+ moveDown: function () {
+ var that = this;
- moveDown: function () {
- var that = this;
+ if (that.selectedIndex === that.suggestions.length - 1) {
+ return;
+ }
- if (that.selectedIndex === (that.suggestions.length - 1)) {
- return;
- }
+ that.adjustScroll(that.selectedIndex + 1);
+ },
- that.adjustScroll(that.selectedIndex + 1);
- },
+ adjustScroll: function (index) {
+ var that = this,
+ activeItem = that.activate(index);
- adjustScroll: function (index) {
- var that = this,
- activeItem = that.activate(index)
+ if (!activeItem) {
+ return;
+ }
- if (!activeItem) {
- return;
- }
+ var offsetTop,
+ upperBound,
+ lowerBound,
+ heightDelta = $(activeItem).outerHeight();
+
+ offsetTop = activeItem.offsetTop;
+ upperBound = $(that.suggestionsContainer).scrollTop();
+ lowerBound = upperBound + that.options.maxHeight - heightDelta;
+
+ if (offsetTop < upperBound) {
+ $(that.suggestionsContainer).scrollTop(offsetTop);
+ } else if (offsetTop > lowerBound) {
+ $(that.suggestionsContainer).scrollTop(
+ offsetTop - that.options.maxHeight + heightDelta
+ );
+ }
- var offsetTop,
- upperBound,
- lowerBound,
- heightDelta = $(activeItem).outerHeight();
+ if (!that.options.preserveInput) {
+ // During onBlur event, browser will trigger "change" event,
+ // because value has changed, to avoid side effect ignore,
+ // that event, so that correct suggestion can be selected
+ // when clicking on suggestion with a mouse
+ that.ignoreValueChange = true;
+ that.el.val(that.getValue(that.suggestions[index].value));
+ }
- offsetTop = activeItem.offsetTop;
- upperBound = $(that.suggestionsContainer).scrollTop();
- lowerBound = upperBound + that.options.maxHeight - heightDelta;
+ that.onHint(null);
+ },
- if (offsetTop < upperBound) {
- $(that.suggestionsContainer).scrollTop(offsetTop);
- } else if (offsetTop > lowerBound) {
- $(that.suggestionsContainer).scrollTop(offsetTop - that.options.maxHeight + heightDelta);
- }
+ onSelect: function (index) {
+ var that = this,
+ onSelectCallback = that.options.onSelect,
+ suggestion = that.suggestions[index];
- that.el.val(that.getValue(that.suggestions[index].value));
- that.signalHint(null);
- },
+ that.currentValue = that.getValue(suggestion.value);
- onSelect: function (index) {
- var that = this,
- onSelectCallback = that.options.onSelect,
- suggestion = that.suggestions[index];
+ if (that.currentValue !== that.el.val() && !that.options.preserveInput) {
+ that.el.val(that.currentValue);
+ }
- that.currentValue = that.getValue(suggestion.value);
+ that.onHint(null);
+ that.suggestions = [];
+ that.selection = suggestion;
- if (that.currentValue !== that.el.val()) {
- that.el.val(that.currentValue);
- }
+ if (typeof onSelectCallback === "function") {
+ onSelectCallback.call(that.element, suggestion);
+ }
+ },
- that.signalHint(null);
- that.suggestions = [];
- that.selection = suggestion;
+ getValue: function (value) {
+ var that = this,
+ delimiter = that.options.delimiter,
+ currentValue,
+ parts;
- if ($.isFunction(onSelectCallback)) {
- onSelectCallback.call(that.element, suggestion);
- }
- },
+ if (!delimiter) {
+ return value;
+ }
- getValue: function (value) {
- var that = this,
- delimiter = that.options.delimiter,
- currentValue,
- parts;
+ currentValue = that.currentValue;
+ parts = currentValue.split(delimiter);
- if (!delimiter) {
- return value;
- }
+ if (parts.length === 1) {
+ return value;
+ }
- currentValue = that.currentValue;
- parts = currentValue.split(delimiter);
+ return (
+ currentValue.substr(0, currentValue.length - parts[parts.length - 1].length) +
+ value
+ );
+ },
+
+ dispose: function () {
+ var that = this;
+ that.el.off(".autocomplete").removeData("autocomplete");
+ $(window).off("resize.autocomplete", that.fixPositionCapture);
+ $(that.suggestionsContainer).remove();
+ },
+ };
- if (parts.length === 1) {
- return value;
+ // Create chainable jQuery plugin:
+ $.fn.devbridgeAutocomplete = function (options, args) {
+ var dataKey = "autocomplete";
+ // If function invoked without argument return
+ // instance of the first matched element:
+ if (!arguments.length) {
+ return this.first().data(dataKey);
}
- return currentValue.substr(0, currentValue.length - parts[parts.length - 1].length) + value;
- },
-
- dispose: function () {
- var that = this;
- that.el.off('.autocomplete').removeData('autocomplete');
- that.disableKillerFn();
- $(window).off('resize.autocomplete', that.fixPositionCapture);
- $(that.suggestionsContainer).remove();
- }
- };
-
- // Create chainable jQuery plugin:
- $.fn.autocomplete = $.fn.devbridgeAutocomplete = function (options, args) {
- var dataKey = 'autocomplete';
- // If function invoked without argument return
- // instance of the first matched element:
- if (arguments.length === 0) {
- return this.first().data(dataKey);
- }
-
- return this.each(function () {
- var inputElement = $(this),
- instance = inputElement.data(dataKey);
+ return this.each(function () {
+ var inputElement = $(this),
+ instance = inputElement.data(dataKey);
- if (typeof options === 'string') {
- if (instance && typeof instance[options] === 'function') {
- instance[options](args);
- }
- } else {
- // If instance already exists, destroy it:
- if (instance && instance.dispose) {
- instance.dispose();
+ if (typeof options === "string") {
+ if (instance && typeof instance[options] === "function") {
+ instance[options](args);
+ }
+ } else {
+ // If instance already exists, destroy it:
+ if (instance && instance.dispose) {
+ instance.dispose();
+ }
+ instance = new Autocomplete(this, options);
+ inputElement.data(dataKey, instance);
}
- instance = new Autocomplete(this, options);
- inputElement.data(dataKey, instance);
- }
- });
- };
-}));
+ });
+ };
+
+ // Don't overwrite if it already exists
+ if (!$.fn.autocomplete) {
+ $.fn.autocomplete = $.fn.devbridgeAutocomplete;
+ }
+ }
+);
diff --git a/typings/jquery.autocomplete-tests.ts b/typings/jquery.autocomplete-tests.ts
new file mode 100644
index 00000000..7ef5b329
--- /dev/null
+++ b/typings/jquery.autocomplete-tests.ts
@@ -0,0 +1,152 @@
+///
+
+// ----------------------------------------------------------------------------------------
+// --------------------------------- WEBSITE EXAMPLE --------------------------------------
+// --------------- https://devbridge.github.io/jQuery-Autocomplete/ -----------------------
+// ----------------------------------------------------------------------------------------
+
+var input = $('#autocomplete');
+var options = {};
+
+input.autocomplete('disable');
+input.autocomplete('setOptions', options);
+
+input.autocomplete().disable();
+input.autocomplete().setOptions(options);
+
+// Ajax lookup:
+input.autocomplete({
+ serviceUrl: '/autocomplete/countries',
+ onSelect: function (suggestion) {
+ alert('You selected: ' + suggestion.value + ', ' + suggestion.data);
+ },
+});
+
+// Local lookup (no ajax):
+var countries = [
+ { value: 'Andorra', data: 'AD' },
+ // ...
+ { value: 'Zimbabwe', data: 'ZZ' },
+];
+
+input.autocomplete({
+ lookup: countries,
+ onSelect: function (suggestion) {
+ alert('You selected: ' + suggestion.value + ', ' + suggestion.data);
+ },
+});
+
+// Non standard query/results
+input.autocomplete({
+ paramName: 'searchString',
+ transformResult: function (response: any, originalQuery: string): AutocompleteResponse {
+ return {
+ suggestions: $.map(response.myData, function (dataItem) {
+ return { value: dataItem.valueField, data: dataItem.dataField };
+ }),
+ };
+ },
+});
+
+// ----------------------------------------------------------------------------------------
+// ----------------------------- TEST AUTOCOMPLETE STATIC ---------------------------------
+// ----------------------------------------------------------------------------------------
+
+$.Autocomplete.defaults;
+
+// ----------------------------------------------------------------------------------------
+// ------------------------------ TEST INSTANCE METHODS -----------------------------------
+// ----------------------------------------------------------------------------------------
+
+input.autocomplete().setOptions(options);
+input.autocomplete().clear();
+input.autocomplete().clearCache();
+input.autocomplete().disable();
+input.autocomplete().enable();
+input.autocomplete().hide();
+input.autocomplete().dispose();
+
+// ----------------------------------------------------------------------------------------
+// ------------------------------ TEST DEFAULT OPTIONS ------------------------------------
+// ----------------------------------------------------------------------------------------
+
+input.autocomplete({
+ //----------------o AJAX SETTINGS
+
+ serviceUrl: '/autocomplete/countries',
+ type: 'GET',
+ dataType: 'text',
+ paramName: 'query',
+ params: {},
+ deferRequestBy: 0,
+ ajaxSettings: {},
+
+ //----------------o CONFIG SETTINGS
+
+ noCache: false,
+ delimiter: '-',
+ onSearchStart(query: string) {
+ console.log('query: ', query);
+ },
+ onSearchComplete(query: string, suggestions: AutocompleteSuggestion[]) {
+ console.log('query: ', query);
+ console.log('suggestions: ', suggestions);
+ },
+ onSearchError(query: string, jqXHR: JQueryXHR, textStatus: string, errorThrown: any) {
+ console.log('query: ', query);
+ console.log('jqXHR: ', jqXHR);
+ console.log('textStatus: ', textStatus);
+ console.log('errorThrown: ', errorThrown);
+ },
+ transformResult(response: any, originalQuery: string): AutocompleteResponse {
+ return {
+ suggestions: [
+ { value: 'Andorra', data: 'AD' },
+ // ...
+ { value: 'Zimbabwe', data: 'ZZ' },
+ ],
+ };
+ },
+ onSelect(suggestion: AutocompleteSuggestion) {
+ console.log('suggestions: ', suggestion);
+ },
+ minChars: 1,
+ lookupLimit: 1,
+ lookup: [
+ { value: 'Andorra', data: 'AD' },
+ // ...
+ { value: 'Zimbabwe', data: 'ZZ' },
+ ],
+ lookupFilter(suggestion: AutocompleteSuggestion, query: string, queryLowercase: string): any {
+ return query !== 'query';
+ },
+ triggerSelectOnValidInput: true,
+ preventBadQueries: true,
+ autoSelectFirst: false,
+ onHide(container: any) {
+ console.log('container: ', container);
+ },
+
+ //----------------o PRESENTATION SETTINGS
+
+ beforeRender(container: any) {
+ console.log('container: ', container);
+ },
+ formatResult(suggestion: AutocompleteSuggestion, currentValue: string): string {
+ return currentValue;
+ },
+ groupBy: 'category',
+ maxHeight: 300,
+ width: 'auto',
+ zIndex: 9999,
+ appendTo: document.body,
+ forceFixPosition: false,
+ orientation: 'bottom',
+ preserveInput: false,
+ showNoSuggestionNotice: false,
+ noSuggestionNotice: 'No results',
+ onInvalidateSelection() {
+ console.log('onInvalidateSelection');
+ },
+ tabDisabled: false,
+});
diff --git a/typings/jquery.autocomplete.d.ts b/typings/jquery.autocomplete.d.ts
new file mode 100644
index 00000000..bc30c606
--- /dev/null
+++ b/typings/jquery.autocomplete.d.ts
@@ -0,0 +1,420 @@
+// Type definitions for jQuery-Autocomplete 1.4.11
+// Project: https://github.com/devbridge/jQuery-Autocomplete
+// Definitions by: John Gouigouix
+// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+
+///
+
+interface AutocompleteSuggestion {
+ value: string;
+ data: any;
+}
+
+interface AutocompleteResponse {
+ suggestions: AutocompleteSuggestion[];
+}
+
+interface JQueryAutocompleteOptions {
+ //----------------o AJAX SETTINGS
+
+ /**
+ * Server side URL or callback function that returns serviceUrl string. Optional if local lookup data is provided.
+ */
+ serviceUrl?: string;
+
+ /**
+ * Ajax request type to get suggestions.
+ * @default "GET"
+ */
+ type?: string;
+
+ /**
+ * type of data returned from server. Either text, json or jsonp, which will cause the autocomplete to use jsonp.
+ * You may return a json object in your callback when using jsonp.
+ * @default "text"
+ */
+ dataType?: 'text' | 'json' | 'jsonp';
+
+ /**
+ * The name of the request parameter that contains the query.
+ * @default "query"
+ */
+ paramName?: string;
+
+ /**
+ * Additional parameters to pass with the request, optional.
+ */
+ params?: Object;
+
+ /**
+ * Number of miliseconds to defer ajax request.
+ * @default 0
+ */
+ deferRequestBy?: number;
+
+ /**
+ * Any additional Ajax Settings that configure the jQuery Ajax request.
+ */
+ ajaxSettings?: JQueryAjaxSettings;
+
+ //----------------o CONFIG SETTINGS
+
+ /**
+ * Boolean value indicating whether to cache suggestion results.
+ * @default false
+ */
+ noCache?: boolean;
+
+ /**
+ * That splits input value and takes last part to as query for suggestions.
+ * Useful when for example you need to fill list of coma separated values.
+ */
+ delimiter?: string | RegExp;
+
+ /**
+ * Called before ajax request. this is bound to input element.
+ * @param query
+ */
+ onSearchStart?(query: string): void;
+
+ /**
+ * Called after ajax response is processed. this is bound to input element.
+ * Suggestions is an array containing the results.
+ * @param query
+ * @param suggestions
+ */
+ onSearchComplete?(query: string, suggestions: AutocompleteSuggestion[]): void;
+
+ /**
+ * Called if ajax request fails. this is bound to input element.
+ * @param query
+ * @param jqXHR
+ * @param textStatus
+ * @param errorThrown
+ */
+ onSearchError?(query: string, jqXHR: JQueryXHR, textStatus: string, errorThrown: any): void;
+
+ /**
+ * Called after the result of the query is ready. Converts the result into response.suggestions format.
+ * @param response
+ * @param originalQuery
+ */
+ transformResult?(response: any, originalQuery: string): AutocompleteResponse;
+
+ /**
+ * Callback function invoked when user selects suggestion from the list.
+ * This inside callback refers to input HtmlElement.
+ * @param suggestion
+ */
+ onSelect?(suggestion: AutocompleteSuggestion): void;
+
+ /**
+ * Minimum number of characters required to trigger autosuggest.
+ * @default 1
+ */
+ minChars?: number;
+
+ /**
+ * Number of maximum results to display for local lookup.
+ * @default no limit
+ */
+ lookupLimit?: number;
+
+ /**
+ * Callback function or lookup array for the suggestions. It may be array of strings or suggestion object literals.
+ * -> suggestion: An object literal with the following format: { value: 'string', data: any }.
+ */
+ lookup?:
+ | { (query: string, done: { (results: AutocompleteResponse): void }): void }
+ | string[]
+ | AutocompleteSuggestion[];
+
+ /**
+ * Filter function for local lookups. By default it does partial string match (case insensitive).
+ * @param suggestion
+ * @param query
+ * @param queryLowercase
+ */
+ lookupFilter?(suggestion: AutocompleteSuggestion, query: string, queryLowercase: string): any;
+
+ /**
+ * Boolean value indicating if select should be triggered if it matches suggestion.
+ * @default true
+ */
+ triggerSelectOnValidInput?: boolean;
+
+ /**
+ * Boolean value indicating if it shoud prevent future ajax requests for queries with the same root if no results were returned.
+ * E.g. if Jam returns no suggestions, it will not fire for any future query that starts with Jam.
+ * @default true
+ */
+ preventBadQueries?: boolean;
+
+ /**
+ * If set to true, first item will be selected when showing suggestions.
+ * @default false
+ */
+ autoSelectFirst?: boolean;
+
+ /**
+ * Called before container will be hidden
+ * @param container
+ */
+ onHide?(container: any): void;
+
+ //----------------o PRESENTATION SETTINGS
+
+ /**
+ * Called before displaying the suggestions. You may manipulate suggestions DOM before it is displayed.
+ * @param container
+ */
+ beforeRender?(container: any): void;
+
+ /**
+ * Custom function to format suggestion entry inside suggestions container, optional.
+ * @param suggestion
+ * @param currentValue
+ */
+ formatResult?(suggestion: AutocompleteSuggestion, currentValue: string): string;
+
+ /**
+ * Property name of the suggestion data object, by which results should be grouped.
+ */
+ groupBy?: string;
+
+ /**
+ * Maximum height of the suggestions container in pixels.
+ * @default 300
+ */
+ maxHeight?: number;
+
+ /**
+ * Suggestions container width in pixels, e.g.: 300. takes input field width.
+ * @default "auto"
+ */
+ width?: string | number;
+
+ /**
+ * 'z-index' for suggestions container.
+ * @default 9999
+ */
+ zIndex?: number;
+
+ /**
+ * Container where suggestions will be appended. Can be jQuery object, selector or html element.
+ * Make sure to set position: absolute or position: relative for that element.
+ * @default document.body
+ */
+ appendTo?: any;
+
+ /**
+ * Suggestions are automatically positioned when their container is appended to body (look at appendTo option),
+ * in other cases suggestions are rendered but no positioning is applied.
+ * Set this option to force auto positioning in other cases.
+ * @default false
+ */
+ forceFixPosition?: boolean;
+
+ /**
+ * Vertical orientation of the displayed suggestions, available values are auto, top, bottom.
+ * If set to auto, the suggestions will be orientated it the way that place them closer to middle of the view port.
+ * @default "bottom"
+ */
+ orientation?: 'bottom' | 'auto' | 'top';
+
+ /**
+ * If true, input value stays the same when navigating over suggestions.
+ * @default false
+ */
+ preserveInput?: boolean;
+
+ /**
+ * When no matching results, display a notification label.
+ * @default false
+ */
+ showNoSuggestionNotice?: boolean;
+
+ /**
+ * Text or htmlString or Element or jQuery object for no matching results label.
+ * @default "No results"
+ */
+ noSuggestionNotice?: string | Element | JQuery;
+
+ /**
+ * Called when input is altered after selection has been made. this is bound to input element.
+ */
+ onInvalidateSelection?(): void;
+
+ /**
+ * Set to true to leave the cursor in the input field after the user tabs to select a suggestion.
+ * @default false
+ */
+ tabDisabled?: boolean;
+}
+
+interface AutocompleteStatic {
+ /**
+ * Default options for all instances.
+ */
+ defaults: JQueryAutocompleteOptions;
+}
+
+interface AutocompleteInstance {
+ /**
+ * you may update any option at any time. Options are listed above.
+ * @param options
+ */
+ setOptions(options: JQueryAutocompleteOptions): void;
+
+ /**
+ * clears suggestion cache and current suggestions suggestions.
+ */
+ clear(): void;
+
+ /**
+ * clears suggestion cache.
+ */
+ clearCache(): void;
+
+ /**
+ * deactivate autocomplete.
+ */
+ disable(): void;
+
+ /**
+ * activates autocomplete if it was deactivated before.
+ */
+ enable(): void;
+
+ /**
+ * hides suggestions.
+ */
+ hide(): void;
+
+ /**
+ * destroys autocomplete instance. All events are detached and suggestion containers removed.
+ */
+ dispose(): void;
+}
+
+interface JQueryStatic {
+ Autocomplete: AutocompleteStatic;
+}
+
+interface JQuery {
+ /**
+ * Create Autocomplete component
+ */
+ autocomplete(options?: JQueryAutocompleteOptions): AutocompleteInstance;
+
+ /**
+ * Trigger non-specialized signature method
+ * @param methodName
+ * @param arg
+ */
+ autocomplete(methodName: string, ...arg: any[]): any;
+
+ /**
+ * You may update any option at any time. Options are listed above.
+ * @param methodName The name of the method
+ * @param options
+ */
+ autocomplete(
+ methodName: 'setOptions',
+ options: JQueryAutocompleteOptions,
+ ): AutocompleteInstance;
+
+ /**
+ * Clears suggestion cache and current suggestions suggestions.
+ * @param methodName The name of the method
+ */
+ autocomplete(methodName: 'clear'): AutocompleteInstance;
+
+ /**
+ * Clears suggestion cache.
+ * @param methodName The name of the method
+ */
+ autocomplete(methodName: 'clearCache'): AutocompleteInstance;
+
+ /**
+ * Deactivate autocomplete.
+ * @param methodName The name of the method
+ */
+ autocomplete(methodName: 'disable'): AutocompleteInstance;
+
+ /**
+ * Activates autocomplete if it was deactivated before.
+ * @param methodName The name of the method
+ */
+ autocomplete(methodName: 'enable'): AutocompleteInstance;
+
+ /**
+ * Hides suggestions.
+ * @param methodName The name of the method
+ */
+ autocomplete(methodName: 'hide'): AutocompleteInstance;
+
+ /**
+ * Destroys autocomplete instance. All events are detached and suggestion containers removed.
+ * @param methodName The name of the method
+ */
+ autocomplete(methodName: 'dispose'): AutocompleteInstance;
+
+ /**
+ * Create Autocomplete component via plugin alias
+ */
+ devbridgeAutocomplete(options?: JQueryAutocompleteOptions): AutocompleteInstance;
+
+ /**
+ * Trigger non-specialized signature method
+ * @param methodName
+ * @param arg
+ */
+ devbridgeAutocomplete(methodName: string, ...arg: any[]): any;
+
+ /**
+ * You may update any option at any time. Options are listed above.
+ * @param methodName The name of the method
+ * @param options
+ */
+ devbridgeAutocomplete(
+ methodName: 'setOptions',
+ options: JQueryAutocompleteOptions,
+ ): AutocompleteInstance;
+
+ /**
+ * Clears suggestion cache and current suggestions suggestions.
+ * @param methodName The name of the method
+ */
+ devbridgeAutocomplete(methodName: 'clear'): AutocompleteInstance;
+
+ /**
+ * Clears suggestion cache.
+ * @param methodName The name of the method
+ */
+ devbridgeAutocomplete(methodName: 'clearCache'): AutocompleteInstance;
+
+ /**
+ * Deactivate autocomplete.
+ * @param methodName The name of the method
+ */
+ devbridgeAutocomplete(methodName: 'disable'): AutocompleteInstance;
+
+ /**
+ * Activates autocomplete if it was deactivated before.
+ * @param methodName The name of the method
+ */
+ devbridgeAutocomplete(methodName: 'enable'): AutocompleteInstance;
+
+ /**
+ * Hides suggestions.
+ * @param methodName The name of the method
+ */
+ devbridgeAutocomplete(methodName: 'hide'): AutocompleteInstance;
+
+ /**
+ * Destroys autocomplete instance. All events are detached and suggestion containers removed.
+ * @param methodName The name of the method
+ */
+ devbridgeAutocomplete(methodName: 'dispose'): AutocompleteInstance;
+}