<commit_before>"use strict";

import React from 'react'
import ReactDOM from 'react-dom'
import './styles/main.scss'
import CalculatorSmall from './components/calculatorSmall/CalculatorSmall'
import CalculatorLarge from './components/calculatorLarge/CalculatorLarge'
import TablePrices from './components/tablePrices/TablePrices'
import createStore from './store/createStore'
import initialState from './store/initState';
import {Provider} from 'react-redux';
import {fetchInitTree, fetchStatistic, fetchCoupon, fetchUser} from './store/actions';


// Store Initialization
// ------------------------------------
const store = createStore(initialState);
store.dispatch(fetchUser());
store.dispatch(fetchInitTree());

// Render Setup
// ------------------------------------
const MOUNT_NODE_TP = document.getElementById('tp');
const MOUNT_NODE_CL_1 = document.getElementById('cl-1');
// const MOUNT_NODE_CL_2 = document.getElementById('cl-2');
const MOUNT_NODE_1 = document.getElementById('cs-1');
const MOUNT_NODE_2 = document.getElementById('cs-2');
// const MOUNT_NODE_3 = document.getElementById('cs-3');
const MOUNT_NODES = [MOUNT_NODE_TP, MOUNT_NODE_CL_1, MOUNT_NODE_1, MOUNT_NODE_2];
const MOUNT_CLASSES = ['tp','calc-lg', 'calc-sm', 'calc-sm'];

let render = () => {

    MOUNT_NODES.forEach((MOUNT_NODE, i) => {
        if (MOUNT_CLASSES[i].indexOf('calc-lg') !== -1) {
            ReactDOM.render(
                <Provider store={store}>
                    <div>
                        <CalculatorLarge calcId={i}
                                         calcTitle={MOUNT_NODE.dataset.title}
                                         calcTitleDiscount={MOUNT_NODE.dataset.titleDiscount}
                                         containerClass={MOUNT_CLASSES[i]}/>
                    </div>
                </Provider>,<commit_msg>add loading style and fonts from CDN<commit_after>"use strict";

import React from 'react'
import ReactDOM from 'react-dom'
import './styles/main.scss'
import CalculatorSmall from './components/calculatorSmall/CalculatorSmall'
import CalculatorLarge from './components/calculatorLarge/CalculatorLarge'
import TablePrices from './components/tablePrices/TablePrices'
import createStore from './store/createStore'
import initialState from './store/initState';
import {Provider} from 'react-redux';
import {fetchInitTree, fetchStatistic, fetchCoupon, fetchUser} from './store/actions';

const css = 'https://s3.amazonaws.com/genericapps/resources/calculators/main.259b2e5f8db7f0ca0ae3a05093744601.css';
const font = 'https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet';
function loadCSS(filename) {

    const file = document.createElement("link");
    file.setAttribute("rel", "stylesheet");
    file.setAttribute("type", "text/css");
    file.setAttribute("href", filename);
    document.head.appendChild(file);

}
function loadFont(filename) {
    const file = document.createElement("link");
    file.setAttribute("rel", "stylesheet");
    file.setAttribute("href", filename);
    document.head.appendChild(file);
}

// loadCSS(css);
// loadFont(font);

// Store Initialization
// ------------------------------------
const store = createStore(initialState);
store.dispatch(fetchUser());
store.dispatch(fetchInitTree());

// Render Setup
// ------------------------------------
const MOUNT_NODE_TP = document.getElementById('tp');
const MOUNT_NODE_CL_1 = document.getElementById('cl-1');
// const MOUNT_NODE_CL_2 = document.getElementById('cl-2');
const MOUNT_NODE_1 = document.getElementById('cs-1');
const MOUNT_NODE_2 = document.getElementById('cs-2');
// const MOUNT_NODE_3 = document.getElementById('cs-3');
const MOUNT_NODES = [MOUNT_NODE_TP, MOUNT_NODE_CL_1, MOUNT_NODE_1, MOUNT_NODE_2];
const MOUNT_CLASSES = ['tp', 'calc-lg', 'calc-sm', 'calc-sm'];

let render = () => {

    MOUNT_NODES.forEach((MOUNT_NODE, i) => {
        if (MOUNT_CLASSES[i].indexOf('calc-lg') !== -1) {
            ReactDOM.render(
                <Provider store={store}>
                    <div>
                        <CalculatorLarge calcId={i}
                                         calcTitle={MOUNT_NODE.dataset.title}
                                         calcTitleDiscount={MOUNT_NODE.dataset.titleDiscount}
                                         containerClass={MOUNT_CLASSES[i]}/>
                    </div>
                </Provider>,
{'fraction_non_alphanumeric': 0.16317705962676377, 'fraction_numerical': 0.01137915339098771, 'mean_word_length': 2.8518843120070114, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 17, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 12, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6288297', 'n_tokens_mistral': 1263, 'n_tokens_neox': 1225, 'n_words': 235}