<commit_before>import React from 'react'
import ReactDOM from 'react-dom'
import Cookies from 'cookies-js'
import { AuthStatic } from 'desktop/apps/auth2/components/AuthStatic'
import { MobileAuthStatic } from 'desktop/apps/auth2/components/MobileAuthStatic'
import { ModalManager } from '@artsy/reaction/dist/Components/Authentication/Desktop/ModalManager'
import { handleSubmit } from '../helpers'
import { data as sd } from 'sharify'

const mediator = require('../../../lib/mediator.coffee')

export const init = () => {
  // Rehydrate data from Server
  const bootstrapData = (window as any).__BOOTSTRAP__
  const el = document.getElementById('react-root')
  const Component = sd.IS_MOBILE ? MobileAuthStatic : AuthStatic

  if (el) {
    // Start app
    // ReactDOM.hydrate(<AuthStatic {...bootstrapData} />, el)
    ReactDOM.hydrate(<Component {...bootstrapData} />, el)
  }
}

export const initModalManager = () => {
  const el = document.getElementById('react-modal-container')

  const Container: React.SFC<any> = () => {
    let manager: ModalManager | null

    mediator.on('open:auth', options => {
      if (options.afterSignUpAction) {
        Cookies.set(
          'postSignupAction',
          JSON.stringify(options.afterSignUpAction)
        )
      }

      if (options.destination) {
        Cookies.set('destination', options.destination, {
          expires: 60 * 60 * 24,
        })
      }

      // TODO: remember to swap 'register' with 'signup' in triggers
      if (options.mode === 'register') {
        options.mode = 'signup'
      }

      if (manager) {
        manager.openModal(options)<commit_msg>remove comment<commit_after>import React from 'react'
import ReactDOM from 'react-dom'
import Cookies from 'cookies-js'
import { AuthStatic } from 'desktop/apps/auth2/components/AuthStatic'
import { MobileAuthStatic } from 'desktop/apps/auth2/components/MobileAuthStatic'
import { ModalManager } from '@artsy/reaction/dist/Components/Authentication/Desktop/ModalManager'
import { handleSubmit } from '../helpers'
import { data as sd } from 'sharify'

const mediator = require('../../../lib/mediator.coffee')

export const init = () => {
  // Rehydrate data from Server
  const bootstrapData = (window as any).__BOOTSTRAP__
  const el = document.getElementById('react-root')
  const Component = sd.IS_MOBILE ? MobileAuthStatic : AuthStatic

  if (el) {
    // Start app
    ReactDOM.hydrate(<Component {...bootstrapData} />, el)
  }
}

export const initModalManager = () => {
  const el = document.getElementById('react-modal-container')

  const Container: React.SFC<any> = () => {
    let manager: ModalManager | null

    mediator.on('open:auth', options => {
      if (options.afterSignUpAction) {
        Cookies.set(
          'postSignupAction',
          JSON.stringify(options.afterSignUpAction)
        )
      }

      if (options.destination) {
        Cookies.set('destination', options.destination, {
          expires: 60 * 60 * 24,
        })
      }

      // TODO: remember to swap 'register' with 'signup' in triggers
      if (options.mode === 'register') {
        options.mode = 'signup'
      }

      if (manager) {
        manager.openModal(options)
{'fraction_non_alphanumeric': 0.13092269326683292, 'fraction_numerical': 0.004987531172069825, 'mean_word_length': 3.0415617128463475, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 16, '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': '4540921', 'n_tokens_mistral': 980, 'n_tokens_neox': 932, 'n_words': 221}