<commit_before>// #region Import Directives
define(["require", "exports", "jquery", "knockout", "typeahead", "bloodhound"], function (require, exports, jquery, knockout) {
    "use strict";
    // #endregion
    /**
     * Represents a binding handler for using Twitter typeahead.js and the Bloodhound suggestion engine.
     */
    knockout.bindingHandlers["typeahead"] = {
        /**
         * Initializes the typeahead.js and Bloodhound bindings for the input that this binding is used on.
         * @param {any} element The DOM element involved in this binding. Should be a text input.
         * @param {() => any} valueAccessor A JavaScript function that you can call to get the current model property that is involved in this binding.
         * @param {KnockoutAllBindingsAccessor} allBindingsAccessor A JavaScript object that you can use to access all the model values bound to this DOM element.
         */
        init: function (element, valueAccessor, allBindingsAccessor) {
            // Prevents the input from which the typeahead is created from autocompleting itself
            var typeaheadInput = jquery(element);
            typeaheadInput.attr("autocomplete", "off");
            // Gets the options for the typeahead input
            var highlight = allBindingsAccessor.get("highlight");
            var hint = allBindingsAccessor.get("hint");
            var minLength = allBindingsAccessor.get("minLength");
            var classNames = allBindingsAccessor.get("classNames");
            // Gets the options for the typeahead dataset
            var async = allBindingsAccessor.get("async");
            var name = allBindingsAccessor.get("name");
            var limit = allBindingsAccessor.get("limit");
            var display = allBindingsAccessor.get("display");
            // Gets the suggestion source for the typeahead dataset
            var source = knockout.unwrap(allBindingsAccessor.get("source"));
            // Initializes the typeahead input
            typeaheadInput.typeahead({
                highlight: highlight,
                hint: hint,
                minLength: minLength,
                classNames: classNames
            }, [{
                    source: source,
                    async: async,
                    name: name,
                    limit: limit,
                    display: display
                }]);
            // Subscribes to the select event of the typeahead input, which is called, when the user selects a suggestion
            typeaheadInput.on("typeahead:select", function (event, suggestion) {
                // Updates the value to which the typeahead input was bound
                var value = valueAccessor();
                value(suggestion);
            });
        },
        /**
         * Is called once initially when the binding is applied to the input which is bound using typeahead binding handler. When any of these dependencies change, the update callback will be called once again. Updates the value of the typeahead input.
         * @param {any} element The DOM element involved in this binding. Should be a text input.
         * @param {() => any} valueAccessor A JavaScript function that you can call to get the current model property that is involved in this binding.
         * @param {KnockoutAllBindingsAccessor} allBindingsAccessor A JavaScript object that you can use to access all the model values bound to this DOM element.
         */
        update: function (element, valueAccessor, allBindingsAccessor) {
            // Sets the value of the typeahead input to the new value of the binding
            var currentValue = knockout.unwrap(valueAccessor());
            jquery(element).typeahead("val", currentValue);
        }
    };
});
<commit_msg>Added the new build.<commit_after>// #region Import Directives
define(["require", "exports", "jquery", "knockout", "typeahead", "bloodhound"], function (require, exports, jquery, knockout) {
    "use strict";
    // #endregion
    /**
     * Represents a binding handler for using Twitter typeahead.js and the Bloodhound suggestion engine.
     */
    knockout.bindingHandlers["typeahead"] = {
        /**
         * Initializes the typeahead.js and Bloodhound bindings for the input that this binding is used on.
         * @param {any} element The DOM element involved in this binding. Should be a text input.
         * @param {() => any} valueAccessor A JavaScript function that you can call to get the current model property that is involved in this binding.
         * @param {KnockoutAllBindingsAccessor} allBindingsAccessor A JavaScript object that you can use to access all the model values bound to this DOM element.
         */
        init: function (element, valueAccessor, allBindingsAccessor) {
            // Prevents the input from which the typeahead is created from autocompleting itself
            var typeaheadInput = jquery(element);
            typeaheadInput.attr("autocomplete", "off");
            // Gets the options for the typeahead input
            var highlight = allBindingsAccessor.get("highlight");
            var hint = allBindingsAccessor.get("hint");
            var minLength = allBindingsAccessor.get("minLength");
            var classNames = allBindingsAccessor.get("classNames");
            // Gets the options for the typeahead dataset
            var async = allBindingsAccessor.get("async");
            var name = allBindingsAccessor.get("name");
            var limit = allBindingsAccessor.get("limit");
            var display = allBindingsAccessor.get("display");
            // Gets the suggestion source for the typeahead dataset
            var source = knockout.unwrap(allBindingsAccessor.get("source"));
            // Initializes the typeahead input
            typeaheadInput.typeahead({
                highlight: highlight,
                hint: hint,
                minLength: minLength,
                classNames: classNames
            }, [{
                    source: source,
                    async: async,
                    name: name,
                    limit: limit,
                    display: display
                }]);
            // Subscribes to the select event of the typeahead input, which is called, when the user selects a suggestion
            typeaheadInput.on("typeahead:select", function (event, suggestion) {
                // Updates the value to which the typeahead input was bound
                var value = valueAccessor();
                value(suggestion);
            });
        },
        /**
         * Is called once initially when the binding is applied to the input which is bound using typeahead binding handler. When any of these dependencies change, the update callback will be called once again. Updates the value of the typeahead input.
         * @param {any} element The DOM element involved in this binding. Should be a text input.
         * @param {() => any} valueAccessor A JavaScript function that you can call to get the current model property that is involved in this binding.
         * @param {KnockoutAllBindingsAccessor} allBindingsAccessor A JavaScript object that you can use to access all the model values bound to this DOM element.
         */
        update: function (element, valueAccessor, allBindingsAccessor) {
            // Retrieves the display name based on the display option (which can either be a function that retrieves the name or a path string)
            var currentValue = knockout.unwrap(valueAccessor());
            var display = allBindingsAccessor.get("display");
            if (typeof (display) === "string") {
                for (var part in display.split(".")) {
                    currentValue = currentValue[part];
                }
            }
            else {
                currentValue = display(currentValue);
            }
            // Sets the value of the typeahead input to the new value of the binding
            jquery(element).typeahead("val", currentValue);
        }
    };
});

{'fraction_non_alphanumeric': 0.07795598657217456, 'fraction_numerical': 0.0, 'mean_word_length': 2.211177644710579, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3219523', 'n_tokens_mistral': 1893, 'n_tokens_neox': 1794, 'n_words': 757}