<commit_before>import React from 'react';
import { Route, Redirect, IndexRedirect, IndexRoute } from 'react-router';

import { RoutesUtil } from './utils';

// Pages
import AppPage from './pages/app';
import ClassesPage from './pages/classes';
import DashboardPage from './pages/dashboard';
import InstancePage from './pages/instance';
import ProfilePage from './pages/profile';
import ScriptsPage from './pages/scripts';
import SetupPage from './pages/setup';
import NotFoundPage from './pages/notfound';
import PushDevicesPage from './pages/pushDevices';
import ExpiredAccountPage from './pages/expiredAccount';
import FailedPaymentPage from './pages/failedPayment';
import FreeLimitsExceededPage from './pages/freeLimitsExceeded';
import hardLimitReachedPage from './pages/hardLimitReached';
import MaintenancePage from './pages/maintenance';

// Apps
import Account from './apps/Account';
import Profile from './apps/Profile';

// Apps for authenticated users
import Instances from './apps/Instances/Instances';
import InstanceEdit from './apps/Instances/InstanceEdit';
import Solutions from './apps/Solutions';

// Instance Apps
import Admins from './apps/Admins/Admins';
import ApiKeys from './apps/ApiKeys/ApiKeys';
import BackupAndRestore from './apps/BackupAndRestore';
import ChannelHistory from './apps/ChannelHistory';
import Channels from './apps/Channels';
import Classes from './apps/Classes';
import CustomSockets from './apps/CustomSockets';
import ScriptEndpoints from './apps/ScriptEndpoints';
import Script from './apps/Script';
import Scripts from './apps/Scripts';
import DataObjects from './apps/DataObjects/DataObjects';
import DataEndpoints from './apps/DataEndpoints';
import Users from './apps/Users/Users';
import Sockets from './apps/Sockets';
import Snippets from './apps/Snippets';
import Template from './apps/Template';
import Templates from './apps/Templates';
import Triggers from './apps/Triggers';
import Schedules from './apps/Schedules';
import PushNotifications from './apps/PushNotifications';
import PushDevices from './apps/PushDevices';
import Usage from './apps/Usage';
import PushMessages from './apps/PushMessages';
import DemoApps from './apps/DemoApps';
import Hosting from './apps/Hosting';

const handleAppEnter = (nextState, replace) => RoutesUtil.onAppEnter(nextState, replace);
const handleDashboardEnter = (nextState, replace) => RoutesUtil.onDashboardEnter(nextState, replace);
const handleDashboardChange = (prevState, nextState, replace) => (
  RoutesUtil.onDashboardChange(prevState, nextState, replace)
);

export default (
  <Route
    name="app"
    component={AppPage}
    onEnter={handleAppEnter}
    path="/"
  >
    <Route
      name="login"
      path="login"
      component={Account.Login}
      onEnter={RoutesUtil.redirectToDashboard}
    />
    <Route
      name="signup"
      path="signup"
      component={Account.Signup}
      onEnter={RoutesUtil.redirectToDashboard}
    />
    <Route
      name="setup"
      component={SetupPage}
      path="setup"
    />
    <Route
      name="activate"
      component={Account.Activate}
      path="/activate/:uid/:token"
    />
    <Route
      name="password-update"
      component={Account.PasswordUpdate}
      path="/password/update"
    />
    <Route
      name="password-reset"
      component={Account.PasswordReset}
      path="/password/reset"
    />
    <Route
      name="password-reset-confirm"
      component={Account.PasswordResetConfirm}
      path="/password/reset/:uid/:token"
    />

    {/* Dashboard */}
    <Route
      name="dashboard"
      component={DashboardPage}
      onEnter={handleDashboardEnter}
      onChange={handleDashboardChange}
    >
      <Route
        name="instances"
        onEnter={RoutesUtil.checkActiveSubscriptions}
        component={Instances}
        path="/instances/"
      />

      <Route
        name="expired-account"
        component={ExpiredAccountPage}
        path="expired"
      />

      <Route
        name="failed-payment"
        component={FailedPaymentPage}
        path="failed-payment"
      />
<commit_msg>Fix incorrect Instance path in routes<commit_after>import React from 'react';
import { Route, Redirect, IndexRedirect, IndexRoute } from 'react-router';

import { RoutesUtil } from './utils';

// Pages
import AppPage from './pages/app';
import ClassesPage from './pages/classes';
import DashboardPage from './pages/dashboard';
import InstancePage from './pages/instance';
import ProfilePage from './pages/profile';
import ScriptsPage from './pages/scripts';
import SetupPage from './pages/setup';
import NotFoundPage from './pages/notfound';
import PushDevicesPage from './pages/pushDevices';
import ExpiredAccountPage from './pages/expiredAccount';
import FailedPaymentPage from './pages/failedPayment';
import FreeLimitsExceededPage from './pages/freeLimitsExceeded';
import hardLimitReachedPage from './pages/hardLimitReached';
import MaintenancePage from './pages/maintenance';

// Apps
import Account from './apps/Account';
import Profile from './apps/Profile';

// Apps for authenticated users
import Instances from './apps/Instances/Instances';
import InstanceEdit from './apps/Instances/InstanceEdit';
import Solutions from './apps/Solutions';

// Instance Apps
import Admins from './apps/Admins/Admins';
import ApiKeys from './apps/ApiKeys/ApiKeys';
import BackupAndRestore from './apps/BackupAndRestore';
import ChannelHistory from './apps/ChannelHistory';
import Channels from './apps/Channels';
import Classes from './apps/Classes';
import CustomSockets from './apps/CustomSockets';
import ScriptEndpoints from './apps/ScriptEndpoints';
import Script from './apps/Script';
import Scripts from './apps/Scripts';
import DataObjects from './apps/DataObjects/DataObjects';
import DataEndpoints from './apps/DataEndpoints';
import Users from './apps/Users/Users';
import Sockets from './apps/Sockets';
import Snippets from './apps/Snippets';
import Template from './apps/Template';
import Templates from './apps/Templates';
import Triggers from './apps/Triggers';
import Schedules from './apps/Schedules';
import PushNotifications from './apps/PushNotifications';
import PushDevices from './apps/PushDevices';
import Usage from './apps/Usage';
import PushMessages from './apps/PushMessages';
import DemoApps from './apps/DemoApps';
import Hosting from './apps/Hosting';

const handleAppEnter = (nextState, replace) => RoutesUtil.onAppEnter(nextState, replace);
const handleDashboardEnter = (nextState, replace) => RoutesUtil.onDashboardEnter(nextState, replace);
const handleDashboardChange = (prevState, nextState, replace) => (
  RoutesUtil.onDashboardChange(prevState, nextState, replace)
);

export default (
  <Route
    name="app"
    component={AppPage}
    onEnter={handleAppEnter}
    path="/"
  >
    <Route
      name="login"
      path="login"
      component={Account.Login}
      onEnter={RoutesUtil.redirectToDashboard}
    />
    <Route
      name="signup"
      path="signup"
      component={Account.Signup}
      onEnter={RoutesUtil.redirectToDashboard}
    />
    <Route
      name="setup"
      component={SetupPage}
      path="setup"
    />
    <Route
      name="activate"
      component={Account.Activate}
      path="/activate/:uid/:token"
    />
    <Route
      name="password-update"
      component={Account.PasswordUpdate}
      path="/password/update"
    />
    <Route
      name="password-reset"
      component={Account.PasswordReset}
      path="/password/reset"
    />
    <Route
      name="password-reset-confirm"
      component={Account.PasswordResetConfirm}
      path="/password/reset/:uid/:token"
    />

    {/* Dashboard */}
    <Route
      name="dashboard"
      component={DashboardPage}
      onEnter={handleDashboardEnter}
      onChange={handleDashboardChange}
    >
      <Route
        name="instances"
        onEnter={RoutesUtil.checkActiveSubscriptions}
        component={Instances}
        path="instances"
      />

      <Route
        name="expired-account"
        component={ExpiredAccountPage}
        path="expired"
      />

      <Route
        name="failed-payment"
        component={FailedPaymentPage}
        path="failed-payment"
      />

{'fraction_non_alphanumeric': 0.12995862740326114, 'fraction_numerical': 0.0, 'mean_word_length': 3.6698863636363637, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 33, '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': '5473166', 'n_tokens_mistral': 2296, 'n_tokens_neox': 2294, 'n_words': 555}