<commit_before>// RealVu Analytics Adapter
import adapter from '../src/AnalyticsAdapter.js';
import adapterManager from '../src/adapterManager.js';
import CONSTANTS from '../src/constants.json';
import { getStorageManager } from '../src/storageManager.js';

const storage = getStorageManager();

const utils = require('../src/utils.js');

let realvuAnalyticsAdapter = adapter({
  global: 'realvuAnalytics',
  handler: 'on',
  analyticsType: 'bundle'
});
window.top1 = window;
try {
  let wnd = window;
  while ((window.top1 != top) && (typeof (wnd.document) != 'undefined')) {
    window.top1 = wnd;
    wnd = wnd.parent;
  }
} catch (e) {
  /* continue regardless of error */
}

export let lib = {
  ads: [],
  x1: 0,
  y1: 0,
  x2: 0,
  y2: 0,
  t0: new Date(),
  nn: 0,
  frm: false, // check first if we are inside other domain iframe
  msg: [],
  foc: !window.top1.document.hidden, // 1-in, 0-out of focus
  c: '', // owner id
  sr: '', //
  beacons: [], // array of beacons to collect while 'conf' is not responded
  defer: [],
  init: function () {
    let z = this;
    let u = navigator.userAgent;
    z.device = u.match(/iPad|Tablet/gi) ? 'tablet' : u.match(/iPhone|iPod|Android|Opera Mini|IEMobile/gi) ? 'mobile' : 'desktop';
    if (typeof (z.len) == 'undefined') z.len = 0;
    z.ie = navigator.appVersion.match(/MSIE/);
    z.saf = (u.match(/Safari/) && !u.match(/Chrome/));
    z.ff = u.match(/Firefox/i);
    z.cr = (u.match(/Chrome/));
    z.ope = window.opera;
    z.fr = 0;
    if (window.top1 != top) {
      z.fr = 2;
      if (typeof window.top1.$sf != 'undefined') {
        z.fr = 1;
      }
    }
    z.add_evt(window.top1, 'focus', function () {
      window.top1.realvu_aa.foc = 1;
    });
    z.add_evt(window.top1, 'scroll', function () {
      window.top1.realvu_aa.foc = 1;
    });
    z.add_evt(window.top1, 'blur', function () {
      window.top1.realvu_aa.foc = 0;
    });
    z.add_evt(window.top1.document, 'blur', function () {
      window.top1.realvu_aa.foc = 0;
    });
    z.add_evt(window.top1, 'visibilitychange', function () {
      window.top1.realvu_aa.foc = !window.top1.document.hidden;
    });
    z.doLog = (window.top1.location.search.match(/boost_log/) || document.referrer.match(/boost_log/)) ? 1 : 0;<commit_msg>RealVu Analytics Adapter: remove "tablet" from device types (#7016)<commit_after>// RealVu Analytics Adapter
import adapter from '../src/AnalyticsAdapter.js';
import adapterManager from '../src/adapterManager.js';
import CONSTANTS from '../src/constants.json';
import { getStorageManager } from '../src/storageManager.js';

const storage = getStorageManager();

const utils = require('../src/utils.js');

let realvuAnalyticsAdapter = adapter({
  global: 'realvuAnalytics',
  handler: 'on',
  analyticsType: 'bundle'
});
window.top1 = window;
try {
  let wnd = window;
  while ((window.top1 != top) && (typeof (wnd.document) != 'undefined')) {
    window.top1 = wnd;
    wnd = wnd.parent;
  }
} catch (e) {
  /* continue regardless of error */
}

export let lib = {
  ads: [],
  x1: 0,
  y1: 0,
  x2: 0,
  y2: 0,
  t0: new Date(),
  nn: 0,
  frm: false, // check first if we are inside other domain iframe
  msg: [],
  foc: !window.top1.document.hidden, // 1-in, 0-out of focus
  c: '', // owner id
  sr: '', //
  beacons: [], // array of beacons to collect while 'conf' is not responded
  defer: [],
  init: function () {
    let z = this;
    let u = navigator.userAgent;
    z.device = u.match(/iPhone|iPod|Android|Opera Mini|IEMobile/gi) ? 'mobile' : 'desktop';
    if (typeof (z.len) == 'undefined') z.len = 0;
    z.ie = navigator.appVersion.match(/MSIE/);
    z.saf = (u.match(/Safari/) && !u.match(/Chrome/));
    z.ff = u.match(/Firefox/i);
    z.cr = (u.match(/Chrome/));
    z.ope = window.opera;
    z.fr = 0;
    if (window.top1 != top) {
      z.fr = 2;
      if (typeof window.top1.$sf != 'undefined') {
        z.fr = 1;
      }
    }
    z.add_evt(window.top1, 'focus', function () {
      window.top1.realvu_aa.foc = 1;
    });
    z.add_evt(window.top1, 'scroll', function () {
      window.top1.realvu_aa.foc = 1;
    });
    z.add_evt(window.top1, 'blur', function () {
      window.top1.realvu_aa.foc = 0;
    });
    z.add_evt(window.top1.document, 'blur', function () {
      window.top1.realvu_aa.foc = 0;
    });
    z.add_evt(window.top1, 'visibilitychange', function () {
      window.top1.realvu_aa.foc = !window.top1.document.hidden;
    });
    z.doLog = (window.top1.location.search.match(/boost_log/) || document.referrer.match(/boost_log/)) ? 1 : 0;
{'fraction_non_alphanumeric': 0.18293755496921724, 'fraction_numerical': 0.018469656992084433, 'mean_word_length': 2.8035117056856187, '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': '2470557', 'n_tokens_mistral': 1765, 'n_tokens_neox': 1710, 'n_words': 371}