<commit_before>'use strict';

function makeEnum(keys, extra) {
  var obj = {};
  for (var i=0, key=keys[i]; key; key=keys[++i]) {
    obj[key] = key;
  }
  if (extra) {
    for (var key in extra)
      obj[key] = extra[key];
  }
  return obj;
}

var DEFAULT_LANG = 'en_US',
    DEFAULT_DIRECTION = 'ltr',
    LANGS = {
      // http://www.omniglot.com/language/names.htm
      en_US: {dir: 'ltr', name: 'English'},
      de: {dir: 'ltr', name: 'Deutsch'},
      fr_FR: {dir: 'ltr', name: 'français'},
      fr_CA: {dir: 'ltr', name: 'français (Canada)'},
      ca: {dir: 'ltr', name: 'català'},
      pt_BR: {dir: 'ltr', name: 'português'},
      fa_IR: {dir: 'rtl', name: 'پارسی'},
      zh_CN: {dir: 'ltr', name: '中文'},
      nl: {dir: 'ltr', name: 'Nederlands'},
      sk: {dir: 'ltr', name: 'slovenčina'},
      cs: {dir: 'ltr', name: 'čeština'},
      sv: {dir: 'ltr', name: 'Svenska'},
      ja: {dir: 'ltr', name: '日本語'},
      ua_UK: {dir: 'ltr', name: 'Українська'},
      es: {dir: 'ltr', name: 'español'}
    //ar: {dir: 'rtl', name: 'العربية'}
    },
    GOOGLE_ANALYTICS_WEBPROP_ID = 'UA-21815217-2',
    GOOGLE_ANALYTICS_DISABLE_KEY = 'ga-disable-'+GOOGLE_ANALYTICS_WEBPROP_ID,
    loc = typeof location == 'object' ? location : undefined,
    // this allows the real backend to mount the entire app under a random path
    // for security while the mock backend can always use '/app':
    APP_MOUNT_POINT = loc ? loc.pathname.split('/')[1] : 'app',
    API_MOUNT_POINT = 'api',
    COMETD_MOUNT_POINT = 'cometd',
    COMETD_URL = loc && loc.protocol+'//'+loc.host+'/'+APP_MOUNT_POINT+'/'+COMETD_MOUNT_POINT,
    REQUIRED_API_VER = {major: 0, minor: 0}, // api version required by frontend
    REQ_VER_STR = [REQUIRED_API_VER.major, REQUIRED_API_VER.minor].join('.'),
    API_URL_PREFIX = ['', APP_MOUNT_POINT, API_MOUNT_POINT, REQ_VER_STR].join('/'),
    MODEL_SYNC_CHANNEL = '/sync',
    CONTACT_FORM_MAXLEN = 500000,
    INPUT_PAT = {
      // based on http://www.regular-expressions.info/email.html
      EMAIL: /^[a-zA-Z0-9._%+-]+@(?:[a-zA-Z0-9-]+\.)+[a-zA-Z]{2,}$/,<commit_msg>fix language code for uk_UA<commit_after>'use strict';

function makeEnum(keys, extra) {
  var obj = {};
  for (var i=0, key=keys[i]; key; key=keys[++i]) {
    obj[key] = key;
  }
  if (extra) {
    for (var key in extra)
      obj[key] = extra[key];
  }
  return obj;
}

var DEFAULT_LANG = 'en_US',
    DEFAULT_DIRECTION = 'ltr',
    LANGS = {
      // http://www.omniglot.com/language/names.htm
      en_US: {dir: 'ltr', name: 'English'},
      de: {dir: 'ltr', name: 'Deutsch'},
      fr_FR: {dir: 'ltr', name: 'français'},
      fr_CA: {dir: 'ltr', name: 'français (Canada)'},
      ca: {dir: 'ltr', name: 'català'},
      pt_BR: {dir: 'ltr', name: 'português'},
      fa_IR: {dir: 'rtl', name: 'پارسی'},
      zh_CN: {dir: 'ltr', name: '中文'},
      nl: {dir: 'ltr', name: 'Nederlands'},
      sk: {dir: 'ltr', name: 'slovenčina'},
      cs: {dir: 'ltr', name: 'čeština'},
      sv: {dir: 'ltr', name: 'Svenska'},
      ja: {dir: 'ltr', name: '日本語'},
      uk_UA: {dir: 'ltr', name: 'Українська'},
      es: {dir: 'ltr', name: 'español'}
    //ar: {dir: 'rtl', name: 'العربية'}
    },
    GOOGLE_ANALYTICS_WEBPROP_ID = 'UA-21815217-2',
    GOOGLE_ANALYTICS_DISABLE_KEY = 'ga-disable-'+GOOGLE_ANALYTICS_WEBPROP_ID,
    loc = typeof location == 'object' ? location : undefined,
    // this allows the real backend to mount the entire app under a random path
    // for security while the mock backend can always use '/app':
    APP_MOUNT_POINT = loc ? loc.pathname.split('/')[1] : 'app',
    API_MOUNT_POINT = 'api',
    COMETD_MOUNT_POINT = 'cometd',
    COMETD_URL = loc && loc.protocol+'//'+loc.host+'/'+APP_MOUNT_POINT+'/'+COMETD_MOUNT_POINT,
    REQUIRED_API_VER = {major: 0, minor: 0}, // api version required by frontend
    REQ_VER_STR = [REQUIRED_API_VER.major, REQUIRED_API_VER.minor].join('.'),
    API_URL_PREFIX = ['', APP_MOUNT_POINT, API_MOUNT_POINT, REQ_VER_STR].join('/'),
    MODEL_SYNC_CHANNEL = '/sync',
    CONTACT_FORM_MAXLEN = 500000,
    INPUT_PAT = {
      // based on http://www.regular-expressions.info/email.html
      EMAIL: /^[a-zA-Z0-9._%+-]+@(?:[a-zA-Z0-9-]+\.)+[a-zA-Z]{2,}$/,
{'fraction_non_alphanumeric': 0.19771863117870722, 'fraction_numerical': 0.011406844106463879, 'mean_word_length': 3.1880597014925374, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, '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': '2713926', 'n_tokens_mistral': 1784, 'n_tokens_neox': 1730, 'n_words': 375}