<commit_before>define([
    './../base/page-region-view',
    'underscore',
    'jquery',
    'oroui/js/mediator'
], function(PageRegionView, _, $, mediator) {
    'use strict';

    var PageMainMenuView;

    PageMainMenuView = PageRegionView.extend({
        template: function(data) {
            return data.mainMenu;
        },
        pageItems: ['mainMenu', 'currentRoute'],

        initialize: function(options) {
            // Array of search callback, that match route to menu item
            this.routeMatchSearchers = [];
            // Local cache of route to menu item
            this.routeMatchedMenuItemsCache = {};

            PageMainMenuView.__super__.initialize.call(this, options);
        },

        render: function() {
            var data = this.getTemplateData();
            var currentRoute = this.getCurrentRoute(data);

            if (data) {
                if (!_.isUndefined(data.mainMenu)) {
                    PageMainMenuView.__super__.render.call(this);
                    this.initRouteMatches();
                }
            } else {
                this.initRouteMatches();
            }

            this.toggleActiveMenuItem(currentRoute);

            mediator.trigger('mainMenuUpdated', this);
            this.$el.trigger('mainMenuUpdated');<commit_msg>BB-2550: Shopping List Menu  - handle js components in menu<commit_after>define([
    './../base/page-region-view',
    'underscore',
    'jquery',
    'oroui/js/mediator'
], function(PageRegionView, _, $, mediator) {
    'use strict';

    var PageMainMenuView;

    PageMainMenuView = PageRegionView.extend({
        template: function(data) {
            return data.mainMenu;
        },
        pageItems: ['mainMenu', 'currentRoute'],

        initialize: function(options) {
            // Array of search callback, that match route to menu item
            this.routeMatchSearchers = [];
            // Local cache of route to menu item
            this.routeMatchedMenuItemsCache = {};

            PageMainMenuView.__super__.initialize.call(this, options);
        },

        render: function() {
            var data = this.getTemplateData();
            var currentRoute = this.getCurrentRoute(data);

            if (data) {
                if (!_.isUndefined(data.mainMenu)) {
                    PageMainMenuView.__super__.render.call(this);
                    this.initRouteMatches();
                } else {
                    this.initLayout()
                        .done(_.bind(this._resolveDeferredRender, this));
                }
            } else {
                this.initRouteMatches();
            }

            this.toggleActiveMenuItem(currentRoute);

            mediator.trigger('mainMenuUpdated', this);
            this.$el.trigger('mainMenuUpdated');
{'fraction_non_alphanumeric': 0.11325473383351196, 'fraction_numerical': 0.0014290818149339049, 'mean_word_length': 1.7916251246261217, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '3023191', 'n_tokens_mistral': 732, 'n_tokens_neox': 700, 'n_words': 137}