<commit_before>
export enum OperatingSystem {
  Android,
  iOS,
  MacOS,
  Windows,
  Linux,
  Other
}

export function getOperatingSystem(): OperatingSystem {
  const platform = navigator.platform;
  switch (platform) {
    case 'Macintosh':
    case 'MacIntel':
    case 'MacPPC':
    case 'Mac68K':
      return OperatingSystem.MacOS;
    case 'iPhone':
    case 'iPad':
    case 'iPod':
      return OperatingSystem.iOS;
    case 'Win32':
    case 'Win64':
    case 'Windows':
    case 'WinCE':
      return OperatingSystem.Windows;
  }
  const userAgent = navigator.userAgent;
  if (/Android/.test(userAgent)) {
    return OperatingSystem.Android;
  } else if (/Linux/.test(platform)) {
    return OperatingSystem.Linux;
  } else {
    return OperatingSystem.Other;
  }
}

export function isInStandaloneMode() {
  return (window.matchMedia('(display-mode: standalone)').matches)
    || ('standalone' in window.navigator && (window.navigator as any).standalone)
    || document.referrer.includes('android-app://');
}

export function disableTouchSelection() {
  (document.body.style as any)['-webkit-user-select'] = 'none';
}

export function disablePinchZoom() {
  let viewportMeta = document.querySelector('meta[name="viewport"]');
  if (!viewportMeta) {
    viewportMeta = document.createElement('meta');
  }
  let content = viewportMeta.getAttribute('content') || '';
  content = content ? content + ', user-scalable=no' : 'user-scalable=no';
  viewportMeta.setAttribute('content', content);
}

export function isMobileDevice(): boolean {
  // use media queries
  return !!window.matchMedia("only screen and (hover: none) and (pointer: coarse)").matches;
}
<commit_msg>Fixed showing unsupported message on some phones.<commit_after>
export enum OperatingSystem {
  Android,
  iOS,
  MacOS,
  Windows,
  Linux,
  Other
}

export function getOperatingSystem(): OperatingSystem {
  const platform = navigator.platform;
  switch (platform) {
    case 'Macintosh':
    case 'MacIntel':
    case 'MacPPC':
    case 'Mac68K':
      return OperatingSystem.MacOS;
    case 'iPhone':
    case 'iPad':
    case 'iPod':
      return OperatingSystem.iOS;
    case 'Win32':
    case 'Win64':
    case 'Windows':
    case 'WinCE':
      return OperatingSystem.Windows;
  }
  const userAgent = navigator.userAgent;
  if (/Android/.test(userAgent)) {
    return OperatingSystem.Android;
  } else if (/Linux/.test(platform)) {
    return OperatingSystem.Linux;
  } else {
    return OperatingSystem.Other;
  }
}

export function isInStandaloneMode() {
  return (window.matchMedia('(display-mode: standalone)').matches)
    || ('standalone' in window.navigator && (window.navigator as any).standalone)
    || document.referrer.includes('android-app://');
}

export function disableTouchSelection() {
  (document.body.style as any)['-webkit-user-select'] = 'none';
}

export function disablePinchZoom() {
  let viewportMeta = document.querySelector('meta[name="viewport"]');
  if (!viewportMeta) {
    viewportMeta = document.createElement('meta');
  }
  let content = viewportMeta.getAttribute('content') || '';
  content = content ? content + ', user-scalable=no' : 'user-scalable=no';
  viewportMeta.setAttribute('content', content);
}

export function isMobileDevice(): boolean {
  // use media queries
  return window.matchMedia('only screen and (hover: none) and (pointer: coarse)').matches ||
    window.matchMedia('only screen and (hover: none) and (pointer: fine)').matches;
}

{'fraction_non_alphanumeric': 0.13788140472078295, 'fraction_numerical': 0.0034542314335060447, 'mean_word_length': 4.0, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '330073', 'n_tokens_mistral': 1079, 'n_tokens_neox': 1047, 'n_words': 250}