<commit_before>/* eslint no-console:0 */

import "babel-polyfill";

import { configureStore, addReducer } from 'store';
import React from 'react';
import ReactDOM from 'react-dom';
import { Provider } from 'react-redux';
import { configureAjaxHelper } from 'ajax_helper';
import { setPolicy } from 'policy';
import { FlashMessages } from 'lib/flashes';
import dialogs from 'lib/dialogs';

var pluginReducers = {};
var pluginContainers = {};

<% Core::PluginsManager.mountable_plugins.each do |plugin| %>
  <% if File.exists?(File.expand_path("plugins/#{plugin.name}/app/javascript/packs", __dir__)) %>
    import <%=plugin.name%> from '../../../plugins/<%=plugin.name%>/app/javascript/packs/application';
    if (<%=plugin.name%>.Reducers) {
      pluginReducers['<%=plugin.name%>'] = <%=plugin.name%>.Reducers;
    }
    if (<%=plugin.name%>.Container) {
      pluginContainers['<%=plugin.name%>'] = <%=plugin.name%>.Container;
    }
  <% end %>
<% end %>

document.addEventListener('DOMContentLoaded', () => {
  const elements = document.getElementsByClassName('content');
  const content = elements.length > 0 ? elements[0] : document.body;
  const containers = [];

  // loop over available react containers
  for(let pluginName of Object.keys(pluginContainers)) {
    // try to find the plugin specific react container
    let domElement = document.getElementById(pluginName+'_react_container');å  

    if (domElement) { // plugin react container exists!
      // remove domElement, cause we are going to create a new one.
      domElement.parentNode.removeChild(domElement);
      // create react component and add it to containers
      containers.push(React.createElement(pluginContainers[pluginName], Object.assign({}, {
        key: pluginName<commit_msg>remove å  from application.js.erb<commit_after>/* eslint no-console:0 */

import "babel-polyfill";

import { configureStore, addReducer } from 'store';
import React from 'react';
import ReactDOM from 'react-dom';
import { Provider } from 'react-redux';
import { configureAjaxHelper } from 'ajax_helper';
import { setPolicy } from 'policy';
import { FlashMessages } from 'lib/flashes';
import dialogs from 'lib/dialogs';

var pluginReducers = {};
var pluginContainers = {};

<% Core::PluginsManager.mountable_plugins.each do |plugin| %>
  <% if File.exists?(File.expand_path("plugins/#{plugin.name}/app/javascript/packs", __dir__)) %>
    import <%=plugin.name%> from '../../../plugins/<%=plugin.name%>/app/javascript/packs/application';
    if (<%=plugin.name%>.Reducers) {
      pluginReducers['<%=plugin.name%>'] = <%=plugin.name%>.Reducers;
    }
    if (<%=plugin.name%>.Container) {
      pluginContainers['<%=plugin.name%>'] = <%=plugin.name%>.Container;
    }
  <% end %>
<% end %>

document.addEventListener('DOMContentLoaded', () => {
  const elements = document.getElementsByClassName('content');
  const content = elements.length > 0 ? elements[0] : document.body;
  const containers = [];

  // loop over available react containers
  for(let pluginName of Object.keys(pluginContainers)) {
    // try to find the plugin specific react container
    let domElement = document.getElementById(pluginName+'_react_container');

    if (domElement) { // plugin react container exists!
      // remove domElement, cause we are going to create a new one.
      domElement.parentNode.removeChild(domElement);
      // create react component and add it to containers
      containers.push(React.createElement(pluginContainers[pluginName], Object.assign({}, {
        key: pluginName
{'fraction_non_alphanumeric': 0.1515919977458439, 'fraction_numerical': 0.0016906170752324597, 'mean_word_length': 4.2592592592592595, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 31, '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': '1200623', 'n_tokens_mistral': 1066, 'n_tokens_neox': 1021, 'n_words': 250}