Guest User

tracker.js deobfuscated

a guest
Nov 21st, 2018
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 'use strict';
  2. (function(window, document, undefined) {
  3.   /**
  4.    * @param {!Function} source
  5.    * @param {string} name
  6.    * @param {boolean} bool
  7.    * @return {?}
  8.    */
  9.   function require(source, name, bool) {
  10.     return function() {
  11.       try {
  12.         return source.apply(this, arguments);
  13.       } catch (moduleLoader) {
  14.         if (!bool) {
  15.           load(moduleLoader, name);
  16.         }
  17.       }
  18.     };
  19.   }
  20.   /**
  21.    * @param {!Object} e
  22.    * @param {string} node
  23.    * @return {undefined}
  24.    */
  25.   function load(e, node) {
  26.     var c;
  27.     if (.01 > Math.random()) {
  28.       try {
  29.         var validPlugins = e && e.message || "";
  30.         if (!(c = -1 < validPlugins.indexOf("network error occurred") || -1 < validPlugins.indexOf("send beacon") && -1 < validPlugins.indexOf("Content Security Policy"))) {
  31.           (new Event).log("jserrs", k, e.message, node, result.href, "", "string" === typeof e.stack && e.stack.replace(/\n/g, "\\n"));
  32.         }
  33.       } catch (e) {
  34.       }
  35.     }
  36.   }
  37.   /**
  38.    * @param {string} p
  39.    * @param {?} record
  40.    * @param {?} e
  41.    * @param {string} d
  42.    * @param {!Object} config
  43.    * @return {?}
  44.    */
  45.   function init(p, record, e, d, config) {
  46.     /**
  47.      * @param {number} end
  48.      * @return {undefined}
  49.      */
  50.     function find(end) {
  51.       /** @type {number} */
  52.       var start = (new Date).getTime();
  53.       if (end && start < end) {
  54.         fullPath = fullPath + (end - start + 20);
  55.       }
  56.       _.setTimeout(function() {
  57.         find(start);
  58.       }, 20, "timeCorrector");
  59.     }
  60.     /**
  61.      * @return {?}
  62.      */
  63.     function ajax() {
  64.       var tmp_step_diff = (new Date).getTime() + fullPath;
  65.       if (tmp_step_diff < best_part_step_diff) {
  66.         tmp_step_diff = best_part_step_diff + 10;
  67.       }
  68.       return best_part_step_diff = tmp_step_diff;
  69.     }
  70.     /**
  71.      * @return {?}
  72.      */
  73.     function push() {
  74.       return Math.round((ajax() - request) / 50);
  75.     }
  76.     /**
  77.      * @param {!Array} b
  78.      * @param {number} a
  79.      * @return {undefined}
  80.      */
  81.     function r(b, a) {
  82.       /** @type {number} */
  83.       a = Math.max(0, Math.min(a, 65535));
  84.       _.mergeArrays(b, [a >> 8, a & 255]);
  85.     }
  86.     /**
  87.      * @param {!Array} obj
  88.      * @param {number} id
  89.      * @return {undefined}
  90.      */
  91.     function $(obj, id) {
  92.       _.mergeArrays(obj, [id & 255]);
  93.     }
  94.     /**
  95.      * @param {!Array} obj
  96.      * @param {number} value
  97.      * @return {undefined}
  98.      */
  99.     function test(obj, value) {
  100.       /** @type {number} */
  101.       value = Math.max(0, value | 0);
  102.       for (; 127 < value;) {
  103.         _.mergeArrays(obj, [value & 127 | 128]);
  104.         /** @type {number} */
  105.         value = value >> 7;
  106.       }
  107.       _.mergeArrays(obj, [value]);
  108.     }
  109.     /**
  110.      * @param {!Array} n
  111.      * @param {string} v
  112.      * @return {undefined}
  113.      */
  114.     function cb(n, v) {
  115.       if (255 < v.length) {
  116.         v = v.substr(0, 255);
  117.       }
  118.       _.mergeArrays(n, [v.length]);
  119.       /** @type {number} */
  120.       var i = 0;
  121.       for (; i < v.length; i++) {
  122.         r(n, v.charCodeAt(i));
  123.       }
  124.     }
  125.     /**
  126.      * @param {!Array} a
  127.      * @param {string} b
  128.      * @return {undefined}
  129.      */
  130.     function m(a, b) {
  131.       test(a, b.length);
  132.       /** @type {number} */
  133.       var i = 0;
  134.       for (; i < b.length; i++) {
  135.         test(a, b.charCodeAt(i));
  136.       }
  137.     }
  138.     /**
  139.      * @param {!Object} value
  140.      * @return {?}
  141.      */
  142.     function notify(value) {
  143.       if (!value.nodeName) {
  144.         return value[j] = -1, null;
  145.       }
  146.       /** @type {number} */
  147.       var i = +value[j];
  148.       if (!isFinite(i) || 0 >= i) {
  149.         return null;
  150.       }
  151.       if (value.attributes) {
  152.         /** @type {!Object} */
  153.         var parent = value;
  154.         for (; parent;) {
  155.           if (parent.attributes.__ym_wv_ign) {
  156.             return null;
  157.           }
  158.           parent = parent.parentElement;
  159.         }
  160.       }
  161.       /** @type {number} */
  162.       parent = 64;
  163.       /** @type {number} */
  164.       var b = 0;
  165.       var a = util.getElementParent(value);
  166.       var inOther = a && a[j] ? a[j] : 0;
  167.       if (0 > inOther) {
  168.         /** @type {number} */
  169.         inOther = 0;
  170.       }
  171.       var c = value.nodeName.toUpperCase();
  172.       var params = typeMap[c];
  173.       if (!params) {
  174.         /** @type {number} */
  175.         parent = parent | 2;
  176.       }
  177.       var s = util.getElementNeighborPosition(value);
  178.       if (!s) {
  179.         /** @type {number} */
  180.         parent = parent | 4;
  181.       }
  182.       var obj = util.getElementRegion(value);
  183.       if ((a = a ? util.getElementRegion(a) : null) && obj[0] == a[0] && obj[1] == a[1] && obj[2] == a[2] && obj[3] == a[3]) {
  184.         /** @type {number} */
  185.         parent = parent | 8;
  186.       }
  187.       json[i].pos = obj[0] + "x" + obj[1];
  188.       json[i].size = obj[2] + "x" + obj[3];
  189.       if (value.id && "string" == typeof value.id) {
  190.         /** @type {number} */
  191.         parent = parent | 32;
  192.       }
  193.       if (a = util.calcTextChecksum(value)) {
  194.         /** @type {number} */
  195.         parent = parent | 16;
  196.       }
  197.       var f = util.calcAttribChecksum(value);
  198.       if (f) {
  199.         /** @type {number} */
  200.         b = b | 2;
  201.       }
  202.       a: {
  203.         var n = util.getElementChildren(util.getElementParent(value), value.tagName);
  204.         /** @type {number} */
  205.         var i = 0;
  206.         for (; i < n.length; i++) {
  207.           if ((!n[i].id || "string" != typeof n[i].id) && util.calcAttribChecksum(n[i]) == f && util.calcTextChecksum(n[i]) == a) {
  208.             /** @type {boolean} */
  209.             n = true;
  210.             break a;
  211.           }
  212.         }
  213.         /** @type {boolean} */
  214.         n = false;
  215.       }
  216.       if (n) {
  217.         /** @type {number} */
  218.         parent = parent | 1;
  219.         var b = util.calcChildrenChecksum(value);
  220.       }
  221.       /** @type {!Array} */
  222.       n = [];
  223.       $(n, 1);
  224.       test(n, i);
  225.       $(n, parent);
  226.       test(n, inOther);
  227.       if (params) {
  228.         $(n, params);
  229.       } else {
  230.         cb(n, c);
  231.       }
  232.       if (s) {
  233.         test(n, s);
  234.       }
  235.       if (!(parent & 8)) {
  236.         test(n, obj[0]);
  237.         test(n, obj[1]);
  238.         test(n, obj[2]);
  239.         test(n, obj[3]);
  240.       }
  241.       if (parent & 32) {
  242.         cb(n, value.id);
  243.       }
  244.       if (a) {
  245.         r(n, a);
  246.       }
  247.       if (parent & 1) {
  248.         r(n, b);
  249.       }
  250.       $(n, b);
  251.       if (f) {
  252.         r(n, f);
  253.       }
  254.       return n;
  255.     }
  256.     /**
  257.      * @param {number} s
  258.      * @param {string} hash
  259.      * @param {!Object} el
  260.      * @param {!Object} v
  261.      * @param {?} h
  262.      * @param {?} w
  263.      * @return {?}
  264.      */
  265.     function constructor(s, hash, el, v, h, w) {
  266.       var val;
  267.       for (; el && (val = util.getElementSize(el)) && (!val[0] || !val[1]);) {
  268.         el = util.getElementParent(el);
  269.       }
  270.       if (!el) {
  271.         return null;
  272.       }
  273.       val = el[j];
  274.       if (!val || 0 > val) {
  275.         return null;
  276.       }
  277.       var torrent = {
  278.         mousemove : 2,
  279.         click : 32,
  280.         dblclick : 33,
  281.         mousedown : 4,
  282.         mouseup : 30,
  283.         touch : 12
  284.       }[hash];
  285.       if (!torrent) {
  286.         return null;
  287.       }
  288.       var p = util.getElementXY(el);
  289.       /** @type {!Array} */
  290.       el = [];
  291.       $(el, torrent);
  292.       test(el, s);
  293.       test(el, val);
  294.       test(el, Math.max(0, v[0] - p[0]));
  295.       test(el, Math.max(0, v[1] - p[1]));
  296.       if (/^mouse(up|down)|click$/.test(hash)) {
  297.         s = h || w;
  298.         $(el, 2 > s ? 1 : s == (h ? 2 : 4) ? 4 : 2);
  299.       }
  300.       return el;
  301.     }
  302.     /**
  303.      * @param {undefined} _
  304.      * @param {number} prev
  305.      * @param {!Object} p
  306.      * @param {undefined} area
  307.      * @return {?}
  308.      */
  309.     function value(_, prev, p, area) {
  310.       prev = prev[j];
  311.       if (!prev || 0 > prev) {
  312.         return null;
  313.       }
  314.       /** @type {!Array} */
  315.       var returnValue = [];
  316.       $(returnValue, 31);
  317.       test(returnValue, _);
  318.       test(returnValue, prev);
  319.       test(returnValue, p[0]);
  320.       test(returnValue, p[1]);
  321.       $(returnValue, 0);
  322.       $(returnValue, 0);
  323.       $(returnValue, area);
  324.       return returnValue;
  325.     }
  326.     /**
  327.      * @param {undefined} prev
  328.      * @param {!Object} p
  329.      * @return {?}
  330.      */
  331.     function c(prev, p) {
  332.       /** @type {!Array} */
  333.       var b = [];
  334.       $(b, 3);
  335.       test(b, prev);
  336.       test(b, p[0]);
  337.       test(b, p[1]);
  338.       return b;
  339.     }
  340.     /**
  341.      * @param {undefined} obj
  342.      * @param {!Object} a
  343.      * @param {number} b
  344.      * @return {?}
  345.      */
  346.     function F(obj, a, b) {
  347.       /** @type {!Array} */
  348.       var res = [];
  349.       b = b[j];
  350.       if (!b || 0 > b) {
  351.         return null;
  352.       }
  353.       $(res, 16);
  354.       test(res, obj);
  355.       test(res, a[0]);
  356.       test(res, a[1]);
  357.       test(res, b);
  358.       return res;
  359.     }
  360.     /**
  361.      * @param {undefined} message
  362.      * @param {!Object} spec
  363.      * @param {!Object} obj
  364.      * @return {?}
  365.      */
  366.     function api(message, spec, obj) {
  367.       /** @type {!Array} */
  368.       var get = [];
  369.       $(get, 28);
  370.       test(get, message);
  371.       test(get, spec[0]);
  372.       test(get, spec[1]);
  373.       test(get, obj[0]);
  374.       test(get, obj[1]);
  375.       return get;
  376.     }
  377.     /**
  378.      * @param {number} b
  379.      * @param {undefined} a
  380.      * @param {undefined} parent
  381.      * @param {!Object} input
  382.      * @param {boolean} fn
  383.      * @return {?}
  384.      */
  385.     function A(b, a, parent, input, fn) {
  386.       /** @type {!Array} */
  387.       var n = [];
  388.       $(n, 38);
  389.       test(n, b);
  390.       r(n, a);
  391.       $(n, parent);
  392.       b = input[j];
  393.       if (!b || 0 > b) {
  394.         /** @type {number} */
  395.         b = 0;
  396.       }
  397.       test(n, b);
  398.       $(n, fn ? 1 : 0);
  399.       return n;
  400.     }
  401.     /**
  402.      * @param {undefined} a
  403.      * @param {number} b
  404.      * @return {?}
  405.      */
  406.     function L(a, b) {
  407.       var c;
  408.       if (0 == b.length) {
  409.         /** @type {string} */
  410.         var t = c = "";
  411.       } else {
  412.         if (100 >= b.length) {
  413.           /** @type {number} */
  414.           c = b;
  415.           /** @type {string} */
  416.           t = "";
  417.         } else {
  418.           if (200 >= b.length) {
  419.             c = b.substr(0, 100);
  420.             t = b.substr(100);
  421.           } else {
  422.             c = b.substr(0, 97);
  423.             t = b.substr(b.length - 97);
  424.           }
  425.         }
  426.       }
  427.       /** @type {!Array} */
  428.       var h = [];
  429.       $(h, 29);
  430.       test(h, a);
  431.       m(h, c);
  432.       m(h, t);
  433.       return h;
  434.     }
  435.     /**
  436.      * @param {undefined} fn
  437.      * @return {?}
  438.      */
  439.     function E(fn) {
  440.       /** @type {!Array} */
  441.       var element = [];
  442.       $(element, 27);
  443.       test(element, fn);
  444.       return element;
  445.     }
  446.     /**
  447.      * @param {undefined} fn
  448.      * @return {?}
  449.      */
  450.     function array(fn) {
  451.       /** @type {!Array} */
  452.       var schema = [];
  453.       $(schema, 14);
  454.       test(schema, fn);
  455.       return schema;
  456.     }
  457.     /**
  458.      * @param {undefined} s
  459.      * @return {?}
  460.      */
  461.     function H(s) {
  462.       /** @type {!Array} */
  463.       var val = [];
  464.       $(val, 15);
  465.       test(val, s);
  466.       return val;
  467.     }
  468.     /**
  469.      * @param {undefined} s
  470.      * @param {!Object} t
  471.      * @return {?}
  472.      */
  473.     function y(s, t) {
  474.       /** @type {!Array} */
  475.       var o = [];
  476.       $(o, 17);
  477.       test(o, s);
  478.       test(o, t[j]);
  479.       return o;
  480.     }
  481.     /**
  482.      * @param {undefined} fn
  483.      * @param {!Object} range
  484.      * @return {?}
  485.      */
  486.     function K(fn, range) {
  487.       /** @type {!Array} */
  488.       var value = [];
  489.       $(value, 18);
  490.       test(value, fn);
  491.       test(value, range[j]);
  492.       return value;
  493.     }
  494.     /**
  495.      * @param {undefined} a
  496.      * @param {!Object} obj
  497.      * @param {?} key
  498.      * @param {boolean} setting
  499.      * @return {?}
  500.      */
  501.     function init(a, obj, key, setting) {
  502.       /** @type {!Array} */
  503.       var h = [];
  504.       $(h, 39);
  505.       test(h, a);
  506.       test(h, obj[j]);
  507.       cb(h, String(key));
  508.       $(h, setting ? 1 : 0);
  509.       return h;
  510.     }
  511.     /**
  512.      * @param {!Object} d
  513.      * @return {?}
  514.      */
  515.     function T(d) {
  516.       var count = d[j];
  517.       if (!count || 0 > count || !/^INPUT|SELECT|TEXTAREA$/.test(d.nodeName) || !d.form || on(d.form)) {
  518.         return null;
  519.       }
  520.       var c = util.getFormNumber(d.form);
  521.       if (0 > c) {
  522.         return null;
  523.       }
  524.       var length = "INPUT" == d.nodeName ? {
  525.         text : 0,
  526.         color : 0,
  527.         date : 0,
  528.         datetime : 0,
  529.         "datetime-local" : 0,
  530.         email : 0,
  531.         number : 0,
  532.         range : 0,
  533.         search : 0,
  534.         tel : 0,
  535.         time : 0,
  536.         url : 0,
  537.         month : 0,
  538.         week : 0,
  539.         password : 2,
  540.         radio : 3,
  541.         checkbox : 4,
  542.         file : 6,
  543.         image : 7
  544.       }[d.type] : {
  545.         SELECT : 1,
  546.         TEXTAREA : 5
  547.       }[d.nodeName];
  548.       if ("number" != typeof length) {
  549.         return null;
  550.       }
  551.       /** @type {number} */
  552.       var timemodified = -1;
  553.       var key = d.form.elements;
  554.       var ll = key.length;
  555.       /** @type {number} */
  556.       var i = 0;
  557.       /** @type {number} */
  558.       var timemod = 0;
  559.       for (; i < ll; i++) {
  560.         if (key[i].name == d.name) {
  561.           if (key[i] == d) {
  562.             /** @type {number} */
  563.             timemodified = timemod;
  564.             break;
  565.           }
  566.           timemod++;
  567.         }
  568.       }
  569.       if (0 > timemodified) {
  570.         return null;
  571.       }
  572.       /** @type {!Array} */
  573.       key = [];
  574.       $(key, 7);
  575.       test(key, count);
  576.       test(key, c);
  577.       test(key, length);
  578.       m(key, d.name || "");
  579.       test(key, timemodified);
  580.       return key;
  581.     }
  582.     /**
  583.      * @param {undefined} rule
  584.      * @param {!Element} e
  585.      * @return {?}
  586.      */
  587.     function thumb_click(rule, e) {
  588.       var i = util.getFormNumber(e);
  589.       if (0 > i) {
  590.         return null;
  591.       }
  592.       var data = e.elements;
  593.       var V = data.length;
  594.       /** @type {!Array} */
  595.       var obj = [];
  596.       /** @type {number} */
  597.       var v = 0;
  598.       for (; v < V; v++) {
  599.         if (!util.isEmptyField(data[v])) {
  600.           var vs = data[v][j];
  601.           if (vs && 0 < vs) {
  602.             _.mergeArrays(obj, [vs]);
  603.           }
  604.         }
  605.       }
  606.       /** @type {!Array} */
  607.       data = [];
  608.       $(data, 11);
  609.       test(data, rule);
  610.       test(data, i);
  611.       test(data, obj.length);
  612.       /** @type {number} */
  613.       i = 0;
  614.       for (; i < obj.length; i++) {
  615.         test(data, obj[i]);
  616.       }
  617.       return data;
  618.     }
  619.     /**
  620.      * @return {?}
  621.      */
  622.     function cc() {
  623.       /** @type {!Array} */
  624.       var value = [];
  625.       $(value, 13);
  626.       return value;
  627.     }
  628.     /**
  629.      * @param {!Function} x
  630.      * @param {!Array} b
  631.      * @param {string} opts
  632.      * @return {undefined}
  633.      */
  634.     function replace(x, b, opts) {
  635.       x = x.apply(window, b);
  636.       model.append(x, opts);
  637.     }
  638.     /**
  639.      * @param {string} v
  640.      * @return {undefined}
  641.      */
  642.     function callback(v) {
  643.       if (v[j]) {
  644.         a: {
  645.           var n = push();
  646.           var message = v[j];
  647.           if (0 < message) {
  648.             /** @type {!Array} */
  649.             var item = [];
  650.             v = util.getElementRegion(v);
  651.             var data = json[message];
  652.             var index = v[0] + "x" + v[1];
  653.             var size = v[2] + "x" + v[3];
  654.             if (index != data.pos) {
  655.               data.pos = index;
  656.               $(item, 9);
  657.               test(item, n);
  658.               test(item, message);
  659.               test(item, v[0]);
  660.               test(item, v[1]);
  661.             }
  662.             if (size != data.size) {
  663.               data.size = size;
  664.               $(item, 10);
  665.               test(item, n);
  666.               test(item, message);
  667.               test(item, v[2]);
  668.               test(item, v[3]);
  669.             }
  670.             if (item.length) {
  671.               /** @type {!Array} */
  672.               n = item;
  673.               break a;
  674.             }
  675.           }
  676.           /** @type {null} */
  677.           n = null;
  678.         }
  679.       } else {
  680.         if (n = util.getElementParent(v)) {
  681.           callback(n);
  682.         }
  683.         v[j] = i;
  684.         json[i] = {};
  685.         i++;
  686.         n = notify(v);
  687.         model.append(n, void 0);
  688.         n = T(v);
  689.       }
  690.       model.append(n, void 0);
  691.     }
  692.     /**
  693.      * @param {!Object} element
  694.      * @param {boolean} array
  695.      * @return {?}
  696.      */
  697.     function extend(element, array) {
  698.       var rect = element && util.classNameExists(element, "(ym-disable-keys|-metrika-nokeys)");
  699.       if (array && element) {
  700.         rect = rect || !!util.getElementsByClassName("(ym-disable-keys|-metrika-nokeys)", element).length;
  701.       }
  702.       return rect;
  703.     }
  704.     /**
  705.      * @param {!Object} a
  706.      * @return {?}
  707.      */
  708.     function on(a) {
  709.       return a && util.classNameExists(a, "(ym-disable-submit|-metrika-noform)");
  710.     }
  711.     /**
  712.      * @param {!Object} e
  713.      * @return {undefined}
  714.      */
  715.     function update(e) {
  716.       var n = _this.getTarget(e);
  717.       if (n && "SCROLLBAR" != n.nodeName) {
  718.         if (/^INPUT|SELECT|TEXTAREA|BUTTON$/.test(n.tagName)) {
  719.           if (n[j]) {
  720.             callback(n);
  721.           } else {
  722.             var data = n.form;
  723.             if (data) {
  724.               data = data.elements;
  725.               var nbElts = data.length;
  726.               /** @type {number} */
  727.               var i = 0;
  728.               for (; i < nbElts; i++) {
  729.                 if (/^INPUT|SELECT|TEXTAREA|BUTTON$/.test(data[i].tagName) && !data[i][j]) {
  730.                   callback(data[i]);
  731.                 }
  732.               }
  733.             } else {
  734.               callback(n);
  735.             }
  736.           }
  737.         } else {
  738.           callback(n);
  739.         }
  740.         replace(constructor, [push(), e.type, n, _this.getPos(e), e.which, e.button]);
  741.       }
  742.     }
  743.     /**
  744.      * @param {!Object} value
  745.      * @return {undefined}
  746.      */
  747.     function up(value) {
  748.       update(value);
  749.       run();
  750.     }
  751.     /**
  752.      * @param {!Object} e
  753.      * @return {undefined}
  754.      */
  755.     function view(e) {
  756.       var connectNumber = ajax();
  757.       /** @type {number} */
  758.       var timeSubmittedDiff = connectNumber - concurency;
  759.       if (!(10 > timeSubmittedDiff)) {
  760.         var xy = _this.getPos(e);
  761.         /** @type {number} */
  762.         var lightI = s[0] - xy[0];
  763.         /** @type {number} */
  764.         var lightJ = s[1] - xy[1];
  765.         /** @type {number} */
  766.         lightI = lightI * lightI + lightJ * lightJ;
  767.         if (!(0 >= lightI || 16 > lightI && 100 > timeSubmittedDiff || 20 > timeSubmittedDiff && 256 > lightI)) {
  768.           concurency = connectNumber;
  769.           s = xy;
  770.           update(e);
  771.         }
  772.       }
  773.     }
  774.     /**
  775.      * @return {undefined}
  776.      */
  777.     function remove() {
  778.       var newDeriv = util.getDocumentScroll();
  779.       var connectNumber = ajax();
  780.       if (!(10 > connectNumber - currentNumber || 10 > Math.abs(newDeriv[0] - deriv[0]) && 10 > Math.abs(newDeriv[1] - deriv[1]))) {
  781.         currentNumber = connectNumber;
  782.         deriv = newDeriv;
  783.         replace(c, [push(), newDeriv]);
  784.       }
  785.     }
  786.     /**
  787.      * @param {!Object} el
  788.      * @return {undefined}
  789.      */
  790.     function move(el) {
  791.       if (el = _this.getTarget(el)) {
  792.         /** @type {number} */
  793.         var src = Math.random();
  794.         /** @type {!Array} */
  795.         var count = [el.scrollLeft, el.scrollTop];
  796.         if (el.localId) {
  797.           if (src = cache[el.localId], !src || 10 > Math.abs(count[0] - src[0]) && 10 > Math.abs(count[1] - src[1])) {
  798.             return;
  799.           }
  800.         } else {
  801.           for (; cache[src];) {
  802.             /** @type {number} */
  803.             src = Math.random();
  804.           }
  805.           /** @type {number} */
  806.           el.localId = src;
  807.         }
  808.         /** @type {!Array} */
  809.         cache[el.localId] = count;
  810.         if (el !== document) {
  811.           callback(el);
  812.           replace(F, [push(), count, el]);
  813.         }
  814.       }
  815.     }
  816.     /**
  817.      * @return {undefined}
  818.      */
  819.     function wrap() {
  820.       replace(api, [push(), util.getViewportSize(), util.getDocumentSize()]);
  821.     }
  822.     /**
  823.      * @return {undefined}
  824.      */
  825.     function ctx() {
  826.       replace(cc, [], true);
  827.     }
  828.     /**
  829.      * @param {!Object} event
  830.      * @return {?}
  831.      */
  832.     function switchKey(event) {
  833.       return (event.shiftKey ? 2 : 0) | (event.ctrlKey ? 4 : 0) | (event.altKey ? 1 : 0) | (event.metaKey ? 8 : 0) | (event.ctrlKey || event.altKey ? 16 : 0);
  834.     }
  835.     /**
  836.      * @param {!Object} data
  837.      * @return {?}
  838.      */
  839.     function setData(data) {
  840.       return "INPUT" == data.tagName ? "password" == data.type || data.name && assert.test(data.name) || data.id && assert.test(data.id) : false;
  841.     }
  842.     /**
  843.      * @param {!Object} options
  844.      * @return {?}
  845.      */
  846.     function get(options) {
  847.       if (!options) {
  848.         return {
  849.           ignore : true,
  850.           forceRecord : false,
  851.           isPrivate : false,
  852.           privateFlag : false,
  853.           recordData : true
  854.         };
  855.       }
  856.       /** @type {boolean} */
  857.       var useUTF8ForComment = "password" === options.type || assert.test(options.name) || assert.test(options.id);
  858.       var useUTF8ForFileName = _.reduce(function(b, name) {
  859.         return b || Y_Node.generalRegex.test(options[name]);
  860.       }, false, ["className", "id", "name"]) || Y_Node.placeholderRegex.test(options.placeholder);
  861.       var useCustomEncoding = Y_Node.forceRecordRegex.test(options.className);
  862.       return {
  863.         forceRecord : useCustomEncoding,
  864.         ignore : useUTF8ForComment,
  865.         isPrivate : useUTF8ForFileName,
  866.         privateFlag : !useCustomEncoding && (useUTF8ForFileName || useUTF8ForComment),
  867.         recordData : useCustomEncoding || !(useUTF8ForFileName && config.get("isEU") || useUTF8ForComment)
  868.       };
  869.     }
  870.     /**
  871.      * @param {!Object} name
  872.      * @param {?} count
  873.      * @param {number} bbox
  874.      * @return {undefined}
  875.      */
  876.     function show(name, count, bbox) {
  877.       name = _this.getTarget(name);
  878.       var prop = get(name);
  879.       if (!(prop.ignore || !prop.forceRecord && (prop.isPrivate && config.get("isEU") || extend(name)))) {
  880.         callback(name);
  881.         replace(A, [push(), count, bbox, name, prop.privateFlag]);
  882.       }
  883.     }
  884.     /**
  885.      * @param {!Object} event
  886.      * @return {undefined}
  887.      */
  888.     function handle(event) {
  889.       var e = event.keyCode;
  890.       var nCharCode = switchKey(event);
  891.       if ({
  892.         3 : 1,
  893.         8 : 1,
  894.         9 : 1,
  895.         13 : 1,
  896.         16 : 1,
  897.         17 : 1,
  898.         18 : 1,
  899.         19 : 1,
  900.         20 : 1,
  901.         27 : 1,
  902.         33 : 1,
  903.         34 : 1,
  904.         35 : 1,
  905.         36 : 1,
  906.         37 : 1,
  907.         38 : 1,
  908.         39 : 1,
  909.         40 : 1,
  910.         45 : 1,
  911.         46 : 1,
  912.         91 : 1,
  913.         92 : 1,
  914.         93 : 1,
  915.         106 : 1,
  916.         110 : 1,
  917.         111 : 1,
  918.         144 : 1,
  919.         145 : 1
  920.       }[e] || 112 <= e && 123 >= e || 96 <= e && 105 >= e || nCharCode & 16) {
  921.         if (19 == e && 4 == (nCharCode & -17)) {
  922.           /** @type {number} */
  923.           e = 144;
  924.         }
  925.         show(event, e, nCharCode | 16);
  926.         /** @type {boolean} */
  927.         selfCompletionActive = false;
  928.         _.setTimeout(function() {
  929.           /** @type {boolean} */
  930.           selfCompletionActive = true;
  931.         }, 1, "wvl.keyDown");
  932.         if (!(!(67 == e && nCharCode & 4) || nCharCode & 1 || nCharCode & 2)) {
  933.           open();
  934.         }
  935.       }
  936.     }
  937.     /**
  938.      * @param {!Object} event
  939.      * @return {undefined}
  940.      */
  941.     function listener(event) {
  942.       if (selfCompletionActive && !alreadyMarked && 0 !== event.which) {
  943.         show(event, event.charCode || event.keyCode, switchKey(event));
  944.         /** @type {boolean} */
  945.         alreadyMarked = true;
  946.         _.setTimeout(function() {
  947.           /** @type {boolean} */
  948.           alreadyMarked = false;
  949.         }, 1, "vwl.keyPress");
  950.       }
  951.     }
  952.     /**
  953.      * @return {undefined}
  954.      */
  955.     function run() {
  956.       if (window.getSelection) {
  957.         try {
  958.           /** @type {(Selection|null)} */
  959.           var e = window.getSelection();
  960.         } catch (yb) {
  961.           return;
  962.         }
  963.         /** @type {string} */
  964.         var b = e.toString();
  965.         /** @type {(Node|null)} */
  966.         var target = e.anchorNode;
  967.       } else {
  968.         if (document.selection && document.selection.createRange) {
  969.           /** @type {(ControlRange|TextRange|null)} */
  970.           e = document.selection.createRange();
  971.           /** @type {string} */
  972.           b = e.text;
  973.           /** @type {(Element|null)} */
  974.           target = e.parentElement();
  975.         }
  976.       }
  977.       if ("string" == typeof b) {
  978.         try {
  979.           for (; target && 1 != target.nodeType;) {
  980.             /** @type {(Node|null)} */
  981.             target = target.parentNode;
  982.           }
  983.         } catch (yb) {
  984.           return;
  985.         }
  986.         if (target) {
  987.           e = get(target).privateFlag || extend(target, true);
  988.           target = target.getElementsByTagName("*");
  989.           /** @type {number} */
  990.           var i = 0;
  991.           for (; i < target.length && !e;) {
  992.             e = get(target[i]).privateFlag || extend(target[i], true);
  993.             i++;
  994.           }
  995.           if (b != button) {
  996.             /** @type {string} */
  997.             button = b;
  998.             b = e ? _.map(function() {
  999.               return Y_Node.obfuscatedSymbol;
  1000.             }, b.split("")).join("") : b;
  1001.             replace(L, [push(), b]);
  1002.           }
  1003.         }
  1004.       }
  1005.     }
  1006.     /**
  1007.      * @return {undefined}
  1008.      */
  1009.     function open() {
  1010.       if (!R) {
  1011.         /** @type {boolean} */
  1012.         R = true;
  1013.         if (button) {
  1014.           replace(E, [push()]);
  1015.         }
  1016.         _.setTimeout(function() {
  1017.           /** @type {boolean} */
  1018.           R = false;
  1019.         }, 1, "wvl.copy");
  1020.       }
  1021.     }
  1022.     /**
  1023.      * @return {undefined}
  1024.      */
  1025.     function scope() {
  1026.       if (!fetchDuration) {
  1027.         /** @type {boolean} */
  1028.         fetchDuration = true;
  1029.         replace(array, [push()]);
  1030.       }
  1031.     }
  1032.     /**
  1033.      * @return {undefined}
  1034.      */
  1035.     function hide() {
  1036.       if (fetchDuration) {
  1037.         /** @type {boolean} */
  1038.         fetchDuration = false;
  1039.         replace(H, [push()]);
  1040.       }
  1041.     }
  1042.     /**
  1043.      * @param {!Object} event
  1044.      * @return {undefined}
  1045.      */
  1046.     function handler(event) {
  1047.       if (!fetchDuration || event && !event.fromElement) {
  1048.         scope();
  1049.       }
  1050.     }
  1051.     /**
  1052.      * @param {!Object} event
  1053.      * @return {undefined}
  1054.      */
  1055.     function hover(event) {
  1056.       if (event && !event.toElement) {
  1057.         hide();
  1058.       }
  1059.     }
  1060.     /**
  1061.      * @param {!Object} e
  1062.      * @return {undefined}
  1063.      */
  1064.     function add(e) {
  1065.       if ((e = _this.getTarget(e)) && /^INPUT|SELECT|TEXTAREA|BUTTON$/.test(e.tagName)) {
  1066.         if (e[j]) {
  1067.           callback(e);
  1068.         } else {
  1069.           var data = e.form;
  1070.           if (data) {
  1071.             data = data.elements;
  1072.             var tldCount = data.length;
  1073.             /** @type {number} */
  1074.             var i = 0;
  1075.             for (; i < tldCount; i++) {
  1076.               if (/^INPUT|SELECT|TEXTAREA|BUTTON$/.test(data[i].tagName) && !data[i][j]) {
  1077.                 callback(data[i]);
  1078.               }
  1079.             }
  1080.           } else {
  1081.             callback(e);
  1082.           }
  1083.         }
  1084.         replace(y, [push(), e]);
  1085.       }
  1086.     }
  1087.     /**
  1088.      * @param {!Object} e
  1089.      * @return {undefined}
  1090.      */
  1091.     function onResize(e) {
  1092.       if ((e = _this.getTarget(e)) && /^INPUT|SELECT|TEXTAREA|BUTTON$/.test(e.tagName)) {
  1093.         callback(e);
  1094.         replace(K, [push(), e]);
  1095.       }
  1096.     }
  1097.     /**
  1098.      * @param {!Object} element
  1099.      * @return {undefined}
  1100.      */
  1101.     function onClick(element) {
  1102.       if ((element = _this.getTarget(element)) && !setData(element) && !extend(element) && /^INPUT|SELECT|TEXTAREA$/.test(element.tagName)) {
  1103.         var options = get(element);
  1104.         var min = /^(checkbox|radio)$/.test(element.type) ? element.checked : element.value;
  1105.         min = options.recordData ? min : _.map(function() {
  1106.           return Y_Node.obfuscatedSymbol;
  1107.         }, min.split("")).join("");
  1108.         callback(element);
  1109.         replace(init, [push(), element, min, options.privateFlag]);
  1110.       }
  1111.     }
  1112.     /**
  1113.      * @param {!Object} target
  1114.      * @return {undefined}
  1115.      */
  1116.     function change(target) {
  1117.       if ((target = _this.getTarget(target)) && !on(target) && "FORM" == target.nodeName) {
  1118.         var elements = target.elements;
  1119.         /** @type {number} */
  1120.         var i = 0;
  1121.         for (; i < elements.length; i++) {
  1122.           if (!util.isEmptyField(elements[i])) {
  1123.             callback(elements[i]);
  1124.           }
  1125.         }
  1126.         replace(thumb_click, [push(), target], true);
  1127.       }
  1128.     }
  1129.     /**
  1130.      * @param {!Object} e
  1131.      * @return {undefined}
  1132.      */
  1133.     function start(e) {
  1134.       remove();
  1135.       if (e.touches && e.touches.length) {
  1136.         var cur = _this.getTarget(e);
  1137.         if (cur && cur != document) {
  1138.           callback(cur);
  1139.           /** @type {number} */
  1140.           var i = 0;
  1141.           for (; i < e.touches.length; i++) {
  1142.             replace(constructor, [push(), "touch", cur, [e.touches[i].pageX, e.touches[i].pageY], 0, 0]);
  1143.           }
  1144.         }
  1145.       }
  1146.     }
  1147.     /**
  1148.      * @param {!Object} e
  1149.      * @return {undefined}
  1150.      */
  1151.     function fn(e) {
  1152.       var b = _this.getTarget(e);
  1153.       if (b) {
  1154.         var c;
  1155.         if ("wheel" == e.type) {
  1156.           /** @type {number} */
  1157.           c = 0 < e.deltaY ? 1 : 0 > e.deltaY ? 2 : 0;
  1158.         } else {
  1159.           if ("mousewheel" == e.type) {
  1160.             /** @type {number} */
  1161.             c = 0 < e.wheelDelta ? 2 : 0 > e.wheelDelta ? 1 : 0;
  1162.           }
  1163.         }
  1164.         if (c) {
  1165.           callback(b);
  1166.           replace(value, [push(), b, _this.getPos(e), c]);
  1167.         }
  1168.       }
  1169.     }
  1170.     /**
  1171.      * @param {!Object} params
  1172.      * @return {undefined}
  1173.      */
  1174.     function f(params) {
  1175.       if ((params = _this.getTarget(params)) && "BODY" == params.tagName) {
  1176.         model.append([], true);
  1177.       }
  1178.     }
  1179.     var model = new Model({
  1180.       protocol : p,
  1181.       globalConfig : config,
  1182.       counterId : record,
  1183.       counterType : e,
  1184.       meta : {
  1185.         url : parse().href,
  1186.         hitId : d,
  1187.         timezone : offset,
  1188.         timestamp : date
  1189.       }
  1190.     });
  1191.     var lb = util.getBody();
  1192.     var typeMap = {
  1193.       A : 1,
  1194.       ABBR : 2,
  1195.       ACRONYM : 3,
  1196.       ADDRESS : 4,
  1197.       APPLET : 5,
  1198.       AREA : 6,
  1199.       B : 7,
  1200.       BASE : 8,
  1201.       BASEFONT : 9,
  1202.       BDO : 10,
  1203.       BIG : 11,
  1204.       BLOCKQUOTE : 12,
  1205.       BODY : 13,
  1206.       BR : 14,
  1207.       BUTTON : 15,
  1208.       CAPTION : 16,
  1209.       CENTER : 17,
  1210.       CITE : 18,
  1211.       CODE : 19,
  1212.       COL : 20,
  1213.       COLGROUP : 21,
  1214.       DD : 22,
  1215.       DEL : 23,
  1216.       DFN : 24,
  1217.       DIR : 25,
  1218.       DIV : 26,
  1219.       DL : 27,
  1220.       DT : 28,
  1221.       EM : 29,
  1222.       FIELDSET : 30,
  1223.       FONT : 31,
  1224.       FORM : 32,
  1225.       FRAME : 33,
  1226.       FRAMESET : 34,
  1227.       H1 : 35,
  1228.       H2 : 36,
  1229.       H3 : 37,
  1230.       H4 : 38,
  1231.       H5 : 39,
  1232.       H6 : 40,
  1233.       HEAD : 41,
  1234.       HR : 42,
  1235.       HTML : 43,
  1236.       I : 44,
  1237.       IFRAME : 45,
  1238.       IMG : 46,
  1239.       INPUT : 47,
  1240.       INS : 48,
  1241.       ISINDEX : 49,
  1242.       KBD : 50,
  1243.       LABEL : 51,
  1244.       LEGEND : 52,
  1245.       LI : 53,
  1246.       LINK : 54,
  1247.       MAP : 55,
  1248.       MENU : 56,
  1249.       META : 57,
  1250.       NOFRAMES : 58,
  1251.       NOSCRIPT : 59,
  1252.       OBJECT : 60,
  1253.       OL : 61,
  1254.       OPTGROUP : 62,
  1255.       OPTION : 63,
  1256.       P : 64,
  1257.       PARAM : 65,
  1258.       PRE : 66,
  1259.       Q : 67,
  1260.       S : 68,
  1261.       SAMP : 69,
  1262.       SCRIPT : 70,
  1263.       SELECT : 71,
  1264.       SMALL : 72,
  1265.       SPAN : 73,
  1266.       STRIKE : 74,
  1267.       STRONG : 75,
  1268.       STYLE : 76,
  1269.       SUB : 77,
  1270.       SUP : 78,
  1271.       TABLE : 79,
  1272.       TBODY : 80,
  1273.       TD : 81,
  1274.       TEXTAREA : 82,
  1275.       TFOOT : 83,
  1276.       TH : 84,
  1277.       THEAD : 85,
  1278.       TITLE : 86,
  1279.       TR : 87,
  1280.       TT : 88,
  1281.       U : 89,
  1282.       UL : 90,
  1283.       VAR : 91,
  1284.       NOINDEX : 100
  1285.     };
  1286.     var Y_Node = function() {
  1287.       /** @type {!Array<string>} */
  1288.       var sortedFolderIds = "first(-|\\.|_|\\s){0,2}name last(-|\\.|_|\\s){0,2}name zip postal phone address passport (bank|credit)(-|\\.|_|\\s){0,2}card card(-|\\.|_|\\s){0,2}number card(-|\\.|_|\\s){0,2}holder cvv card(-|\\.|_|\\s){0,2}exp card(-|\\.|_|\\s){0,2}name card.*month card.*year card.*month card.*year password email birth(-|\\.|_|\\s){0,2}(day|date) second(-|\\.|_|\\s){0,2}name third(-|\\.|_|\\s){0,2}name patronymic middle(-|\\.|_|\\s){0,2}name birth(-|\\.|_|\\s){0,2}place house street city flat state".split(" ");
  1289.       return {
  1290.         generalRegex : new RegExp("(" + sortedFolderIds.join("|") + ")", "i"),
  1291.         placeholderRegex : new RegExp("(" + sortedFolderIds.concat("\u0438\u043c\u044f;\u0444\u0430\u043c\u0438\u043b\u0438\u044f;\u043e\u0442\u0447\u0435\u0441\u0442\u0432\u043e;\u0438\u043d\u0434\u0435\u043a\u0441;\u0442\u0435\u043b\u0435\u0444\u043e\u043d;\u0430\u0434\u0440\u0435\u0441;\u043f\u0430\u0441\u043f\u043e\u0440\u0442;\u041d\u043e\u043c\u0435\u0440(-|\\.|_|\\s){0,2}\u043a\u0430\u0440\u0442\u044b;\u0434\u0430\u0442\u0430(-|\\.|_|\\s){0,2} \u0440\u043e\u0436\u0434\u0435\u043d\u0438\u044f;\u0434\u043e\u043c;\u0443\u043b\u0438\u0446\u0430;\u043a\u0432\u0430\u0440\u0442\u0438\u0440\u0430;\u0433\u043e\u0440\u043e\u0434;\u043e\u0431\u043b\u0430\u0441\u0442\u044c".split(";")).join("|") +
  1292.         ")", "i"),
  1293.         forceRecordRegex : /ym-record-keys/i,
  1294.         obfuscatedSymbol : String.fromCharCode(8226),
  1295.         obfuscatedKeyCode : 88
  1296.       };
  1297.     }();
  1298.     /** @type {number} */
  1299.     var fullPath = 0;
  1300.     /** @type {number} */
  1301.     var best_part_step_diff = 0;
  1302.     find(0);
  1303.     /** @type {number} */
  1304.     var i = 1;
  1305.     /** @type {number} */
  1306.     var concurency = 0;
  1307.     /** @type {!Array} */
  1308.     var s = [0, 0];
  1309.     /** @type {number} */
  1310.     var currentNumber = 0;
  1311.     /** @type {!Array} */
  1312.     var deriv = [0, 0];
  1313.     var cache = {};
  1314.     /** @type {!RegExp} */
  1315.     var assert = /^(password|passwd|pswd)$/;
  1316.     /** @type {boolean} */
  1317.     var selfCompletionActive = true;
  1318.     /** @type {boolean} */
  1319.     var alreadyMarked = false;
  1320.     /** @type {string} */
  1321.     var button = "";
  1322.     /** @type {boolean} */
  1323.     var R = false;
  1324.     /** @type {boolean} */
  1325.     var fetchDuration = true;
  1326.     var request = ajax();
  1327.     /** @type {string} */
  1328.     var j = "metrikaId_" + Math.random();
  1329.     var json = {};
  1330.     /** @type {string} */
  1331.     var name = ":submit" + Math.random();
  1332.     if (!_.isMetrikaPlayer()) {
  1333.       self.on(document, "mousemove", view);
  1334.       self.on(document, "click,dblclick,mousedown", update);
  1335.       self.on(document, "mouseup", up);
  1336.       self.on(window, "scroll", remove);
  1337.       if ("onmousewheel" in document) {
  1338.         self.on(document, "mousewheel", fn);
  1339.       } else {
  1340.         self.on(document, "wheel", fn);
  1341.       }
  1342.       self.on(window, "beforeunload", ctx);
  1343.       if (!Cb) {
  1344.         self.on(window, "unload", ctx);
  1345.       }
  1346.       self.on(window, "resize", wrap);
  1347.       self.on(document, "keydown", handle);
  1348.       self.on(document, "keypress", listener);
  1349.       self.on(document, "copy", open);
  1350.       self.on(document, "touchmove,touchstart", start);
  1351.       if (lb) {
  1352.         self.on(document, "mouseleave", f);
  1353.       }
  1354.       if (document.attachEvent && !window.opera) {
  1355.         self.on(document, "focusin", handler);
  1356.         self.on(document, "focusout", hover);
  1357.       } else {
  1358.         self.on(window, "focus", scope);
  1359.         self.on(window, "blur", hide);
  1360.         self.on(document, "blur", hide);
  1361.       }
  1362.       if (document.addEventListener) {
  1363.         self.on(document, "scroll", move);
  1364.         self.on(document, "focus", add);
  1365.         self.on(document, "blur", onResize);
  1366.         self.on(document, "change", onClick);
  1367.         self.on(document, "submit", change);
  1368.       } else {
  1369.         if (document.attachEvent) {
  1370.           self.on(document, "focusin", add);
  1371.           self.on(document, "focusout", onResize);
  1372.           (function() {
  1373.             /** @type {!NodeList<Element>} */
  1374.             var data = document.getElementsByTagName("form");
  1375.             /** @type {number} */
  1376.             var i = 0;
  1377.             for (; i < data.length; i++) {
  1378.               /** @type {!NodeList<Element>} */
  1379.               var a = data[i].getElementsByTagName("*");
  1380.               /** @type {number} */
  1381.               var e = 0;
  1382.               for (; e < a.length; e++) {
  1383.                 if (/^INPUT|SELECT|TEXTAREA$/.test(a[e].tagName)) {
  1384.                   self.on(a[e], "change", onClick);
  1385.                 }
  1386.               }
  1387.               self.on(data[i], "submit", change);
  1388.             }
  1389.           })();
  1390.         }
  1391.       }
  1392.       (function() {
  1393.         /** @type {!NodeList<Element>} */
  1394.         var form = document.getElementsByTagName("form");
  1395.         if (form.length) {
  1396.           /** @type {number} */
  1397.           var i = 0;
  1398.           for (; i < form.length; i++) {
  1399.             var url = form[i].submit;
  1400.             if ("function" === typeof url || "object" === typeof url && /^\s*function submit\(\)/.test(String(url))) {
  1401.               form[i][name] = url;
  1402.               /**
  1403.                * @return {?}
  1404.                */
  1405.               form[i].submit = function() {
  1406.                 change({
  1407.                   target : this
  1408.                 });
  1409.                 return this[name]();
  1410.               };
  1411.             }
  1412.           }
  1413.         }
  1414.       })();
  1415.       if ("0:0" !== util.getDocumentScroll().join(":")) {
  1416.         remove();
  1417.       }
  1418.       wrap();
  1419.     }
  1420.     return {
  1421.       start : function() {
  1422.         model.activate();
  1423.       },
  1424.       stop : function() {
  1425.         model.clear();
  1426.         self.un(document, "mousemove", view);
  1427.         self.un(document, "click", update);
  1428.         self.un(document, "dblclick", update);
  1429.         self.un(document, "mousedown", update);
  1430.         self.un(document, "mouseup", up);
  1431.         self.un(document, "mousewheel", fn);
  1432.         self.un(document, "wheel", fn);
  1433.         self.un(window, "scroll", remove);
  1434.         self.un(window, "beforeunload", ctx);
  1435.         self.un(window, "unload", ctx);
  1436.         self.un(window, "resize", wrap);
  1437.         self.un(document, "keydown", handle);
  1438.         self.un(document, "keypress", listener);
  1439.         self.un(document, "copy", open);
  1440.         self.un(document, "touchmove", start);
  1441.         self.un(document, "touchstart", start);
  1442.         if (lb) {
  1443.           self.un(document, "mouseleave", f);
  1444.         }
  1445.         self.un(document, "focusin", handler);
  1446.         self.un(document, "focusout", hover);
  1447.         self.un(window, "focus", scope);
  1448.         self.un(window, "blur", hide);
  1449.         self.un(document, "blur", hide);
  1450.         if (document.removeEventListener) {
  1451.           self.un(document, "scroll", move);
  1452.           self.un(document, "focus", add);
  1453.           self.un(document, "blur", onResize);
  1454.           self.un(document, "change", onClick);
  1455.           self.un(document, "submit", change);
  1456.         } else {
  1457.           if (document.detachEvent) {
  1458.             self.un(document, "focusin", add);
  1459.             self.un(document, "focusout", onResize);
  1460.             (function() {
  1461.               /** @type {!NodeList<Element>} */
  1462.               var remotes = document.getElementsByTagName("form");
  1463.               /** @type {number} */
  1464.               var i = 0;
  1465.               for (; i < remotes.length; i++) {
  1466.                 /** @type {!NodeList<Element>} */
  1467.                 var lsUDSNamesArr = remotes[i].getElementsByTagName("*");
  1468.                 /** @type {number} */
  1469.                 var n = 0;
  1470.                 for (; n < lsUDSNamesArr.length; n++) {
  1471.                   if (/^INPUT|SELECT|TEXTAREA$/.test(lsUDSNamesArr[n].tagName)) {
  1472.                     self.un(lsUDSNamesArr[n], "change", onClick);
  1473.                   }
  1474.                 }
  1475.                 self.un(remotes[i], "submit", change);
  1476.               }
  1477.             })();
  1478.           }
  1479.         }
  1480.         (function() {
  1481.           /** @type {!NodeList<Element>} */
  1482.           var form = document.getElementsByTagName("form");
  1483.           /** @type {number} */
  1484.           var i = 0;
  1485.           for (; i < form.length; i++) {
  1486.             if (form[i][name]) {
  1487.               form[i].submit = form[i][name];
  1488.             }
  1489.           }
  1490.         })();
  1491.       },
  1492.       uploadPages : function(size, page) {
  1493.         /**
  1494.          * @return {undefined}
  1495.          */
  1496.         function fn() {
  1497.           self.un(document, "DOMContentLoaded", fn);
  1498.           self.un(window, "load", fn);
  1499.           var hhmmssArr = size.split(/\n/);
  1500.           var n = parse().href;
  1501.           /** @type {!RegExp} */
  1502.           var query = /regexp:/;
  1503.           /** @type {number} */
  1504.           var i = 0;
  1505.           for (; i < hhmmssArr.length; i++) {
  1506.             var t = hhmmssArr[i];
  1507.             if (t) {
  1508.               if (query.test(t)) {
  1509.                 t = callback(t.replace(query, ""));
  1510.                 try {
  1511.                   /** @type {!RegExp} */
  1512.                   var text = new RegExp(t);
  1513.                 } catch (Zb) {
  1514.                 }
  1515.                 if (text && text.test(n)) {
  1516.                   ossService.uploadPage(page);
  1517.                   break;
  1518.                 }
  1519.               } else {
  1520.                 if (-1 !== n.indexOf(t)) {
  1521.                   ossService.uploadPage(page);
  1522.                   break;
  1523.                 }
  1524.               }
  1525.             }
  1526.           }
  1527.         }
  1528.         var ossService = this;
  1529.         if ("complete" === document.readyState) {
  1530.           fn();
  1531.         } else {
  1532.           self.on(document, "DOMContentLoaded", fn);
  1533.           self.on(window, "load", fn);
  1534.         }
  1535.       },
  1536.       uploadPage : require(function(exp) {
  1537.         if ("function" === typeof window.toStaticHTML && -1 < window.toStaticHTML.toString().indexOf("NoScript")) {
  1538.           return false;
  1539.         }
  1540.         /** @type {!Element} */
  1541.         var dialog = document.documentElement;
  1542.         if (dialog && 19E4 < ("" + dialog.innerHTML).length) {
  1543.           return false;
  1544.         }
  1545.         var req = window.XMLHttpRequest ? new window.XMLHttpRequest : new ActiveXObject("Msxml2.XMLHTTP");
  1546.         var user = util.getDocumentCharset();
  1547.         /** @type {string} */
  1548.         var mime = "text/html" + (user ? ";charset=" + user : "");
  1549.         var console = new ConsoleController({
  1550.           protocol : p,
  1551.           counterId : record,
  1552.           counterType : e
  1553.         });
  1554.         if ("html" === exp) {
  1555.           return exp = new RegExp("<script [^>]*?//" + options.host.replace(/\./g, "\\\\.") + "/watch/.*?\x3c/script>", "gi"), console.sendContent(util.getDocumentHTML().replace(exp, ""), mime, d, offset, date), true;
  1556.         }
  1557.         if (req) {
  1558.           req.open("get", parse().href, true);
  1559.           req.onreadystatechange = require(function() {
  1560.             if (4 === req.readyState) {
  1561.               var ext = req.getResponseHeader("content-type") || "";
  1562.               if (user && -1 === ext.indexOf("charset=")) {
  1563.                 /** @type {string} */
  1564.                 ext = mime;
  1565.               }
  1566.               console.sendContent(req.responseText, ext, d, offset, date);
  1567.             }
  1568.           }, "updatePage.1");
  1569.           if (req.overrideMimeType && user) {
  1570.             req.overrideMimeType(mime);
  1571.           }
  1572.           req.send(null);
  1573.         }
  1574.         return true;
  1575.       }, "uploadPage")
  1576.     };
  1577.   }
  1578.   /**
  1579.    * @return {?}
  1580.    */
  1581.   function parse() {
  1582.     var aliases = {};
  1583.     /** @type {!Array<string>} */
  1584.     var names = "hash host hostname href pathname port protocol search".split(" ");
  1585.     /** @type {number} */
  1586.     var len = names.length;
  1587.     /** @type {number} */
  1588.     var i = len;
  1589.     var a;
  1590.     var key;
  1591.     for (; i--;) {
  1592.       /** @type {string} */
  1593.       aliases[names[i]] = "";
  1594.     }
  1595.     try {
  1596.       /** @type {!Location} */
  1597.       a = window.location;
  1598.       /** @type {number} */
  1599.       i = len;
  1600.       for (; i--;) {
  1601.         /** @type {string} */
  1602.         key = names[i];
  1603.         aliases[key] = "" + a[key];
  1604.       }
  1605.     } catch (h) {
  1606.       if (result) {
  1607.         aliases = result;
  1608.       }
  1609.     }
  1610.     return aliases;
  1611.   }
  1612.   /**
  1613.    * @param {string} stdout
  1614.    * @return {?}
  1615.    */
  1616.   function callback(stdout) {
  1617.     return stdout ? ("" + stdout).replace(/^\s+/, "").replace(/\s+$/, "") : "";
  1618.   }
  1619.   /**
  1620.    * @return {?}
  1621.    */
  1622.   function runDouban() {
  1623.     return 0 == parse().hostname.search(/^(.*.)?((yandex(-team)?).(com?.)?[a-z]+|(auto|kinopoisk|beru).ru|ya.(ru|cc)|yadi.sk|yastatic.net|.*.yandex)$/);
  1624.   }
  1625.   /**
  1626.    * @param {!Object} uri
  1627.    * @return {?}
  1628.    */
  1629.   function split(uri) {
  1630.     return -1 !== ("" + window.navigator.userAgent).toLowerCase().search(uri);
  1631.   }
  1632.   /**
  1633.    * @param {!Object} body
  1634.    * @return {?}
  1635.    */
  1636.   function getUrl(body) {
  1637.     return callback(body && body.innerHTML && body.innerHTML.replace(/<\/?[^>]+>/gi, ""));
  1638.   }
  1639.   /**
  1640.    * @param {string} a
  1641.    * @param {!Array} b
  1642.    * @return {?}
  1643.    */
  1644.   function filter(a, b) {
  1645.     var i;
  1646.     if (!a || !b) {
  1647.       return false;
  1648.     }
  1649.     /** @type {!Array} */
  1650.     var drilldownLevelLabels = [];
  1651.     /** @type {number} */
  1652.     i = 0;
  1653.     for (; i < b.length; i++) {
  1654.       drilldownLevelLabels.push(b[i].replace(/\^/g, "\\^").replace(/\$/g, "\\$").replace(/\./g, "\\.").replace(/\[/g, "\\[").replace(/\]/g, "\\]").replace(/\|/g, "\\|").replace(/\(/g, "\\(").replace(/\)/g, "\\)").replace(/\?/g, "\\?").replace(/\*/g, "\\*").replace(/\+/g, "\\+").replace(/\{/g, "\\{").replace(/\}/g, "\\}"));
  1655.     }
  1656.     return (new RegExp("\\.(" + drilldownLevelLabels.join("|") + ")$", "i")).test(a);
  1657.   }
  1658.   /**
  1659.    * @param {!Object} e
  1660.    * @return {?}
  1661.    */
  1662.   function check(e) {
  1663.     e = e.target || e.srcElement;
  1664.     var undefined;
  1665.     if (!e) {
  1666.       return false;
  1667.     }
  1668.     if (3 == e.nodeType) {
  1669.       e = e.parentNode;
  1670.     }
  1671.     undefined = e && e.nodeName && e.nodeName.toString().toLowerCase();
  1672.     for (; e && e.parentNode && e.parentNode.nodeName && ("a" != undefined && "area" != undefined || !e.href);) {
  1673.       undefined = (e = e.parentNode) && e.nodeName && e.nodeName.toString().toLowerCase();
  1674.     }
  1675.     return e.href ? e : false;
  1676.   }
  1677.   /**
  1678.    * @param {string} str
  1679.    * @param {string} label
  1680.    * @return {?}
  1681.    */
  1682.   function get(str, label) {
  1683.     return (str ? str.replace(/^www\./, "") : "").toLowerCase() == (label ? label.replace(/^www\./, "") : "").toLowerCase();
  1684.   }
  1685.   /**
  1686.    * @param {string} a
  1687.    * @param {string} b
  1688.    * @return {?}
  1689.    */
  1690.   function cb(a, b) {
  1691.     /**
  1692.      * @param {string} code
  1693.      * @return {?}
  1694.      */
  1695.     function hash(code) {
  1696.       code = code.split(":");
  1697.       code = code[1] || "";
  1698.       code = code.replace(/^\/*/, "").replace(/^www\./, "");
  1699.       return code.split("/")[0];
  1700.     }
  1701.     return a && b ? hash(a) == hash(b) : a || b ? false : true;
  1702.   }
  1703.   /**
  1704.    * @return {?}
  1705.    */
  1706.   function getPerformaceInfo() {
  1707.     /** @type {!Performance} */
  1708.     var p = window.performance || window.webkitPerformance;
  1709.     /** @type {(PerformanceTiming|null)} */
  1710.     var t = p && p.timing;
  1711.     var start;
  1712.     /** @type {!Array} */
  1713.     var plevels = [];
  1714.     if (t && (start = t.navigationStart)) {
  1715.       /** @type {!Array} */
  1716.       plevels = [t.domainLookupEnd - t.domainLookupStart, t.connectEnd - t.connectStart, t.responseStart - t.requestStart, t.responseEnd - t.responseStart, t.fetchStart - start, t.redirectEnd - t.redirectStart, t.redirectCount || p.navigation && p.navigation.redirectCount];
  1717.       plevels.push(t.domInteractive && t.domLoading ? t.domInteractive - t.domLoading : null);
  1718.       plevels.push(t.domContentLoadedEventStart && t.domContentLoadedEventEnd ? t.domContentLoadedEventEnd - t.domContentLoadedEventStart : null);
  1719.       plevels.push(t.domComplete ? t.domComplete - start : null);
  1720.       plevels.push(t.loadEventStart ? t.loadEventStart - start : null);
  1721.       plevels.push(t.loadEventStart && t.loadEventEnd ? t.loadEventEnd - t.loadEventStart : null);
  1722.       plevels.push(t.domContentLoadedEventStart ? t.domContentLoadedEventStart - start : null);
  1723.       /** @type {number} */
  1724.       p = 0;
  1725.       for (; p < plevels.length; p++) {
  1726.         t = plevels[p];
  1727.         if (null !== t && (0 > t || 36E5 < t)) {
  1728.           /** @type {null} */
  1729.           plevels[p] = null;
  1730.         }
  1731.       }
  1732.     }
  1733.     return plevels;
  1734.   }
  1735.   /**
  1736.    * @param {?} el
  1737.    * @return {?}
  1738.    */
  1739.   function assign(el) {
  1740.     /** @type {!Array} */
  1741.     var buffer = [];
  1742.     var string = el._lastPerformanceTiming;
  1743.     var word = getPerformaceInfo();
  1744.     var strLen;
  1745.     if (string) {
  1746.       /** @type {number} */
  1747.       var i = 0;
  1748.       strLen = string.length;
  1749.       for (; i < strLen; i++) {
  1750.         if (null === word[i]) {
  1751.           buffer.push(word[i]);
  1752.         } else {
  1753.           buffer.push(string[i] === word[i] ? "" : word[i]);
  1754.         }
  1755.       }
  1756.     } else {
  1757.       buffer = word;
  1758.     }
  1759.     el._lastPerformanceTiming = word;
  1760.     return buffer.join(",");
  1761.   }
  1762.   /**
  1763.    * @param {!Object} elems
  1764.    * @return {?}
  1765.    */
  1766.   function map(elems) {
  1767.     return "first-contentful-paint" === elems.name;
  1768.   }
  1769.   /**
  1770.    * @return {?}
  1771.    */
  1772.   function draw() {
  1773.     /** @type {function(this:Performance, string): !Array<PerformanceEntry>} */
  1774.     var typeIncluded = window.performance && window.performance.getEntriesByType;
  1775.     var t = typeIncluded ? _.filter(map, window.performance.getEntriesByType("paint")) : [];
  1776.     if (t.length) {
  1777.       return t = t[0], Math.round(t.startTime);
  1778.     }
  1779.     if (typeIncluded) {
  1780.       return 0;
  1781.     }
  1782.     if ("object" == typeof window.chrome && window.chrome.loadTimes) {
  1783.       if (t = window.chrome.loadTimes(), t.requestTime && t.firstPaintTime && window.performance && window.performance.timing) {
  1784.         return Math.round(1E3 * t.firstPaintTime - window.performance.timing.navigationStart);
  1785.       }
  1786.     } else {
  1787.       if (window.performance && window.performance.timing && (t = window.performance.timing, t.navigationStart && t.msFirstPaint)) {
  1788.         return t.msFirstPaint - t.navigationStart;
  1789.       }
  1790.     }
  1791.     return null;
  1792.   }
  1793.   /** @type {boolean} */
  1794.   var data = false;
  1795.   try {
  1796.     var debounceDelay = function(d) {
  1797.       /**
  1798.        * @param {number} name
  1799.        * @return {?}
  1800.        */
  1801.       function exports(name) {
  1802.         if (Functions[name]) {
  1803.           return Functions[name].f;
  1804.         }
  1805.         var q = Functions[name] = {
  1806.           H : name,
  1807.           L : false,
  1808.           f : {}
  1809.         };
  1810.         d[name].call(q.f, q, q.f, exports);
  1811.         /** @type {boolean} */
  1812.         q.L = true;
  1813.         return q.f;
  1814.       }
  1815.       var Functions = {};
  1816.       /** @type {!Array} */
  1817.       exports.Z = d;
  1818.       exports.W = Functions;
  1819.       /**
  1820.        * @param {?} val
  1821.        * @return {?}
  1822.        */
  1823.       exports.H = function(val) {
  1824.         return val;
  1825.       };
  1826.       /**
  1827.        * @param {!Function} event
  1828.        * @param {!Function} fn
  1829.        * @return {undefined}
  1830.        */
  1831.       exports.B = function(event, fn) {
  1832.         if (!exports.C(event)) {
  1833.           Object.defineProperty(event, "a", {
  1834.             configurable : false,
  1835.             enumerable : true,
  1836.             get : fn
  1837.           });
  1838.         }
  1839.       };
  1840.       /**
  1841.        * @param {!Object} v
  1842.        * @return {?}
  1843.        */
  1844.       exports.X = function(v) {
  1845.         /** @type {function(): ?} */
  1846.         var op = v && v.a ? function() {
  1847.           return v["default"];
  1848.         } : function() {
  1849.           return v;
  1850.         };
  1851.         exports.B(op, op);
  1852.         return op;
  1853.       };
  1854.       /**
  1855.        * @param {!Function} obj
  1856.        * @return {?}
  1857.        */
  1858.       exports.C = function(obj) {
  1859.         return Object.prototype.hasOwnProperty.call(obj, "a");
  1860.       };
  1861.       /** @type {string} */
  1862.       exports.Y = "";
  1863.       return exports(exports.$ = 5);
  1864.     }([function(u, data) {
  1865.       /** @type {boolean} */
  1866.       data.a = true;
  1867.       u = function() {
  1868.         /**
  1869.          * @return {undefined}
  1870.          */
  1871.         function k() {
  1872.           this.m = window.ApplePaySession;
  1873.         }
  1874.         /**
  1875.          * @return {?}
  1876.          */
  1877.         k.prototype.g = function() {
  1878.           /** @type {boolean} */
  1879.           var txt = false;
  1880.           try {
  1881.             /** @type {boolean} */
  1882.             txt = window.self !== window.top;
  1883.           } catch (t) {
  1884.           }
  1885.           if (!this.m || "https:" !== result.protocol || txt) {
  1886.             return "";
  1887.           }
  1888.           /** @type {string} */
  1889.           txt = "";
  1890.           /** @type {number} */
  1891.           var value = 1;
  1892.           for (; 10 >= value; value++) {
  1893.             /** @type {string} */
  1894.             txt = txt + (this.m.supportsVersion(value) ? value : "0");
  1895.           }
  1896.           return txt + this.m.canMakePayments();
  1897.         };
  1898.         return k;
  1899.       }();
  1900.       /** @type {string} */
  1901.       data.u = u;
  1902.     }, function(value, color) {
  1903.       var c = this && this.V || function() {
  1904.         /** @type {function(!Object, ?): !Object} */
  1905.         var int64copy = Object.setPrototypeOf || {
  1906.           __proto__ : []
  1907.         } instanceof Array && function(d, b) {
  1908.           /** @type {!Object} */
  1909.           d.__proto__ = b;
  1910.         } || function(a, b) {
  1911.           var p;
  1912.           for (p in b) {
  1913.             if (b.hasOwnProperty(p)) {
  1914.               a[p] = b[p];
  1915.             }
  1916.           }
  1917.         };
  1918.         return function(d, b) {
  1919.           /**
  1920.            * @return {undefined}
  1921.            */
  1922.           function __() {
  1923.             /** @type {!Object} */
  1924.             this.constructor = d;
  1925.           }
  1926.           int64copy(d, b);
  1927.           d.prototype = null === b ? Object.create(b) : (__.prototype = b.prototype, new __);
  1928.         };
  1929.       }();
  1930.       /** @type {boolean} */
  1931.       color.a = true;
  1932.       value = function() {
  1933.         /**
  1934.          * @param {!Array} object
  1935.          * @return {undefined}
  1936.          */
  1937.         function init(object) {
  1938.           /** @type {!Array} */
  1939.           this.D = object;
  1940.           /** @type {boolean} */
  1941.           this.h = true;
  1942.           /** @type {!Element} */
  1943.           this.canvas = document.createElement("canvas");
  1944.           if (!this.I()) {
  1945.             /** @type {boolean} */
  1946.             this.h = false;
  1947.           }
  1948.         }
  1949.         /**
  1950.          * @return {?}
  1951.          */
  1952.         init.prototype.I = function() {
  1953.           this.c = this.canvas.getContext(this.D);
  1954.           return !(!this.canvas.getContext || !this.c);
  1955.         };
  1956.         /**
  1957.          * @return {?}
  1958.          */
  1959.         init.prototype.g = function() {
  1960.           return this.h ? this.o() : this.id;
  1961.         };
  1962.         return init;
  1963.       }();
  1964.       var alpha = function(v) {
  1965.         /**
  1966.          * @return {?}
  1967.          */
  1968.         function e() {
  1969.           var t = v.call(this, "webgl") || this;
  1970.           if (t.h && !t.J()) {
  1971.             /** @type {boolean} */
  1972.             t.h = false;
  1973.           }
  1974.           return t;
  1975.         }
  1976.         c(e, v);
  1977.         /**
  1978.          * @return {?}
  1979.          */
  1980.         e.prototype.J = function() {
  1981.           var a = this.canvas.getContext && (this.canvas.getContext("webgl") || this.canvas.getContext("experimental-webgl"));
  1982.           return !!window.WebGLRenderingContext && !!a;
  1983.         };
  1984.         /**
  1985.          * @param {!Object} selector
  1986.          * @return {?}
  1987.          */
  1988.         e.prototype.j = function(selector) {
  1989.           var gl = this.c;
  1990.           gl.clearColor(0, 0, 0, 1);
  1991.           gl.enable(gl.DEPTH_TEST);
  1992.           gl.depthFunc(gl.LEQUAL);
  1993.           gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
  1994.           return "[" + selector[0] + ", " + selector[1] + "]";
  1995.         };
  1996.         /**
  1997.          * @param {!WebGLRenderingContext} gl
  1998.          * @return {?}
  1999.          */
  2000.         e.prototype.M = function(gl) {
  2001.           var anisotropy;
  2002.           var ext = gl.getExtension("EXT_texture_filter_anisotropic") || gl.getExtension("WEBKIT_EXT_texture_filter_anisotropic") || gl.getExtension("MOZ_EXT_texture_filter_anisotropic");
  2003.           return ext ? (anisotropy = gl.getParameter(ext.MAX_TEXTURE_MAX_ANISOTROPY_EXT), 0 === anisotropy && (anisotropy = 2), anisotropy) : null;
  2004.         };
  2005.         /**
  2006.          * @return {?}
  2007.          */
  2008.         e.prototype.o = function() {
  2009.           var gl = this.c;
  2010.           /** @type {!Array} */
  2011.           var drilldownLevelLabels = [];
  2012.           var glBuffer = gl.createBuffer();
  2013.           gl.bindBuffer(gl.ARRAY_BUFFER, glBuffer);
  2014.           gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([-.2, -.9, 0, .4, -.26, 0, 0, .732134444, 0]), gl.STATIC_DRAW);
  2015.           /** @type {number} */
  2016.           glBuffer.K = 3;
  2017.           /** @type {number} */
  2018.           glBuffer.O = 3;
  2019.           var program = gl.createProgram();
  2020.           var vertexShader = gl.createShader(gl.VERTEX_SHADER);
  2021.           gl.shaderSource(vertexShader, "attribute vec2 attrVertex;varying vec2 varyinTexCoordinate;uniform vec2 uniformOffset;void main(){varyinTexCoordinate=attrVertex+uniformOffset;gl_Position=vec4(attrVertex,0,1);}");
  2022.           gl.compileShader(vertexShader);
  2023.           var fragmentShader = gl.createShader(gl.FRAGMENT_SHADER);
  2024.           gl.shaderSource(fragmentShader, "precision mediump float;varying vec2 varyinTexCoordinate;void main() {gl_FragColor=vec4(varyinTexCoordinate,0,1);}");
  2025.           gl.compileShader(fragmentShader);
  2026.           gl.attachShader(program, vertexShader);
  2027.           gl.attachShader(program, fragmentShader);
  2028.           gl.linkProgram(program);
  2029.           gl.useProgram(program);
  2030.           program.R = gl.getAttribLocation(program, "attrVertex");
  2031.           program.P = gl.getUniformLocation(program, "uniformOffset");
  2032.           gl.enableVertexAttribArray(program.aa);
  2033.           gl.vertexAttribPointer(program.R, glBuffer.K, gl.FLOAT, false, 0, 0);
  2034.           gl.uniform2f(program.P, 1, 1);
  2035.           gl.drawArrays(gl.TRIANGLE_STRIP, 0, glBuffer.O);
  2036.           if (null != gl.canvas) {
  2037.             drilldownLevelLabels.push(gl.canvas.toDataURL());
  2038.           }
  2039.           drilldownLevelLabels.push("extensions:" + gl.getSupportedExtensions().join(";"));
  2040.           drilldownLevelLabels.push("webgl aliased line width range:" + this.j(gl.getParameter(gl.ALIASED_LINE_WIDTH_RANGE)));
  2041.           drilldownLevelLabels.push("webgl aliased point size range:" + this.j(gl.getParameter(gl.ALIASED_POINT_SIZE_RANGE)));
  2042.           drilldownLevelLabels.push("webgl alpha bits:" + gl.getParameter(gl.ALPHA_BITS));
  2043.           drilldownLevelLabels.push("webgl antialiasing:" + (gl.getContextAttributes().antialias ? "yes" : "no"));
  2044.           drilldownLevelLabels.push("webgl blue bits:" + gl.getParameter(gl.BLUE_BITS));
  2045.           drilldownLevelLabels.push("webgl depth bits:" + gl.getParameter(gl.DEPTH_BITS));
  2046.           drilldownLevelLabels.push("webgl green bits:" + gl.getParameter(gl.GREEN_BITS));
  2047.           drilldownLevelLabels.push("webgl max anisotropy:" + this.M(gl));
  2048.           drilldownLevelLabels.push("webgl max combined texture image units:" + gl.getParameter(gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS));
  2049.           drilldownLevelLabels.push("webgl max cube map texture size:" + gl.getParameter(gl.MAX_CUBE_MAP_TEXTURE_SIZE));
  2050.           drilldownLevelLabels.push("webgl max fragment uniform vectors:" + gl.getParameter(gl.MAX_FRAGMENT_UNIFORM_VECTORS));
  2051.           drilldownLevelLabels.push("webgl max render buffer size:" + gl.getParameter(gl.MAX_RENDERBUFFER_SIZE));
  2052.           drilldownLevelLabels.push("webgl max texture image units:" + gl.getParameter(gl.MAX_TEXTURE_IMAGE_UNITS));
  2053.           drilldownLevelLabels.push("webgl max texture size:" + gl.getParameter(gl.MAX_TEXTURE_SIZE));
  2054.           drilldownLevelLabels.push("webgl max varying vectors:" + gl.getParameter(gl.MAX_VARYING_VECTORS));
  2055.           drilldownLevelLabels.push("webgl max vertex attribs:" + gl.getParameter(gl.MAX_VERTEX_ATTRIBS));
  2056.           drilldownLevelLabels.push("webgl max vertex texture image units:" + gl.getParameter(gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS));
  2057.           drilldownLevelLabels.push("webgl max vertex uniform vectors:" + gl.getParameter(gl.MAX_VERTEX_UNIFORM_VECTORS));
  2058.           drilldownLevelLabels.push("webgl max viewport dims:" + this.j(gl.getParameter(gl.MAX_VIEWPORT_DIMS)));
  2059.           drilldownLevelLabels.push("webgl red bits:" + gl.getParameter(gl.RED_BITS));
  2060.           drilldownLevelLabels.push("webgl renderer:" + gl.getParameter(gl.RENDERER));
  2061.           drilldownLevelLabels.push("webgl shading language version:" + gl.getParameter(gl.SHADING_LANGUAGE_VERSION));
  2062.           drilldownLevelLabels.push("webgl stencil bits:" + gl.getParameter(gl.STENCIL_BITS));
  2063.           drilldownLevelLabels.push("webgl vendor:" + gl.getParameter(gl.VENDOR));
  2064.           drilldownLevelLabels.push("webgl version:" + gl.getParameter(gl.VERSION));
  2065.           try {
  2066.             var extensionDebugRendererInfo = gl.getExtension("WEBGL_debug_renderer_info");
  2067.             if (extensionDebugRendererInfo) {
  2068.               drilldownLevelLabels.push("webgl unmasked vendor:" + gl.getParameter(extensionDebugRendererInfo.UNMASKED_VENDOR_WEBGL));
  2069.               drilldownLevelLabels.push("webgl unmasked renderer:" + gl.getParameter(extensionDebugRendererInfo.UNMASKED_RENDERER_WEBGL));
  2070.             }
  2071.           } catch (Y) {
  2072.           }
  2073.           if (!gl.getShaderPrecisionFormat) {
  2074.             return drilldownLevelLabels.join("~");
  2075.           }
  2076.           drilldownLevelLabels.push("webgl vertex shader high float precision:" + gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.HIGH_FLOAT).precision);
  2077.           drilldownLevelLabels.push("webgl vertex shader high float precision rangeMin:" + gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.HIGH_FLOAT).rangeMin);
  2078.           drilldownLevelLabels.push("webgl vertex shader high float precision rangeMax:" + gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.HIGH_FLOAT).rangeMax);
  2079.           drilldownLevelLabels.push("webgl vertex shader medium float precision:" + gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.MEDIUM_FLOAT).precision);
  2080.           drilldownLevelLabels.push("webgl vertex shader medium float precision rangeMin:" + gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.MEDIUM_FLOAT).rangeMin);
  2081.           drilldownLevelLabels.push("webgl vertex shader medium float precision rangeMax:" + gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.MEDIUM_FLOAT).rangeMax);
  2082.           drilldownLevelLabels.push("webgl vertex shader low float precision:" + gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.LOW_FLOAT).precision);
  2083.           drilldownLevelLabels.push("webgl vertex shader low float precision rangeMin:" + gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.LOW_FLOAT).rangeMin);
  2084.           drilldownLevelLabels.push("webgl vertex shader low float precision rangeMax:" + gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.LOW_FLOAT).rangeMax);
  2085.           drilldownLevelLabels.push("webgl fragment shader high float precision:" + gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.HIGH_FLOAT).precision);
  2086.           drilldownLevelLabels.push("webgl fragment shader high float precision rangeMin:" + gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.HIGH_FLOAT).rangeMin);
  2087.           drilldownLevelLabels.push("webgl fragment shader high float precision rangeMax:" + gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.HIGH_FLOAT).rangeMax);
  2088.           drilldownLevelLabels.push("webgl fragment shader medium float precision:" + gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.MEDIUM_FLOAT).precision);
  2089.           drilldownLevelLabels.push("webgl fragment shader medium float precision rangeMin:" + gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.MEDIUM_FLOAT).rangeMin);
  2090.           drilldownLevelLabels.push("webgl fragment shader medium float precision rangeMax:" + gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.MEDIUM_FLOAT).rangeMax);
  2091.           drilldownLevelLabels.push("webgl fragment shader low float precision:" + gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.LOW_FLOAT).precision);
  2092.           drilldownLevelLabels.push("webgl fragment shader low float precision rangeMin:" + gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.LOW_FLOAT).rangeMin);
  2093.           drilldownLevelLabels.push("webgl fragment shader low float precision rangeMax:" + gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.LOW_FLOAT).rangeMax);
  2094.           drilldownLevelLabels.push("webgl vertex shader high int precision:" + gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.HIGH_INT).precision);
  2095.           drilldownLevelLabels.push("webgl vertex shader high int precision rangeMin:" + gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.HIGH_INT).rangeMin);
  2096.           drilldownLevelLabels.push("webgl vertex shader high int precision rangeMax:" + gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.HIGH_INT).rangeMax);
  2097.           drilldownLevelLabels.push("webgl vertex shader medium int precision:" + gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.MEDIUM_INT).precision);
  2098.           drilldownLevelLabels.push("webgl vertex shader medium int precision rangeMin:" + gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.MEDIUM_INT).rangeMin);
  2099.           drilldownLevelLabels.push("webgl vertex shader medium int precision rangeMax:" + gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.MEDIUM_INT).rangeMax);
  2100.           drilldownLevelLabels.push("webgl vertex shader low int precision:" + gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.LOW_INT).precision);
  2101.           drilldownLevelLabels.push("webgl vertex shader low int precision rangeMin:" + gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.LOW_INT).rangeMin);
  2102.           drilldownLevelLabels.push("webgl vertex shader low int precision rangeMax:" + gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.LOW_INT).rangeMax);
  2103.           drilldownLevelLabels.push("webgl fragment shader high int precision:" + gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.HIGH_INT).precision);
  2104.           drilldownLevelLabels.push("webgl fragment shader high int precision rangeMin:" + gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.HIGH_INT).rangeMin);
  2105.           drilldownLevelLabels.push("webgl fragment shader high int precision rangeMax:" + gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.HIGH_INT).rangeMax);
  2106.           drilldownLevelLabels.push("webgl fragment shader medium int precision:" + gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.MEDIUM_INT).precision);
  2107.           drilldownLevelLabels.push("webgl fragment shader medium int precision rangeMin:" + gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.MEDIUM_INT).rangeMin);
  2108.           drilldownLevelLabels.push("webgl fragment shader medium int precision rangeMax:" + gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.MEDIUM_INT).rangeMax);
  2109.           drilldownLevelLabels.push("webgl fragment shader low int precision:" + gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.LOW_INT).precision);
  2110.           drilldownLevelLabels.push("webgl fragment shader low int precision rangeMin:" + gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.LOW_INT).rangeMin);
  2111.           drilldownLevelLabels.push("webgl fragment shader low int precision rangeMax:" + gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.LOW_INT).rangeMax);
  2112.           return drilldownLevelLabels.join("~");
  2113.         };
  2114.         return e;
  2115.       }(value);
  2116.       color.A = alpha;
  2117.       value = function(v) {
  2118.         /**
  2119.          * @return {?}
  2120.          */
  2121.         function m() {
  2122.           return v.call(this, "2d") || this;
  2123.         }
  2124.         c(m, v);
  2125.         /**
  2126.          * @return {?}
  2127.          */
  2128.         m.prototype.o = function() {
  2129.           var canvas = this.canvas;
  2130.           var ctx = this.c;
  2131.           /** @type {!Array} */
  2132.           var drilldownLevelLabels = [];
  2133.           /** @type {number} */
  2134.           canvas.width = 2E3;
  2135.           /** @type {number} */
  2136.           canvas.height = 200;
  2137.           /** @type {string} */
  2138.           canvas.style.display = "inline";
  2139.           ctx.rect(0, 0, 10, 10);
  2140.           ctx.rect(2, 2, 6, 6);
  2141.           drilldownLevelLabels.push("canvas winding:" + (false === ctx.isPointInPath(5, 5, "evenodd") ? "yes" : "no"));
  2142.           /** @type {string} */
  2143.           ctx.textBaseline = "alphabetic";
  2144.           /** @type {string} */
  2145.           ctx.fillStyle = "#f60";
  2146.           ctx.fillRect(125, 1, 62, 20);
  2147.           /** @type {string} */
  2148.           ctx.fillStyle = "#069";
  2149.           /** @type {string} */
  2150.           ctx.font = "11pt Arial";
  2151.           ctx.fillText("Cwm fjordbank glyphs vext quiz, \ud83d\ude03", 2, 15);
  2152.           /** @type {string} */
  2153.           ctx.fillStyle = "rgba(102, 204, 0, 0.2)";
  2154.           /** @type {string} */
  2155.           ctx.font = "18pt Arial";
  2156.           ctx.fillText("Cwm fjordbank glyphs vext quiz, \ud83d\ude03", 4, 45);
  2157.           /** @type {string} */
  2158.           ctx.globalCompositeOperation = "multiply";
  2159.           /** @type {string} */
  2160.           ctx.fillStyle = "rgb(255,0,255)";
  2161.           ctx.beginPath();
  2162.           ctx.arc(50, 50, 50, 0, 2 * Math.PI, true);
  2163.           ctx.closePath();
  2164.           ctx.fill();
  2165.           /** @type {string} */
  2166.           ctx.fillStyle = "rgb(0,255,255)";
  2167.           ctx.beginPath();
  2168.           ctx.arc(100, 50, 50, 0, 2 * Math.PI, true);
  2169.           ctx.closePath();
  2170.           ctx.fill();
  2171.           /** @type {string} */
  2172.           ctx.fillStyle = "rgb(255,255,0)";
  2173.           ctx.beginPath();
  2174.           ctx.arc(75, 100, 50, 0, 2 * Math.PI, true);
  2175.           ctx.closePath();
  2176.           ctx.fill();
  2177.           /** @type {string} */
  2178.           ctx.fillStyle = "rgb(255,0,255)";
  2179.           ctx.arc(75, 75, 75, 0, 2 * Math.PI, true);
  2180.           ctx.arc(75, 75, 25, 0, 2 * Math.PI, true);
  2181.           ctx.fill("evenodd");
  2182.           drilldownLevelLabels.push("canvas fp:" + canvas.toDataURL());
  2183.           return drilldownLevelLabels.join("~");
  2184.         };
  2185.         return m;
  2186.       }(value);
  2187.       /** @type {!Array} */
  2188.       color.S = value;
  2189.     }, function(max, value) {
  2190.       /** @type {boolean} */
  2191.       value.a = true;
  2192.       max = function() {
  2193.         /**
  2194.          * @return {undefined}
  2195.          */
  2196.         function bar() {
  2197.           /** @type {!Navigator} */
  2198.           this.b = window.navigator;
  2199.         }
  2200.         /**
  2201.          * @return {?}
  2202.          */
  2203.         bar.prototype.g = function() {
  2204.           return this.b.i ? this.b.i : this.b.N ? this.b.N : this.b.i ? this.b.i : "unknown";
  2205.         };
  2206.         return bar;
  2207.       }();
  2208.       /** @type {string} */
  2209.       value.v = max;
  2210.     }, function(a, b) {
  2211.       /**
  2212.        * @param {!Object} a
  2213.        * @param {!Array} c
  2214.        * @return {?}
  2215.        */
  2216.       function $(a, c) {
  2217.         /** @type {!Array} */
  2218.         a = [a[0] >>> 16, a[0] & 65535, a[1] >>> 16, a[1] & 65535];
  2219.         /** @type {!Array} */
  2220.         c = [c[0] >>> 16, c[0] & 65535, c[1] >>> 16, c[1] & 65535];
  2221.         /** @type {!Array} */
  2222.         var b = [0, 0, 0, 0];
  2223.         b[3] += a[3] * c[3];
  2224.         b[2] += b[3] >>> 16;
  2225.         b[3] &= 65535;
  2226.         b[2] += a[2] * c[3];
  2227.         b[1] += b[2] >>> 16;
  2228.         b[2] &= 65535;
  2229.         b[2] += a[3] * c[2];
  2230.         b[1] += b[2] >>> 16;
  2231.         b[2] &= 65535;
  2232.         b[1] += a[1] * c[3];
  2233.         b[0] += b[1] >>> 16;
  2234.         b[1] &= 65535;
  2235.         b[1] += a[2] * c[2];
  2236.         b[0] += b[1] >>> 16;
  2237.         b[1] &= 65535;
  2238.         b[1] += a[3] * c[1];
  2239.         b[0] += b[1] >>> 16;
  2240.         b[1] &= 65535;
  2241.         b[0] += a[0] * c[3] + a[1] * c[2] + a[2] * c[1] + a[3] * c[0];
  2242.         b[0] &= 65535;
  2243.         return [b[0] << 16 | b[1], b[2] << 16 | b[3]];
  2244.       }
  2245.       /**
  2246.        * @param {!Object} a
  2247.        * @param {!Object} b
  2248.        * @return {?}
  2249.        */
  2250.       function next(a, b) {
  2251.         /** @type {!Array} */
  2252.         a = [a[0] >>> 16, a[0] & 65535, a[1] >>> 16, a[1] & 65535];
  2253.         /** @type {!Array} */
  2254.         b = [b[0] >>> 16, b[0] & 65535, b[1] >>> 16, b[1] & 65535];
  2255.         /** @type {!Array} */
  2256.         var c = [0, 0, 0, 0];
  2257.         c[3] += a[3] + b[3];
  2258.         c[2] += c[3] >>> 16;
  2259.         c[3] &= 65535;
  2260.         c[2] += a[2] + b[2];
  2261.         c[1] += c[2] >>> 16;
  2262.         c[2] &= 65535;
  2263.         c[1] += a[1] + b[1];
  2264.         c[0] += c[1] >>> 16;
  2265.         c[1] &= 65535;
  2266.         c[0] += a[0] + b[0];
  2267.         c[0] &= 65535;
  2268.         return [c[0] << 16 | c[1], c[2] << 16 | c[3]];
  2269.       }
  2270.       /**
  2271.        * @param {!Object} m
  2272.        * @param {number} n
  2273.        * @return {?}
  2274.        */
  2275.       function normalize(m, n) {
  2276.         /** @type {number} */
  2277.         n = n % 64;
  2278.         if (32 === n) {
  2279.           return [m[1], m[0]];
  2280.         }
  2281.         if (32 > n) {
  2282.           return [m[0] << n | m[1] >>> 32 - n, m[1] << n | m[0] >>> 32 - n];
  2283.         }
  2284.         /** @type {number} */
  2285.         n = n - 32;
  2286.         return [m[1] << n | m[0] >>> 32 - n, m[0] << n | m[1] >>> 32 - n];
  2287.       }
  2288.       /**
  2289.        * @param {?} m
  2290.        * @param {number} n
  2291.        * @return {?}
  2292.        */
  2293.       function replace(m, n) {
  2294.         /** @type {number} */
  2295.         n = n % 64;
  2296.         return 0 === n ? m : 32 > n ? [m[0] << n | m[1] >>> 32 - n, m[1] << n] : [m[1] << n - 32, 0];
  2297.       }
  2298.       /**
  2299.        * @param {!Object} a
  2300.        * @param {!Array} b
  2301.        * @return {?}
  2302.        */
  2303.       function callback(a, b) {
  2304.         return [a[0] ^ b[0], a[1] ^ b[1]];
  2305.       }
  2306.       /**
  2307.        * @param {!Object} items
  2308.        * @return {?}
  2309.        */
  2310.       function toArray(items) {
  2311.         items = callback(items, [0, items[0] >>> 1]);
  2312.         items = $(items, [4283543511, 3981806797]);
  2313.         items = callback(items, [0, items[0] >>> 1]);
  2314.         items = $(items, [3301882366, 444984403]);
  2315.         return callback(items, [0, items[0] >>> 1]);
  2316.       }
  2317.       /** @type {boolean} */
  2318.       b.a = true;
  2319.       /**
  2320.        * @param {string} r
  2321.        * @param {!Object} value
  2322.        * @return {?}
  2323.        */
  2324.       b.hash = function(r, value) {
  2325.         r = r || "";
  2326.         value = value || 0;
  2327.         /** @type {number} */
  2328.         var c = r.length % 16;
  2329.         /** @type {number} */
  2330.         var d = r.length - c;
  2331.         /** @type {!Array} */
  2332.         var result = [0, value];
  2333.         /** @type {!Array} */
  2334.         value = [0, value];
  2335.         var b;
  2336.         var ret;
  2337.         /** @type {!Array} */
  2338.         var a = [2277735313, 289559509];
  2339.         /** @type {!Array} */
  2340.         var w = [1291169091, 658871167];
  2341.         /** @type {number} */
  2342.         var i = 0;
  2343.         for (; i < d; i = i + 16) {
  2344.           /** @type {!Array} */
  2345.           b = [r.charCodeAt(i + 4) & 255 | (r.charCodeAt(i + 5) & 255) << 8 | (r.charCodeAt(i + 6) & 255) << 16 | (r.charCodeAt(i + 7) & 255) << 24, r.charCodeAt(i) & 255 | (r.charCodeAt(i + 1) & 255) << 8 | (r.charCodeAt(i + 2) & 255) << 16 | (r.charCodeAt(i + 3) & 255) << 24];
  2346.           /** @type {!Array} */
  2347.           ret = [r.charCodeAt(i + 12) & 255 | (r.charCodeAt(i + 13) & 255) << 8 | (r.charCodeAt(i + 14) & 255) << 16 | (r.charCodeAt(i + 15) & 255) << 24, r.charCodeAt(i + 8) & 255 | (r.charCodeAt(i + 9) & 255) << 8 | (r.charCodeAt(i + 10) & 255) << 16 | (r.charCodeAt(i + 11) & 255) << 24];
  2348.           b = $(b, a);
  2349.           b = normalize(b, 31);
  2350.           b = $(b, w);
  2351.           result = callback(result, b);
  2352.           result = normalize(result, 27);
  2353.           result = next(result, value);
  2354.           result = next($(result, [0, 5]), [0, 1390208809]);
  2355.           ret = $(ret, w);
  2356.           ret = normalize(ret, 33);
  2357.           ret = $(ret, a);
  2358.           value = callback(value, ret);
  2359.           value = normalize(value, 31);
  2360.           value = next(value, result);
  2361.           value = next($(value, [0, 5]), [0, 944331445]);
  2362.         }
  2363.         /** @type {!Array} */
  2364.         b = [0, 0];
  2365.         /** @type {!Array} */
  2366.         ret = [0, 0];
  2367.         switch(c) {
  2368.           case 15:
  2369.             ret = callback(ret, replace([0, r.charCodeAt(i + 14)], 48));
  2370.           case 14:
  2371.             ret = callback(ret, replace([0, r.charCodeAt(i + 13)], 40));
  2372.           case 13:
  2373.             ret = callback(ret, replace([0, r.charCodeAt(i + 12)], 32));
  2374.           case 12:
  2375.             ret = callback(ret, replace([0, r.charCodeAt(i + 11)], 24));
  2376.           case 11:
  2377.             ret = callback(ret, replace([0, r.charCodeAt(i + 10)], 16));
  2378.           case 10:
  2379.             ret = callback(ret, replace([0, r.charCodeAt(i + 9)], 8));
  2380.           case 9:
  2381.             ret = callback(ret, [0, r.charCodeAt(i + 8)]);
  2382.             ret = $(ret, w);
  2383.             ret = normalize(ret, 33);
  2384.             ret = $(ret, a);
  2385.             value = callback(value, ret);
  2386.           case 8:
  2387.             b = callback(b, replace([0, r.charCodeAt(i + 7)], 56));
  2388.           case 7:
  2389.             b = callback(b, replace([0, r.charCodeAt(i + 6)], 48));
  2390.           case 6:
  2391.             b = callback(b, replace([0, r.charCodeAt(i + 5)], 40));
  2392.           case 5:
  2393.             b = callback(b, replace([0, r.charCodeAt(i + 4)], 32));
  2394.           case 4:
  2395.             b = callback(b, replace([0, r.charCodeAt(i + 3)], 24));
  2396.           case 3:
  2397.             b = callback(b, replace([0, r.charCodeAt(i + 2)], 16));
  2398.           case 2:
  2399.             b = callback(b, replace([0, r.charCodeAt(i + 1)], 8));
  2400.           case 1:
  2401.             b = callback(b, [0, r.charCodeAt(i)]);
  2402.             b = $(b, a);
  2403.             b = normalize(b, 31);
  2404.             b = $(b, w);
  2405.             result = callback(result, b);
  2406.         }
  2407.         result = callback(result, [0, r.length]);
  2408.         value = callback(value, [0, r.length]);
  2409.         result = next(result, value);
  2410.         value = next(value, result);
  2411.         result = toArray(result);
  2412.         value = toArray(value);
  2413.         result = next(result, value);
  2414.         value = next(value, result);
  2415.         return ("00000000" + (result[0] >>> 0).toString(16)).slice(-8) + ("00000000" + (result[1] >>> 0).toString(16)).slice(-8) + ("00000000" + (value[0] >>> 0).toString(16)).slice(-8) + ("00000000" + (value[1] >>> 0).toString(16)).slice(-8);
  2416.       };
  2417.     }, function(inW, b, require) {
  2418.       /** @type {boolean} */
  2419.       b.a = true;
  2420.       var _ = require(6);
  2421.       inW = function() {
  2422.         /**
  2423.          * @return {undefined}
  2424.          */
  2425.         function RegisteredUser() {
  2426.         }
  2427.         /**
  2428.          * @return {?}
  2429.          */
  2430.         RegisteredUser.prototype.g = function() {
  2431.           return _.s(navigator.plugins).sort(function(a, b) {
  2432.             return a.name > b.name ? 1 : 2;
  2433.           }).map(function(val) {
  2434.             return [val.name, val.description, _.s(val).map(function(navMimeType) {
  2435.               return [navMimeType.description, navMimeType.suffixes, navMimeType.type].join();
  2436.             }).join()].join();
  2437.           }).join();
  2438.         };
  2439.         return RegisteredUser;
  2440.       }();
  2441.       /** @type {number} */
  2442.       b.w = inW;
  2443.     }, function(type, o, get) {
  2444.       var extend = this && this.U || Object.assign || function(a) {
  2445.         var b;
  2446.         /** @type {number} */
  2447.         var i = 1;
  2448.         /** @type {number} */
  2449.         var argl = arguments.length;
  2450.         for (; i < argl; i++) {
  2451.           b = arguments[i];
  2452.           var prop;
  2453.           for (prop in b) {
  2454.             if (Object.prototype.hasOwnProperty.call(b, prop)) {
  2455.               a[prop] = b[prop];
  2456.             }
  2457.           }
  2458.         }
  2459.         return a;
  2460.       };
  2461.       /** @type {boolean} */
  2462.       o.a = true;
  2463.       var color = get(1);
  2464.       var data = get(4);
  2465.       var values = get(0);
  2466.       var parsed_sig = get(2);
  2467.       var g = get(3);
  2468.       type = function() {
  2469.         /**
  2470.          * @param {number} l
  2471.          * @return {undefined}
  2472.          */
  2473.         function init(l) {
  2474.           var o = this;
  2475.           /** @type {number} */
  2476.           this.l = l;
  2477.           this.G = {
  2478.             webGL : color.A,
  2479.             dnt : parsed_sig.v,
  2480.             plugins : data.w,
  2481.             applePay : values.u
  2482.           };
  2483.           this.l = extend({
  2484.             webGL : false,
  2485.             dnt : false,
  2486.             plugins : false,
  2487.             applePay : false
  2488.           }, l);
  2489.           /** @type {!Array<?>} */
  2490.           this.F = Object.keys(this.l).filter(function(index) {
  2491.             return o.l[index];
  2492.           }).map(function(name) {
  2493.             return new o.G[name];
  2494.           });
  2495.         }
  2496.         /**
  2497.          * @param {number} minor
  2498.          * @return {?}
  2499.          */
  2500.         init.prototype.toString = function(minor) {
  2501.           if (void 0 === minor) {
  2502.             /** @type {boolean} */
  2503.             minor = true;
  2504.           }
  2505.           var b = this.F.map(function(domFixtures) {
  2506.             /** @type {string} */
  2507.             var c = "";
  2508.             try {
  2509.               c = domFixtures.g();
  2510.             } catch (Ma) {
  2511.             }
  2512.             return c;
  2513.           });
  2514.           return minor ? [g.hash(b.join(""), 210)] : b.map(function(a) {
  2515.             return g.hash(a, 210);
  2516.           });
  2517.         };
  2518.         return init;
  2519.       }();
  2520.       /** @type {!Function} */
  2521.       o.T = type;
  2522.       /** @type {!Function} */
  2523.       o["default"] = type;
  2524.     }, function(a, pfs) {
  2525.       /** @type {boolean} */
  2526.       pfs.a = true;
  2527.       /**
  2528.        * @param {!Object} val
  2529.        * @return {?}
  2530.        */
  2531.       pfs.s = function(val) {
  2532.         return Array.prototype.slice.call(val);
  2533.       };
  2534.     }]);
  2535.     debounceDelay = debounceDelay["default"];
  2536.   } catch (Console_error) {
  2537.     data = {
  2538.       error : Console_error,
  2539.       scope : "fip"
  2540.     };
  2541.   }
  2542.   var options = {
  2543.     protocol : "https:",
  2544.     baseUrl : "mc.yandex.",
  2545.     yandexWhiteListTld : "ru ua by kz az kg lv md tj tm uz ee fr co.il com.ge com.am com.tr".split(" ")
  2546.   };
  2547.   /** @type {string} */
  2548.   options.host = options.baseUrl + "ru";
  2549.   /** @type {string} */
  2550.   options.cross = "L21ldHJpa2EvenpsYy5odG1s";
  2551.   var _ = {
  2552.     mixin : function(obj) {
  2553.       var i;
  2554.       var prop;
  2555.       /** @type {number} */
  2556.       i = 1;
  2557.       for (; i < arguments.length; i++) {
  2558.         if (arguments[i]) {
  2559.           for (prop in arguments[i]) {
  2560.             if (arguments[i].hasOwnProperty(prop)) {
  2561.               obj[prop] = arguments[i][prop];
  2562.             }
  2563.           }
  2564.           if (arguments[i].hasOwnProperty("toString")) {
  2565.             obj.toString = arguments[i].toString;
  2566.           }
  2567.         }
  2568.       }
  2569.       return obj;
  2570.     }
  2571.   };
  2572.   /**
  2573.    * @param {number} staticProps
  2574.    * @return {undefined}
  2575.    */
  2576.   var Class = function(staticProps) {
  2577.     staticProps = staticProps || {};
  2578.     _.mixin(this, staticProps);
  2579.     this._initComponent();
  2580.   };
  2581.   /**
  2582.    * @return {undefined}
  2583.    */
  2584.   Class.prototype._initComponent = function() {
  2585.   };
  2586.   /**
  2587.    * @param {!Object} obj
  2588.    * @return {?}
  2589.    */
  2590.   Class.inherit = function(obj) {
  2591.     obj = obj || {};
  2592.     var superclass = "function" == typeof this ? this : Object;
  2593.     if (!obj.hasOwnProperty("constructor")) {
  2594.       /**
  2595.        * @return {undefined}
  2596.        */
  2597.       obj.constructor = function() {
  2598.         superclass.apply(this, arguments);
  2599.       };
  2600.     }
  2601.     /**
  2602.      * @return {undefined}
  2603.      */
  2604.     var subclass = function() {
  2605.     };
  2606.     subclass.prototype = superclass.prototype;
  2607.     obj.constructor.prototype = new subclass;
  2608.     _.mixin(obj.constructor.prototype, obj);
  2609.     /** @type {function(): undefined} */
  2610.     obj.constructor.prototype.constructor = obj.constructor;
  2611.     obj.constructor.superclass = superclass.prototype;
  2612.     /** @type {function(!Object): ?} */
  2613.     obj.constructor.inherit = Class.inherit;
  2614.     return obj.constructor;
  2615.   };
  2616.   /**
  2617.    * @param {!Object} object
  2618.    * @param {!Function} callback
  2619.    * @param {?} context
  2620.    * @return {undefined}
  2621.    */
  2622.   _.forEachKey = function(object, callback, context) {
  2623.     var name;
  2624.     for (name in object) {
  2625.       if (object.hasOwnProperty(name)) {
  2626.         callback.call(context, name, object[name], object);
  2627.       }
  2628.     }
  2629.   };
  2630.   /**
  2631.    * @param {!Object} a
  2632.    * @param {!Object} b
  2633.    * @return {?}
  2634.    */
  2635.   _.isEqual = function(a, b) {
  2636.     /** @type {boolean} */
  2637.     var equal = true;
  2638.     _.forEachKey(a, function(key, undefined) {
  2639.       if (!(b.hasOwnProperty(key) && b[key] === undefined)) {
  2640.         /** @type {boolean} */
  2641.         equal = false;
  2642.       }
  2643.     });
  2644.     if (!equal) {
  2645.       return equal;
  2646.     }
  2647.     _.forEachKey(b, function(prop, undefined) {
  2648.       if (!(a.hasOwnProperty(prop) && a[prop] === undefined)) {
  2649.         /** @type {boolean} */
  2650.         equal = false;
  2651.       }
  2652.     });
  2653.     return equal;
  2654.   };
  2655.   /**
  2656.    * @param {string} name
  2657.    * @param {!Object} obj
  2658.    * @return {?}
  2659.    */
  2660.   _.getNativeFunction = function(name, obj) {
  2661.     var fn;
  2662.     obj = obj || window;
  2663.     return (fn = obj.constructor && obj.constructor.prototype && obj.constructor.prototype[name] || obj[name]) && "apply" in fn ? function() {
  2664.       return fn.apply(obj, arguments);
  2665.     } : function() {
  2666.     };
  2667.   };
  2668.   /**
  2669.    * @param {!Function} t
  2670.    * @param {number} cb
  2671.    * @param {string} fn
  2672.    * @return {?}
  2673.    */
  2674.   _.setTimeout = function(t, cb, fn) {
  2675.     return _.getNativeFunction("setTimeout")(require(t, fn || "setTimeout"), cb);
  2676.   };
  2677.   var self = Class.inherit({
  2678.     _initComponent : function() {
  2679.       self.superclass._initComponent.apply(this, arguments);
  2680.       /** @type {!Array} */
  2681.       this._listeners = [];
  2682.     },
  2683.     on : function(elem, event, callback, scope, handler) {
  2684.       handler = self._getOpts(handler);
  2685.       event = event.split(",");
  2686.       var pos = event.length;
  2687.       var ret = this._listeners;
  2688.       var p;
  2689.       /** @type {number} */
  2690.       p = 0;
  2691.       for (; p < pos; p++) {
  2692.         var type = event[p];
  2693.         var genOp = require(function(evt) {
  2694.           callback.call(scope || this, evt || window.event);
  2695.         }, "on" + type + handler.name);
  2696.         /** @type {!Array} */
  2697.         ret[ret.length] = [elem, type, callback, scope, handler, genOp];
  2698.         if (elem.addEventListener) {
  2699.           elem.addEventListener(type, genOp, self._prepOpts(handler));
  2700.         } else {
  2701.           if (elem.attachEvent) {
  2702.             elem.attachEvent("on" + type, genOp);
  2703.           }
  2704.         }
  2705.       }
  2706.     },
  2707.     un : function(eventName, event, callback, obj, container) {
  2708.       container = self._getOpts(container);
  2709.       var listeners = this._listeners;
  2710.       var j = listeners.length;
  2711.       var i;
  2712.       /** @type {number} */
  2713.       i = 0;
  2714.       for (; i < j; i++) {
  2715.         var li = listeners[i];
  2716.         if (li[0] == eventName && li[1] == event && li[2] == callback && li[3] == obj && _.isEqual(li[4], container)) {
  2717.           listeners.splice(i, 1);
  2718.           this._removeListener(eventName, event, li[5], container);
  2719.           break;
  2720.         }
  2721.       }
  2722.     },
  2723.     unAll : function() {
  2724.       var _ref = this._listeners;
  2725.       var max = _ref.length;
  2726.       var j;
  2727.       /** @type {number} */
  2728.       j = 0;
  2729.       for (; j < max; j++) {
  2730.         var url = _ref[j];
  2731.         this._removeListener(url[0], url[1], url[5], url[4]);
  2732.       }
  2733.       /** @type {number} */
  2734.       _ref.length = 0;
  2735.     },
  2736.     _removeListener : function(element, type, callback, eventName) {
  2737.       if (element.removeEventListener) {
  2738.         element.removeEventListener(type, callback, self._prepOpts(eventName));
  2739.       } else {
  2740.         if (element.detachEvent) {
  2741.           element.detachEvent("on" + type, callback);
  2742.         }
  2743.       }
  2744.     }
  2745.   });
  2746.   /**
  2747.    * @return {?}
  2748.    */
  2749.   self.supportsPassive = function() {
  2750.     if (self._supportsPassive !== undefined) {
  2751.       return self._supportsPassive;
  2752.     }
  2753.     /** @type {boolean} */
  2754.     self._supportsPassive = false;
  2755.     try {
  2756.       /** @type {!Object} */
  2757.       var options = Object.defineProperty({}, "passive", {
  2758.         get : function() {
  2759.           /** @type {boolean} */
  2760.           self._supportsPassive = true;
  2761.         }
  2762.       });
  2763.       window.addEventListener("test", null, options);
  2764.     } catch (b) {
  2765.     }
  2766.     return self._supportsPassive;
  2767.   };
  2768.   /**
  2769.    * @param {!Object} options
  2770.    * @return {?}
  2771.    */
  2772.   self._getOpts = function(options) {
  2773.     return _.mixin({
  2774.       capture : true,
  2775.       passive : true
  2776.     }, options || {});
  2777.   };
  2778.   /**
  2779.    * @param {!Object} value
  2780.    * @return {?}
  2781.    */
  2782.   self._prepOpts = function(value) {
  2783.     return self.supportsPassive() ? value : !!value.capture;
  2784.   };
  2785.   /**
  2786.    * @return {undefined}
  2787.    */
  2788.   self.on = function() {
  2789.     if (!self._instance) {
  2790.       self._instance = new self;
  2791.     }
  2792.     self._instance.on.apply(self._instance, arguments);
  2793.   };
  2794.   /**
  2795.    * @return {undefined}
  2796.    */
  2797.   self.un = function() {
  2798.     if (self._instance) {
  2799.       self._instance.un.apply(self._instance, arguments);
  2800.     }
  2801.   };
  2802.   var context = {
  2803.     UNLOAD_MS : 0,
  2804.     isPerfomance : window.performance && window.performance.timing && window.performance.timing.navigationStart && window.performance.now,
  2805.     getMs : function() {
  2806.       return 0 < this.UNLOAD_MS ? this.UNLOAD_MS : this.isPerfomance ? Math.round(window.performance.timing.navigationStart + window.performance.now()) : +new Date;
  2807.     }
  2808.   };
  2809.   self.on(window, "beforeunload,unload", function() {
  2810.     if (0 === context.UNLOAD_MS) {
  2811.       context.UNLOAD_MS = context.getMs();
  2812.     }
  2813.   });
  2814.   /**
  2815.    * @param {number} i
  2816.    * @return {?}
  2817.    */
  2818.   _.pad = function(i) {
  2819.     return (10 > i ? "0" : "") + i;
  2820.   };
  2821.   /**
  2822.    * @return {?}
  2823.    */
  2824.   context.getTimestamp = function() {
  2825.     /** @type {!Date} */
  2826.     var data = new Date;
  2827.     /** @type {!Array} */
  2828.     data = [data.getFullYear(), data.getMonth() + 1, data.getDate(), data.getHours(), data.getMinutes(), data.getSeconds()];
  2829.     /** @type {string} */
  2830.     var result = "";
  2831.     var i;
  2832.     /** @type {number} */
  2833.     i = 0;
  2834.     for (; i < data.length; i++) {
  2835.       /** @type {string} */
  2836.       result = result + _.pad(data[i]);
  2837.     }
  2838.     return result;
  2839.   };
  2840.   /**
  2841.    * @return {?}
  2842.    */
  2843.   context.getTimezone = function() {
  2844.     return -(new Date).getTimezoneOffset();
  2845.   };
  2846.   /**
  2847.    * @return {?}
  2848.    */
  2849.   context.getMinutes = function() {
  2850.     return Math.floor(this.getMs() / 1E3 / 60);
  2851.   };
  2852.   /**
  2853.    * @return {?}
  2854.    */
  2855.   context.getSeconds = function() {
  2856.     return Math.round(this.getMs() / 1E3);
  2857.   };
  2858.   /**
  2859.    * @param {string} a
  2860.    * @return {?}
  2861.    */
  2862.   _.isArray = function(a) {
  2863.     return "function" == typeof Array.isArray ? Array.isArray(a) : "[object Array]" == Object.prototype.toString.call(a);
  2864.   };
  2865.   /**
  2866.    * @param {!Array} a
  2867.    * @return {?}
  2868.    */
  2869.   _.mergeArrays = function(a) {
  2870.     var j;
  2871.     var i;
  2872.     /** @type {number} */
  2873.     var argsLength = arguments.length;
  2874.     /** @type {number} */
  2875.     j = 1;
  2876.     for (; j < argsLength; j++) {
  2877.       var c = arguments[j];
  2878.       if (_.isArray(c) || c && "[object Arguments]" === c.toString()) {
  2879.         /** @type {number} */
  2880.         i = 0;
  2881.         for (; i < c.length; i++) {
  2882.           a[a.length] = c[i];
  2883.         }
  2884.       }
  2885.     }
  2886.     return a;
  2887.   };
  2888.   /**
  2889.    * @param {!Function} fn
  2890.    * @param {undefined} callback
  2891.    * @param {?} context
  2892.    * @param {!Array} params
  2893.    * @param {string} name
  2894.    * @return {?}
  2895.    */
  2896.   _.defer = function(fn, callback, context, params, name) {
  2897.     return _.setTimeout(function() {
  2898.       fn.apply(context, params || []);
  2899.     }, callback, name);
  2900.   };
  2901.   /**
  2902.    * @param {!Function} f
  2903.    * @param {number} fn
  2904.    * @param {(Object|string)} scope
  2905.    * @param {string} callback
  2906.    * @return {?}
  2907.    */
  2908.   _.throttle = function(f, fn, scope, callback) {
  2909.     var data;
  2910.     var arguments_;
  2911.     var req;
  2912.     return function() {
  2913.       /** @type {!Arguments} */
  2914.       arguments_ = arguments;
  2915.       req = this;
  2916.       if (!data) {
  2917.         (function() {
  2918.           /** @type {null} */
  2919.           data = null;
  2920.           if (arguments_) {
  2921.             f.apply(scope || req, arguments_);
  2922.             /** @type {null} */
  2923.             arguments_ = null;
  2924.             data = _.setTimeout(arguments.callee, fn, callback);
  2925.           }
  2926.         })();
  2927.       }
  2928.     };
  2929.   };
  2930.   var A = Class.inherit({
  2931.     storage : null,
  2932.     storageKey : "dataBuffer",
  2933.     maxBufferSize : 255,
  2934.     flushTimeout : 1E4,
  2935.     startBufferTime : 0,
  2936.     active : true,
  2937.     meta : null,
  2938.     onFlush : function() {
  2939.     },
  2940.     onFlushCtx : null,
  2941.     bufferExpireTime : 864E5,
  2942.     _initComponent : function() {
  2943.       var summary;
  2944.       A.superclass._initComponent.apply(this, arguments);
  2945.       /** @type {!Array} */
  2946.       this._data = [];
  2947.       /** @type {number} */
  2948.       this._packetNumber = 0;
  2949.       /** @type {null} */
  2950.       this._flushTID = null;
  2951.       this._saveToStorageThrottled = _.throttle(this._saveToStorage, 300, this, "DataBuffer._saveToStorage");
  2952.       if (this.storage && (summary = this.storage.get(this.storageKey)) && summary.data && summary.meta && summary.time && summary.time + this.bufferExpireTime > +context.getMs()) {
  2953.         this.onFlush.call(this.onFlushCtx || this, this.dataFromStorage(summary.data), summary.meta, summary.pnum);
  2954.       }
  2955.       this.clear();
  2956.     },
  2957.     getFlushSize : function() {
  2958.       return this._data.length;
  2959.     },
  2960.     mergeData : function(data, source) {
  2961.       _.mergeArrays(data, source);
  2962.     },
  2963.     append : function(a, size) {
  2964.       this.mergeData(this._data, a);
  2965.       this._saveToStorageThrottled();
  2966.       if (this.active) {
  2967.         if (size || this.getFlushSize() >= this.maxBufferSize || this.getFlushSize() === this.maxChunkSize) {
  2968.           this._flush(size);
  2969.         }
  2970.         if (!this._flushTID) {
  2971.           this._flushTID = _.defer(this._flush, this.flushTimeout, this, [size], "DataBuffer._flush");
  2972.         }
  2973.       }
  2974.     },
  2975.     activate : function() {
  2976.       if (!this.active) {
  2977.         /** @type {boolean} */
  2978.         this.active = true;
  2979.         this.append([]);
  2980.       }
  2981.     },
  2982.     clear : function() {
  2983.       /** @type {number} */
  2984.       this._data.length = 0;
  2985.       /** @type {null} */
  2986.       this._flushTID = null;
  2987.       if (this.storage) {
  2988.         this.storage.remove(this.storageKey);
  2989.       }
  2990.     },
  2991.     _flush : function(callback) {
  2992.       if (!this.getFlushSize()) {
  2993.         return this.clear(), false;
  2994.       }
  2995.       this.onFlush.call(this.onFlushCtx || this, this._data, this.meta, this._packetNumber, callback);
  2996.       this._packetNumber++;
  2997.       this.clear();
  2998.     },
  2999.     dataFromStorage : function(a) {
  3000.       return a;
  3001.     },
  3002.     dataToStorage : function(a) {
  3003.       return a;
  3004.     },
  3005.     _saveToStorage : function() {
  3006.       if (this.storage && this._data.length) {
  3007.         this.storage.set(this.storageKey, {
  3008.           data : this.dataToStorage(this._data),
  3009.           meta : this.meta,
  3010.           pnum : this._packetNumber,
  3011.           time : context.getMs()
  3012.         });
  3013.       }
  3014.     }
  3015.   });
  3016.   var api = {
  3017.     storage : {},
  3018.     init : function() {
  3019.       var settee = this;
  3020.       require(function() {
  3021.         window.Ya = window.Ya || {};
  3022.         window.Ya._metrika = window.Ya._metrika || {};
  3023.         settee.storage = window.Ya._metrika;
  3024.       }, "", true)();
  3025.       return this;
  3026.     },
  3027.     setSafe : function(i, k) {
  3028.       var target = this;
  3029.       require(function() {
  3030.         if (target.storage[i] === undefined) {
  3031.           /** @type {string} */
  3032.           target.storage[i] = k;
  3033.         }
  3034.       }, "", true)();
  3035.       return this;
  3036.     },
  3037.     set : function(value, object) {
  3038.       require(function() {
  3039.         /** @type {string} */
  3040.         window.Ya._metrika[value] = object;
  3041.       }, "", true)();
  3042.       return this;
  3043.     },
  3044.     get : function(s, v) {
  3045.       return require(function() {
  3046.         var t = window.Ya._metrika[s];
  3047.         return t === undefined ? v : t;
  3048.       }, "", true)();
  3049.     }
  3050.   };
  3051.   /**
  3052.    * @param {!Function} task
  3053.    * @param {?} callback
  3054.    * @param {string} selector
  3055.    * @return {undefined}
  3056.    */
  3057.   _.async = function(task, callback, selector) {
  3058.     if (window.postMessage) {
  3059.       /** @type {string} */
  3060.       var data = "__ym__promise" + Math.random() + "_" + context.getMs();
  3061.       /**
  3062.        * @param {!Object} e
  3063.        * @return {undefined}
  3064.        */
  3065.       var fn = function(e) {
  3066.         if (e.data === data) {
  3067.           if (e.stopPropagation) {
  3068.             e.stopPropagation();
  3069.           }
  3070.           task.call(callback);
  3071.           self.un(window, "message", fn, null, {
  3072.             passive : false
  3073.           });
  3074.         }
  3075.       };
  3076.       self.on(window, "message", fn, null, {
  3077.         passive : false,
  3078.         name : ".async." + (selector || "")
  3079.       });
  3080.       window.postMessage(data, "*");
  3081.     } else {
  3082.       _.setTimeout(function() {
  3083.         task.call(callback);
  3084.       }, 0);
  3085.     }
  3086.   };
  3087.   var httpModule = Class.inherit({
  3088.     transports : [],
  3089.     globalConfig : api,
  3090.     postParams : [],
  3091.     isDisabled : function() {
  3092.       return this.globalConfig.get("oo");
  3093.     },
  3094.     send : function(str, data, c, name) {
  3095.       /** @type {!Array} */
  3096.       var values = [str];
  3097.       var item = this;
  3098.       var _client = c || function() {
  3099.       };
  3100.       if (item.isDisabled()) {
  3101.         _client.call(name);
  3102.       } else {
  3103.         (function run(i) {
  3104.           if (i < this.transports.length) {
  3105.             try {
  3106.               var self = new this.transports[i]({
  3107.                 postParams : this.postParams,
  3108.                 queryStringParams : this.queryStringParams
  3109.               });
  3110.               data["browser-info"] = self.logInfo(data["browser-info"]);
  3111.               (function map(i) {
  3112.                 if (i >= values.length) {
  3113.                   if (!self.blockNext()) {
  3114.                     run.call(this, i + 1);
  3115.                   }
  3116.                 } else {
  3117.                   self.request(values[i], data, function(a, message, value) {
  3118.                     if (a) {
  3119.                       _client.call(name, message, value);
  3120.                     } else {
  3121.                       _.async(function() {
  3122.                         map.call(item, i + 1);
  3123.                       });
  3124.                     }
  3125.                   }, this);
  3126.                 }
  3127.               }).call(this, 0);
  3128.             } catch (moduleLoader) {
  3129.               load(moduleLoader, "send by " + (self && self.id));
  3130.               run.call(this, i + 1);
  3131.             }
  3132.           }
  3133.         }).call(this, 0);
  3134.       }
  3135.     }
  3136.   });
  3137.   var s = {};
  3138.   /**
  3139.    * @param {!Object} object
  3140.    * @return {?}
  3141.    */
  3142.   _.keys = function(object) {
  3143.     var i;
  3144.     /** @type {!Array} */
  3145.     var objKeys = [];
  3146.     for (i in object) {
  3147.       if (object.hasOwnProperty(i)) {
  3148.         objKeys.push(i);
  3149.       }
  3150.     }
  3151.     return objKeys;
  3152.   };
  3153.   /**
  3154.    * @param {!Function} op
  3155.    * @param {!Array} data
  3156.    * @return {?}
  3157.    */
  3158.   _.map = function(op, data) {
  3159.     var i;
  3160.     /** @type {!Array} */
  3161.     var result = [];
  3162.     /** @type {number} */
  3163.     i = 0;
  3164.     for (; i < data.length; i++) {
  3165.       result.push(op(data[i], i));
  3166.     }
  3167.     return result;
  3168.   };
  3169.   /**
  3170.    * @param {!Object} data
  3171.    * @param {!Object} doc
  3172.    * @return {?}
  3173.    */
  3174.   s.stringify = function(data, doc) {
  3175.     /** @type {!Array} */
  3176.     var c = [];
  3177.     var d = doc || {};
  3178.     var ids = {};
  3179.     var id = _.keys(data).length;
  3180.     var i;
  3181.     var j;
  3182.     if (d.lastOrdering !== undefined) {
  3183.       /** @type {number} */
  3184.       j = 1;
  3185.       for (; j <= doc.lastOrdering.length; j++) {
  3186.         ids[doc.lastOrdering[j - 1]] = id + j;
  3187.       }
  3188.     }
  3189.     if (d.firstOrdering !== undefined) {
  3190.       /** @type {number} */
  3191.       j = 0;
  3192.       for (; j < doc.firstOrdering.length; j++) {
  3193.         /** @type {number} */
  3194.         ids[doc.firstOrdering[j]] = j;
  3195.       }
  3196.     }
  3197.     for (i in data) {
  3198.       if (data.hasOwnProperty(i)) {
  3199.         if (d = data[i], _.isArray(d)) {
  3200.           /** @type {number} */
  3201.           j = 0;
  3202.           for (; j < d.length; j++) {
  3203.             c.push({
  3204.               key : i,
  3205.               value : encodeURIComponent(i) + "=" + encodeURIComponent(String(d[j]))
  3206.             });
  3207.           }
  3208.         } else {
  3209.           c.push({
  3210.             key : i,
  3211.             value : encodeURIComponent(i) + "=" + encodeURIComponent(String(d))
  3212.           });
  3213.         }
  3214.       }
  3215.     }
  3216.     c.sort(function(component, asset) {
  3217.       var tmp = ids[component.key];
  3218.       var target = ids[asset.key];
  3219.       if ("undefined" === typeof tmp) {
  3220.         tmp = id;
  3221.       }
  3222.       if ("undefined" === typeof target) {
  3223.         target = id;
  3224.       }
  3225.       return tmp - target;
  3226.     });
  3227.     return _.map(function(select_ele) {
  3228.       return select_ele.value;
  3229.     }, c).join("&");
  3230.   };
  3231.   /**
  3232.    * @param {!Array} c
  3233.    * @param {string} b
  3234.    * @return {?}
  3235.    */
  3236.   _.inArray = function(c, b) {
  3237.     var i;
  3238.     /** @type {number} */
  3239.     i = 0;
  3240.     for (; i < c.length; i++) {
  3241.       if (c[i] == b) {
  3242.         return true;
  3243.       }
  3244.     }
  3245.     return false;
  3246.   };
  3247.   var $ = Class.inherit({
  3248.     postParams : [],
  3249.     index : 0,
  3250.     blockNext : function() {
  3251.       return false;
  3252.     },
  3253.     logInfo : function(text) {
  3254.       var matches;
  3255.       if (text) {
  3256.         return text = (matches = text.match(/^ti:\d:/)) ? text.replace(matches[0], "") : text, "ti:" + this.index + ":" + text;
  3257.       }
  3258.     },
  3259.     _buildUrl : function(path, args) {
  3260.       var child = s.stringify(args, this.queryStringParams);
  3261.       return path + (-1 < path.indexOf("?") ? "&" : child ? "?" : "") + child;
  3262.     },
  3263.     _splitParams : function(obj) {
  3264.       var b = {};
  3265.       var metaData = {};
  3266.       _.forEachKey(obj, function(tag, value) {
  3267.         if (_.inArray(this.postParams, tag)) {
  3268.           metaData[tag] = value;
  3269.         } else {
  3270.           b[tag] = value;
  3271.         }
  3272.       }, this);
  3273.       return {
  3274.         get : b,
  3275.         post : metaData
  3276.       };
  3277.     },
  3278.     _parseResp : function(obj) {
  3279.       return obj;
  3280.     }
  3281.   });
  3282.   var inputs = $.inherit({
  3283.     id : "XHR",
  3284.     index : 7,
  3285.     method : "POST",
  3286.     withCredentials : true,
  3287.     request : function(service, data, test, conn) {
  3288.       var validatorSet = this;
  3289.       var f;
  3290.       if (/[^a-z0-9.:-]/.test(result.host) && window.opera && "function" === typeof window.opera.version) {
  3291.         var ppties = window.opera.version();
  3292.         if ("string" === typeof ppties && "12" === ppties.split(".")[0]) {
  3293.           return test.call(conn, false);
  3294.         }
  3295.       }
  3296.       if (window.XMLHttpRequest) {
  3297.         /** @type {!XMLHttpRequest} */
  3298.         var xhr = new XMLHttpRequest;
  3299.         if ("withCredentials" in xhr) {
  3300.           data = this._splitParams(data);
  3301.           service = this._buildUrl(service, data.get);
  3302.           try {
  3303.             xhr.open(this.method, service, true);
  3304.           } catch (G) {
  3305.             return test.call(conn, false);
  3306.           }
  3307.           xhr.withCredentials = this.withCredentials;
  3308.           this._setHeaders(xhr);
  3309.           xhr.send(this._preparePostParams(data));
  3310.           /**
  3311.            * @return {?}
  3312.            */
  3313.           xhr.onreadystatechange = function() {
  3314.             if (4 === xhr.readyState) {
  3315.               try {
  3316.                 f = validatorSet._parseResp(xhr.responseText);
  3317.               } catch (G) {
  3318.                 return test.call(conn, false);
  3319.               }
  3320.               test.apply(conn, [200 === xhr.status].concat(f));
  3321.             }
  3322.           };
  3323.           return;
  3324.         }
  3325.       }
  3326.       test.call(conn, false);
  3327.     },
  3328.     setMethod : function(method) {
  3329.       /** @type {!Object} */
  3330.       this.method = method;
  3331.     },
  3332.     _preparePostParams : function(a) {
  3333.       return s.stringify(a.post);
  3334.     },
  3335.     _setHeaders : function(xhr) {
  3336.       xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
  3337.     }
  3338.   });
  3339.   var $scope = {};
  3340.   $scope.isAndroidWebView = require(function() {
  3341.     /** @type {string} */
  3342.     var uri_display = navigator.userAgent || "";
  3343.     return uri_display.match(/Android.*Version\/[0-9][0-9.]*\sChrome\/[0-9][0-9.]/) || uri_display.match(/Android.*Version\/[0-9][0-9.]*\s(?:Mobile\s)?Safari\/[0-9][0-9.]*\sChrome\/[0-9][0-9.]*/) || uri_display.match(/; wv\).*Chrome\/[0-9][0-9.]*\sMobile/);
  3344.   }, "isAndroidWebView");
  3345.   var fileTransport = $.inherit({
  3346.     id : "beacon",
  3347.     index : 1,
  3348.     request : function(uri, options, d, k) {
  3349.       if ("function" === typeof navigator.sendBeacon && !$scope.isAndroidWebView() && navigator.onLine) {
  3350.         options = this._splitParams(options);
  3351.         /** @type {number} */
  3352.         options.get["force-urlencoded"] = 1;
  3353.         d.call(k, navigator.sendBeacon(this._buildUrl(uri, options.get), s.stringify(options.post)));
  3354.       } else {
  3355.         d.call(k, false);
  3356.       }
  3357.     }
  3358.   });
  3359.   /**
  3360.    * @param {number} b
  3361.    * @param {number} a
  3362.    * @return {?}
  3363.    */
  3364.   _.random = function(b, a) {
  3365.     if (2 > arguments.length) {
  3366.       /** @type {number} */
  3367.       a = b;
  3368.       /** @type {number} */
  3369.       b = 0;
  3370.     }
  3371.     if (1 > arguments.length) {
  3372.       /** @type {number} */
  3373.       a = 1073741824;
  3374.     }
  3375.     return Math.floor(Math.random() * (a - b)) + b;
  3376.   };
  3377.   var ret = $.inherit({
  3378.     id : "form",
  3379.     index : 2,
  3380.     enctype : "application/x-www-form-urlencoded",
  3381.     htmlfileOnly : false,
  3382.     _initComponent : function() {
  3383.       ret.superclass._initComponent.apply(this, arguments);
  3384.       if (!("_htmlfile" in ret.prototype)) {
  3385.         ret.prototype._htmlfile = this._createHtmlfile();
  3386.       }
  3387.       this._doc = this._htmlfile || (this.htmlfileOnly ? null : document);
  3388.     },
  3389.     request : function(service, params, origin, listener) {
  3390.       var doc = this._doc;
  3391.       if (!doc) {
  3392.         return origin.call(listener, false);
  3393.       }
  3394.       params = this._splitParams(params);
  3395.       /** @type {string} */
  3396.       var protocol = "ifr" + _.random();
  3397.       var h = doc.createElement("div");
  3398.       /** @type {string} */
  3399.       h.style.position = "absolute";
  3400.       /** @type {string} */
  3401.       h.style.left = "-99999px";
  3402.       /** @type {string} */
  3403.       h.style.top = "-99999px";
  3404.       /** @type {!Array} */
  3405.       var keys = ['<iframe name="', protocol, '"></iframe>', '<form action="', this._buildUrl(service, params.get), '" method="post" target="', protocol, '" enctype="', this.enctype, '">'];
  3406.       _.forEachKey(params.post, function(index) {
  3407.         _.mergeArrays(keys, ['<input type="hidden" autocomplete="off" autocorrect="off"', ' autocapitalize="off" spellcheck="false" name="', index, '"/>']);
  3408.       });
  3409.       _.mergeArrays(keys, ["</form>"]);
  3410.       /** @type {string} */
  3411.       h.innerHTML = keys.join("");
  3412.       doc.body.appendChild(h);
  3413.       var form = h.getElementsByTagName("form")[0];
  3414.       _.forEachKey(params.post, function(name, initSBC) {
  3415.         /** @type {!Object} */
  3416.         form[name].value = initSBC;
  3417.       });
  3418.       form.submit();
  3419.       _.setTimeout(function() {
  3420.         doc.body.removeChild(h);
  3421.       }, 1E4, "TransportForm.request.2");
  3422.       return origin.call(listener, true, "tf.request");
  3423.     },
  3424.     _createHtmlfile : function() {
  3425.       try {
  3426.         if (window.ActiveXObject) {
  3427.           var doc = new ActiveXObject("htmlfile");
  3428.           doc.open();
  3429.           doc.write("<html><body></body></html>");
  3430.           doc.close();
  3431.           return doc;
  3432.         }
  3433.       } catch (b) {
  3434.       }
  3435.       return null;
  3436.     }
  3437.   });
  3438.   var Lb = ret.inherit({
  3439.     id : "htmlfile",
  3440.     index : 3,
  3441.     htmlfileOnly : true
  3442.   });
  3443.   var ReqRes = $.inherit({
  3444.     id : "img",
  3445.     index : 4,
  3446.     request : function(url, req, config, api) {
  3447.       url = this._buildUrl(url, req);
  3448.       /** @type {boolean} */
  3449.       var e = false;
  3450.       /** @type {!Element} */
  3451.       req = document.createElement("img");
  3452.       config = config || function() {
  3453.       };
  3454.       req.onload = require(function() {
  3455.         if (!e) {
  3456.           config.call(api, true);
  3457.           /** @type {boolean} */
  3458.           e = true;
  3459.         }
  3460.       }, "TransportImage.request");
  3461.       req.onerror = require(function() {
  3462.         if (!e) {
  3463.           config.call(api, false);
  3464.           /** @type {boolean} */
  3465.           e = true;
  3466.         }
  3467.       }, "TransportImage.request");
  3468.       /** @type {string} */
  3469.       req.src = url;
  3470.       if (this.timeout) {
  3471.         _.setTimeout(function() {
  3472.           if (!e) {
  3473.             config.call(api, false);
  3474.             /** @type {boolean} */
  3475.             e = true;
  3476.           }
  3477.         }, this.timeout, "ti.request");
  3478.       }
  3479.     }
  3480.   });
  3481.   var service = {
  3482.     stringify : function(arr) {
  3483.       try {
  3484.         /** @type {string} */
  3485.         var x = JSON.stringify(arr);
  3486.       } catch (c) {
  3487.       }
  3488.       return _.inArray(["{}", undefined], x) ? "null" : x;
  3489.     }
  3490.   };
  3491.   /**
  3492.    * @param {!Object} value
  3493.    * @return {?}
  3494.    */
  3495.   _.toJSON = function(value) {
  3496.     var position;
  3497.     if (value === undefined) {
  3498.       return "";
  3499.     }
  3500.     if (null === value) {
  3501.       return "null";
  3502.     }
  3503.     switch(value.constructor) {
  3504.       case Boolean:
  3505.         return value.toString();
  3506.       case Number:
  3507.         return isFinite(value) ? value.toString() : "null";
  3508.       case String:
  3509.         return '"' + value.replace(/\\/g, "\\\\").replace(/"/g, '\\"').replace(/\n/g, "\\n").replace(/\r/g, "\\r") + '"';
  3510.       case Array:
  3511.         /** @type {!Array} */
  3512.         var displayUsedBy = [];
  3513.         /** @type {number} */
  3514.         var key = 0;
  3515.         position = value.length;
  3516.         for (; key < position; key++) {
  3517.           displayUsedBy[displayUsedBy.length] = _.toJSON(value[key]);
  3518.         }
  3519.         return "[" + displayUsedBy.join(",") + "]";
  3520.       case Object:
  3521.         /** @type {!Array} */
  3522.         displayUsedBy = [];
  3523.         for (key in value) {
  3524.           if (value.hasOwnProperty(key) && value[key] !== undefined) {
  3525.             /** @type {string} */
  3526.             displayUsedBy[displayUsedBy.length] = _.toJSON(key) + ":" + _.toJSON(value[key]);
  3527.           }
  3528.         }
  3529.         return "{" + displayUsedBy.join(",") + "}";
  3530.       default:
  3531.         return service.stringify(value);
  3532.     }
  3533.   };
  3534.   var Array = Class.inherit({
  3535.     counterId : "",
  3536.     _initComponent : function() {
  3537.       Array.superclass._initComponent.apply(this, arguments);
  3538.       /** @type {null} */
  3539.       this._ls = null;
  3540.       try {
  3541.         /** @type {(Storage|null)} */
  3542.         this._ls = window.localStorage;
  3543.       } catch (a) {
  3544.       }
  3545.     },
  3546.     set : function(s, value) {
  3547.       if (this.isEnabled()) {
  3548.         try {
  3549.           if (!value || value && _.isArray(value) && !value.length) {
  3550.             this.remove(s);
  3551.           } else {
  3552.             this._ls.setItem(this._getLsKey(s), _.toJSON(value));
  3553.           }
  3554.         } catch (c) {
  3555.         }
  3556.       }
  3557.     },
  3558.     get : function(s) {
  3559.       if (this.isEnabled()) {
  3560.         try {
  3561.           return JSON.parse(this._ls.getItem(this._getLsKey(s)));
  3562.         } catch (b) {
  3563.         }
  3564.       }
  3565.       return null;
  3566.     },
  3567.     remove : function(obj) {
  3568.       if (this.isEnabled()) {
  3569.         try {
  3570.           this._ls.removeItem(this._getLsKey(obj));
  3571.         } catch (b) {
  3572.         }
  3573.       }
  3574.     },
  3575.     isEnabled : function() {
  3576.       return this._ls && window.JSON && "object" == typeof this._ls && "object" == typeof window.JSON;
  3577.     },
  3578.     getStorageId : function() {
  3579.       var a = this.get("lsid");
  3580.       if (!a) {
  3581.         /** @type {number} */
  3582.         a = Math.round(Math.random() * context.getMs());
  3583.         this.set("lsid", a);
  3584.       }
  3585.       return a;
  3586.     },
  3587.     clearStorageId : function() {
  3588.       this.remove("lsid");
  3589.     },
  3590.     _getLsKey : function(s) {
  3591.       return "_ym" + this.counterId + "_" + s;
  3592.     }
  3593.   });
  3594.   /**
  3595.    * @return {?}
  3596.    */
  3597.   _.getTld = function() {
  3598.     if (!this._tld) {
  3599.       var expRecords = result.hostname.split(".");
  3600.       this._tld = expRecords[expRecords.length - 1];
  3601.     }
  3602.     return this._tld;
  3603.   };
  3604.   var that = {
  3605.     abc : "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",
  3606.     tail : "+/=",
  3607.     tailSafe : "*-_"
  3608.   };
  3609.   var util = {
  3610.     removeNode : function(n) {
  3611.       var b = n && n.parentNode;
  3612.       if (b) {
  3613.         b.removeChild(n);
  3614.       }
  3615.     }
  3616.   };
  3617.   $scope.isSafariWebView = require(function() {
  3618.     /** @type {string} */
  3619.     var ua = navigator.userAgent || "";
  3620.     return navigator.vendor && -1 < navigator.vendor.indexOf("Apple") && (!ua.match(/Safari/) && ua.match(/Mobile/) || ua.match(/CFNetwork\/[0-9][0-9.]*.*Darwin\/[0-9][0-9.]*/) || -1 !== ua.indexOf("FB_IAB") || -1 !== ua.indexOf("FBAV") || -1 !== ua.indexOf("OKApp") || -1 !== ua.indexOf("GSA/"));
  3621.   }, "isSafariWebView");
  3622.   /**
  3623.    * @return {?}
  3624.    */
  3625.   $scope.isSafari = function() {
  3626.     try {
  3627.       return navigator.vendor && -1 < navigator.vendor.indexOf("Apple") && navigator.userAgent && !navigator.userAgent.match("CriOS");
  3628.     } catch (a) {
  3629.     }
  3630.     return false;
  3631.   };
  3632.   $scope.getMacOSVersion = require(function() {
  3633.     /** @type {(Array<string>|null)} */
  3634.     var a = navigator.userAgent.match(/Mac OS X ([0-9]+)_([0-9]+)_([0-9]+)/);
  3635.     return a ? [+a[1], +a[2], +a[2]] : [0, 0, 0];
  3636.   }, "", true);
  3637.   $scope.getPlatform = require(function() {
  3638.     return "" + navigator.platform;
  3639.   }, "", true);
  3640.   $scope.isIOS = require(function() {
  3641.     var a = $scope.getPlatform() || "";
  3642.     return "iPhone" === a || "iPad" === a;
  3643.   }, "", true);
  3644.   var open = {
  3645.     _storage : new Array,
  3646.     key : "zzlc",
  3647.     getZZ : function() {
  3648.       return this._storage.get(this.key) ? this._storage.get(this.key) : open.zz;
  3649.     },
  3650.     initZZ : function() {
  3651.       var me = this;
  3652.       var frame = $scope.getMacOSVersion();
  3653.       if (($scope.isIOS() || 10 <= frame[0] && 13 <= frame[2]) && $scope.isSafari() && !this.getZZ() && !$scope.isSafariWebView()) {
  3654.         frame = _.getNativeFunction("createElement", document)("iframe");
  3655.         /** @type {string} */
  3656.         frame.style.display = "none";
  3657.         /** @type {string} */
  3658.         frame.style.width = "1px";
  3659.         /** @type {string} */
  3660.         frame.style.height = "1px";
  3661.         /** @type {string} */
  3662.         frame.style.visibility = "hidden";
  3663.         /** @type {string} */
  3664.         frame.src = options.protocol + "//" + options.host + that.decode(options.cross);
  3665.         window.document.documentElement.appendChild(frame);
  3666.         self.on(window, "message", this.onMessage, this, {
  3667.           passive : false
  3668.         });
  3669.         this.frame = frame;
  3670.         this.timeout = _.setTimeout(function() {
  3671.           self.un(window, "message", me.onMessage, me, {
  3672.             passive : false
  3673.           });
  3674.           util.removeNode(me.frame);
  3675.           /** @type {string} */
  3676.           me.zz = "na";
  3677.         }, 3E3, "cd.initZZ");
  3678.       }
  3679.     },
  3680.     onMessage : function(task) {
  3681.       if (task.data && task.data.substr && "__ym__zz" === task.data.substr(0, 8)) {
  3682.         this.zz = task.data.substr(8);
  3683.         util.removeNode(this.frame);
  3684.         this._storage.set(this.key, this.zz);
  3685.         self.un(window, "message", this.onMessage, this, {
  3686.           passive : false
  3687.         });
  3688.         clearTimeout(this.timeout);
  3689.       }
  3690.     }
  3691.   };
  3692.   var Error = Class.inherit({
  3693.     counterId : "",
  3694.     onlyCurrentDomain : false,
  3695.     skipPrefix : false,
  3696.     _initComponent : function() {
  3697.       var i;
  3698.       Error.superclass._initComponent.apply(this, arguments);
  3699.       /** @type {null} */
  3700.       this._domain = null;
  3701.       if (!this.onlyCurrentDomain) {
  3702.         /** @type {!Array<string>} */
  3703.         var s = window.location.host.split(".");
  3704.         /** @type {number} */
  3705.         i = 2;
  3706.         for (;;) {
  3707.           if (i <= s.length) {
  3708.             if (this._domain = "." + s.slice(-i).join("."), i++, this.isEnabled()) {
  3709.               break;
  3710.             }
  3711.           } else {
  3712.             /** @type {null} */
  3713.             this._domain = null;
  3714.             break;
  3715.           }
  3716.         }
  3717.       }
  3718.     },
  3719.     create : function(a, b, prop) {
  3720.       /** @type {!Array} */
  3721.       a = [this._prepareName(a) + "=" + encodeURIComponent(b)];
  3722.       if (prop) {
  3723.         /** @type {!Date} */
  3724.         b = new Date;
  3725.         b.setTime(b.getTime() + 6E4 * prop);
  3726.         a.push("expires=" + b.toGMTString());
  3727.       }
  3728.       if (this._domain) {
  3729.         a.push("domain=" + this._domain);
  3730.       }
  3731.       a.push("path=/");
  3732.       try {
  3733.         /** @type {string} */
  3734.         document.cookie = a.join(";");
  3735.       } catch (d) {
  3736.       }
  3737.     },
  3738.     read : function(key) {
  3739.       try {
  3740.         /** @type {string} */
  3741.         var cookie = document.cookie;
  3742.       } catch (c) {
  3743.       }
  3744.       return cookie && cookie.match(new RegExp("(?:^|;\\s*)" + this._prepareName(key) + "=([^;]*)")) ? decodeURIComponent(RegExp.$1) : null;
  3745.     },
  3746.     erase : function(start) {
  3747.       this.create(start, "", -1);
  3748.     },
  3749.     isEnabled : function() {
  3750.       this.create("metrika_enabled", "1", 60);
  3751.       /** @type {boolean} */
  3752.       var enabled = !!this.read("metrika_enabled");
  3753.       this.erase("metrika_enabled");
  3754.       return enabled;
  3755.     },
  3756.     _prepareName : function(url) {
  3757.       return (this.skipPrefix ? "" : "_ym_") + url + (this.counterId ? "_" + this.counterId : "");
  3758.     }
  3759.   });
  3760.   /**
  3761.    * @param {string} s
  3762.    * @return {?}
  3763.    */
  3764.   Error.get = function(s) {
  3765.     return (new Error({
  3766.       onlyCurrentDomain : true
  3767.     })).read(s);
  3768.   };
  3769.   /**
  3770.    * @param {string} s
  3771.    * @param {string} b
  3772.    * @param {undefined} status
  3773.    * @return {?}
  3774.    */
  3775.   Error.set = function(s, b, status) {
  3776.     return (new Error({
  3777.       onlyCurrentDomain : true
  3778.     })).create(s, b, status);
  3779.   };
  3780.   /**
  3781.    * @return {?}
  3782.    */
  3783.   Error.isEnabled = function() {
  3784.     return (new Error({
  3785.       onlyCurrentDomain : true
  3786.     })).isEnabled();
  3787.   };
  3788.   var config = httpModule.inherit({
  3789.     protocol : "",
  3790.     host : options.host,
  3791.     queryStringParams : {
  3792.       firstOrdering : ["wmode", "callback", "cnt-class"],
  3793.       lastOrdering : ["browser-info"]
  3794.     },
  3795.     resource : "",
  3796.     counterId : "",
  3797.     counterType : 0,
  3798.     retry : false,
  3799.     transports : [fileTransport, inputs, ReqRes, Lb],
  3800.     _initComponent : function() {
  3801.       config.superclass._initComponent.apply(this, arguments);
  3802.       if (this.retry) {
  3803.         this._storage = new Array;
  3804.       }
  3805.     },
  3806.     send : function(n, a, e, data) {
  3807.       var p = this.globalConfig.get(img.globalKey);
  3808.       var helpers = this;
  3809.       if (p && 3 !== this.counterId) {
  3810.         p(function() {
  3811.           var text = helpers._registerRequest(n, a);
  3812.           helpers._sendSavedRequest(text, n, a, e, data);
  3813.         }, n);
  3814.       } else {
  3815.         p = helpers._registerRequest(n, a);
  3816.         helpers._sendSavedRequest(p, n, a, e, data);
  3817.       }
  3818.     },
  3819.     _sendSavedRequest : function(to, ns, data, t, d) {
  3820.       var cp = this.globalConfig.get("firstReqStatus");
  3821.       var model = ns.forceNoRedirect;
  3822.       if ("process" == cp) {
  3823.         this.globalConfig.set("firstReqCallbacks", _.mergeArrays(this.globalConfig.get("firstReqCallbacks") || [], [[this, arguments]]));
  3824.       } else {
  3825.         if (!cp) {
  3826.           this.globalConfig.set("firstReqStatus", "process");
  3827.         }
  3828.         if (this.counterType) {
  3829.           ns["cnt-class"] = this.counterType;
  3830.         }
  3831.         data.st = context.getSeconds();
  3832.         data.u = config._userID;
  3833.         data.fip = config.getFP();
  3834.         if (!data.fip) {
  3835.           delete data.fip;
  3836.         }
  3837.         data.zz = open.getZZ();
  3838.         if (!data.zz) {
  3839.           delete data.zz;
  3840.         }
  3841.         /** @type {string} */
  3842.         cp = [this.protocol, "//", this.host, "/", this.resource, "/", this.counterId, model ? "/1" : ""].join("");
  3843.         delete ns.forceNoRedirect;
  3844.         /** @type {!Array} */
  3845.         var p = [];
  3846.         if (data) {
  3847.           _.forEachKey(data, function(value, joinConfigName) {
  3848.             if ("t" != value) {
  3849.               _.mergeArrays(p, [value, joinConfigName]);
  3850.             }
  3851.           });
  3852.           if (data.t) {
  3853.             _.mergeArrays(p, ["t", data.t]);
  3854.           }
  3855.         }
  3856.         if (p.length) {
  3857.           /** @type {string} */
  3858.           ns["browser-info"] = p.join(":");
  3859.         }
  3860.         return config.superclass.send.call(this, cp, ns, function() {
  3861.           var layer_i;
  3862.           this.globalConfig.set("firstReqStatus", "complete");
  3863.           this._unregisterRequest(to);
  3864.           var crossfilterable_layers = this.globalConfig.get("firstReqCallbacks");
  3865.           this.globalConfig.set("firstReqCallbacks", null);
  3866.           if (crossfilterable_layers) {
  3867.             /** @type {number} */
  3868.             layer_i = 0;
  3869.             for (; layer_i < crossfilterable_layers.length; layer_i++) {
  3870.               crossfilterable_layers[layer_i][0]._sendSavedRequest.apply(crossfilterable_layers[layer_i][0], crossfilterable_layers[layer_i][1]);
  3871.             }
  3872.           }
  3873.           if (t) {
  3874.             t.apply(d, arguments);
  3875.           }
  3876.         }, this);
  3877.       }
  3878.     },
  3879.     _isRetryEnabled : function() {
  3880.       return this.retry && this._storage && this._storage.isEnabled();
  3881.     },
  3882.     _registerRequest : function(o, topic) {
  3883.       var id;
  3884.       if (this._isRetryEnabled()) {
  3885.         topic.rqnl = topic.rqnl || 0;
  3886.         topic.rqnl++;
  3887.         var json = this._storage.get("retryReqs") || {};
  3888.         /** @type {number} */
  3889.         id = 1;
  3890.         for (; json[id];) {
  3891.           id++;
  3892.         }
  3893.         json[id] = {
  3894.           protocol : this.protocol,
  3895.           host : this.host,
  3896.           resource : this.resource,
  3897.           counterId : this.counterId,
  3898.           counterType : this.counterType,
  3899.           postParams : this.postParams,
  3900.           params : o,
  3901.           browserInfo : topic,
  3902.           ghid : this.globalConfig.get("_globalMetrikaHitId"),
  3903.           time : context.getMs()
  3904.         };
  3905.         this._storage.set("retryReqs", json);
  3906.         return id;
  3907.       }
  3908.     },
  3909.     _unregisterRequest : function(n) {
  3910.       if (n && this._isRetryEnabled()) {
  3911.         var newValue = this._storage.get("retryReqs") || {};
  3912.         if (newValue[n]) {
  3913.           delete newValue[n];
  3914.           this._storage.set("retryReqs", newValue);
  3915.         }
  3916.       }
  3917.     },
  3918.     _getVersion : require(function() {
  3919.       return k;
  3920.     }, "", true)
  3921.   });
  3922.   config._storage = new Array;
  3923.   /** @type {string} */
  3924.   config._fipKey = "fip";
  3925.   /** @type {!Array} */
  3926.   config.fpFactors = ["webGL", "plugins", "applePay", "dnt"];
  3927.   /**
  3928.    * @return {undefined}
  3929.    */
  3930.   config.initFingerPrint = function() {
  3931.     /** @type {!Array} */
  3932.     var value = [];
  3933.     if ($scope.isSafari() && (navigator.userAgent.match(/Mac OS X[^_.]10[_.](13|12)/) || navigator.userAgent.match(/iPhone; CPU iPhone OS (11|10|12)/))) {
  3934.       var storage = config._storage;
  3935.       if (storage.get(this._fipKey)) {
  3936.         value = storage.get(this._fipKey);
  3937.       } else {
  3938.         value = new debounceDelay(_.reduce(function(a, howMany) {
  3939.           /** @type {number} */
  3940.           a[howMany] = 1;
  3941.           return a;
  3942.         }, {}, config.fpFactors));
  3943.         value = value.toString(false).join("-");
  3944.         storage.set(this._fipKey, value);
  3945.       }
  3946.       /** @type {!Array} */
  3947.       this._fingerPrint = value;
  3948.     }
  3949.   };
  3950.   /**
  3951.    * @return {?}
  3952.    */
  3953.   config.getFP = function() {
  3954.     return this._storage.get(this._fipKey) ? this._storage.get(this._fipKey) : config._fingerPrint;
  3955.   };
  3956.   /**
  3957.    * @return {undefined}
  3958.    */
  3959.   config.initCookie = function() {
  3960.     var node = new Error;
  3961.     var success = node.read("uid");
  3962.     var c = node.read("d");
  3963.     var l = context.getSeconds();
  3964.     if (!success) {
  3965.       /** @type {string} */
  3966.       success = l + "" + _.random();
  3967.       node.create("uid", success, 525600);
  3968.       node.create("d", l, 525600);
  3969.     } else {
  3970.       if (!c || 15768E3 < l - parseInt(c)) {
  3971.         node.create("uid", success, 525600);
  3972.         node.create("d", l, 525600);
  3973.       }
  3974.     }
  3975.     config._userID = success;
  3976.   };
  3977.   /**
  3978.    * @param {!Object} app
  3979.    * @return {undefined}
  3980.    */
  3981.   config.retransmit = function(app) {
  3982.     var storage = config._storage;
  3983.     var handlers = storage.get("retryReqs") || {};
  3984.     var res;
  3985.     storage.remove("retryReqs");
  3986.     _.forEachKey(handlers, function(b, options) {
  3987.       var d = context.getMs();
  3988.       if (!app.get("firstReqStatus")) {
  3989.         app.set("firstReqStatus", "complete");
  3990.       }
  3991.       if (options.ghid && options.ghid != app.get("_globalMetrikaHitId") && options.time && options.time + 864E5 > d && 500 < d - options.time && 2 >= options.browserInfo.rqnl) {
  3992.         res = new config({
  3993.           protocol : options.protocol,
  3994.           host : options.host,
  3995.           resource : options.resource,
  3996.           counterId : options.counterId,
  3997.           counterType : options.counterType,
  3998.           postParams : options.postParams || [],
  3999.           retry : true
  4000.         });
  4001.         res.send(options.params, options.browserInfo);
  4002.       }
  4003.     });
  4004.   };
  4005.   /**
  4006.    * @param {string} a
  4007.    * @return {?}
  4008.    */
  4009.   _.fletcher = function(a) {
  4010.     var c = a.length;
  4011.     /** @type {number} */
  4012.     var j = 0;
  4013.     /** @type {number} */
  4014.     var offset = 255;
  4015.     /** @type {number} */
  4016.     var _Position_OuterEnd = 255;
  4017.     var d;
  4018.     var h;
  4019.     var k;
  4020.     for (; c;) {
  4021.       d = 21 < c ? 21 : c;
  4022.       /** @type {number} */
  4023.       c = c - d;
  4024.       do {
  4025.         h = "string" == typeof a ? a.charCodeAt(j) : a[j];
  4026.         j++;
  4027.         if (255 < h) {
  4028.           /** @type {number} */
  4029.           k = h >> 8;
  4030.           /** @type {number} */
  4031.           h = h & 255;
  4032.           /** @type {number} */
  4033.           h = h ^ k;
  4034.         }
  4035.         offset = offset + h;
  4036.         _Position_OuterEnd = _Position_OuterEnd + offset;
  4037.       } while (--d);
  4038.       /** @type {number} */
  4039.       offset = (offset & 255) + (offset >> 8);
  4040.       /** @type {number} */
  4041.       _Position_OuterEnd = (_Position_OuterEnd & 255) + (_Position_OuterEnd >> 8);
  4042.     }
  4043.     /** @type {number} */
  4044.     a = (offset & 255) + (offset >> 8) << 8 | (_Position_OuterEnd & 255) + (_Position_OuterEnd >> 8);
  4045.     return 65535 == a ? 0 : a;
  4046.   };
  4047.   /**
  4048.    * @param {!Object} context
  4049.    * @param {string} value
  4050.    * @return {?}
  4051.    */
  4052.   that.encode = function(context, value) {
  4053.     /** @type {!Array<string>} */
  4054.     var BASE64_CODE = (that.abc + (value ? that.tailSafe : that.tail)).split("");
  4055.     var i = context.length;
  4056.     /** @type {!Array} */
  4057.     var e = [];
  4058.     /** @type {number} */
  4059.     var k = i - i % 3;
  4060.     var j;
  4061.     /** @type {number} */
  4062.     j = 0;
  4063.     for (; j < k; j = j + 3) {
  4064.       var c2 = (context[j] << 16) + (context[j + 1] << 8) + context[j + 2];
  4065.       _.mergeArrays(e, [BASE64_CODE[c2 >> 18 & 63], BASE64_CODE[c2 >> 12 & 63], BASE64_CODE[c2 >> 6 & 63], BASE64_CODE[c2 & 63]]);
  4066.     }
  4067.     switch(i - k) {
  4068.       case 1:
  4069.         /** @type {number} */
  4070.         c2 = context[k] << 4;
  4071.         _.mergeArrays(e, [BASE64_CODE[c2 >> 6 & 63], BASE64_CODE[c2 & 63], BASE64_CODE[64], BASE64_CODE[64]]);
  4072.         break;
  4073.       case 2:
  4074.         /** @type {number} */
  4075.         c2 = (context[k] << 10) + (context[k + 1] << 2);
  4076.         _.mergeArrays(e, [BASE64_CODE[c2 >> 12 & 63], BASE64_CODE[c2 >> 6 & 63], BASE64_CODE[c2 & 63], BASE64_CODE[64]]);
  4077.     }
  4078.     return e.join("");
  4079.   };
  4080.   /**
  4081.    * @param {!Array} array
  4082.    * @param {!Function} fn
  4083.    * @param {?} that
  4084.    * @return {?}
  4085.    */
  4086.   _.arrayEvery = function(array, fn, that) {
  4087.     var i;
  4088.     /** @type {number} */
  4089.     i = 0;
  4090.     for (; i < array.length; i++) {
  4091.       if (!fn.call(that, array[i], i, array)) {
  4092.         return false;
  4093.       }
  4094.     }
  4095.     return true;
  4096.   };
  4097.   /**
  4098.    * @param {?} value
  4099.    * @return {?}
  4100.    */
  4101.   _.is4Bytes = function(value) {
  4102.     return !_.arrayEvery((encodeURIComponent(value).match(/(%[A-F,\d]{2})+/g) || []).join("").split("%"), function(id_local) {
  4103.       return 240 > parseInt(id_local, 16);
  4104.     });
  4105.   };
  4106.   /**
  4107.    * @param {string} str
  4108.    * @param {number} num
  4109.    * @return {?}
  4110.    */
  4111.   _.trim = function(str, num) {
  4112.     /** @type {string} */
  4113.     str = String(str).replace(/^\s+|\s+$/g, "");
  4114.     if (num && str.length > num) {
  4115.       /** @type {string} */
  4116.       str = str.substr(0, num);
  4117.     }
  4118.     return str;
  4119.   };
  4120.   /**
  4121.    * @param {?} fn
  4122.    * @return {?}
  4123.    */
  4124.   _.isFunction = function(fn) {
  4125.     return "function" === typeof fn;
  4126.   };
  4127.   /**
  4128.    * @param {string} value
  4129.    * @return {?}
  4130.    */
  4131.   _.isNumber = function(value) {
  4132.     return isFinite(value) && !isNaN(value) && "[object Number]" == Object.prototype.toString.call(value);
  4133.   };
  4134.   /**
  4135.    * @param {string} val
  4136.    * @return {?}
  4137.    */
  4138.   _.isString = function(val) {
  4139.     return "[object String]" == Object.prototype.toString.call(val);
  4140.   };
  4141.   /**
  4142.    * @param {!Array} ary
  4143.    * @param {string} val
  4144.    * @return {?}
  4145.    */
  4146.   _.arrayIndexOf = function(ary, val) {
  4147.     var i;
  4148.     /** @type {number} */
  4149.     i = 0;
  4150.     for (; i < ary.length; i++) {
  4151.       if (ary[i] === val) {
  4152.         return i;
  4153.       }
  4154.     }
  4155.     return -1;
  4156.   };
  4157.   /**
  4158.    * @return {undefined}
  4159.    */
  4160.   _.warning = function() {
  4161.     if (window.console && "function" === typeof window.console.warn) {
  4162.       console.warn.apply(console, arguments);
  4163.     }
  4164.   };
  4165.   /**
  4166.    * @param {!Object} value
  4167.    * @return {?}
  4168.    */
  4169.   _.isObject = function(value) {
  4170.     try {
  4171.       return value && null !== value && "[object Object]" == Object.prototype.toString.call(value);
  4172.     } catch (b) {
  4173.       return false;
  4174.     }
  4175.   };
  4176.   /** @type {!RegExp} */
  4177.   _._playerRegexp = /^.+\.mtproxy\.yandex\.net$/;
  4178.   /**
  4179.    * @return {?}
  4180.    */
  4181.   _.isMetrikaPlayer = function() {
  4182.     return "MetrikaPlayer" == window.name || this._playerRegexp.test(window.location.hostname);
  4183.   };
  4184.   /**
  4185.    * @return {?}
  4186.    */
  4187.   util.getDocumentCharset = function() {
  4188.     return ("" + (document.characterSet || document.charset || "")).toLowerCase();
  4189.   };
  4190.   /**
  4191.    * @return {?}
  4192.    */
  4193.   util.getBody = function() {
  4194.     /** @type {!NodeList<Element>} */
  4195.     var bodyPaths = document.getElementsByTagName("body");
  4196.     for (; 0 < bodyPaths.length;) {
  4197.       return bodyPaths[0];
  4198.     }
  4199.   };
  4200.   /**
  4201.    * @return {?}
  4202.    */
  4203.   util.getRootElement = function() {
  4204.     /** @type {!Element} */
  4205.     var d = document.documentElement;
  4206.     var f = util.getBody();
  4207.     return "CSS1Compat" == document.compatMode ? d : f || d;
  4208.   };
  4209.   /**
  4210.    * @return {?}
  4211.    */
  4212.   util.getViewportSize = function() {
  4213.     var container = util.getRootElement();
  4214.     return [container.clientWidth || window.innerWidth, container.clientHeight || window.innerHeight];
  4215.   };
  4216.   /**
  4217.    * @return {?}
  4218.    */
  4219.   util.getDocumentTitle = function() {
  4220.     /** @type {string} */
  4221.     var tmp = document.title;
  4222.     if ("string" != typeof tmp) {
  4223.       /** @type {string} */
  4224.       tmp = (tmp = document.getElementsByTagName("title")) && tmp.length ? tmp[0].innerHTML : "";
  4225.     }
  4226.     return tmp;
  4227.   };
  4228.   /** @type {string} */
  4229.   $scope._silverlightVersion = "";
  4230.   /**
  4231.    * @return {?}
  4232.    */
  4233.   $scope.getSilverlightVersion = function() {
  4234.     if (!$scope._silverlightVersion) {
  4235.       if (window.ActiveXObject) {
  4236.         try {
  4237.           var o = new ActiveXObject("AgControl.AgControl");
  4238.           /**
  4239.            * @param {!Function} a
  4240.            * @param {?} v
  4241.            * @param {number} i
  4242.            * @param {number} n
  4243.            * @return {undefined}
  4244.            */
  4245.           var a = function(a, v, i, n) {
  4246.             for (; u(a, v);) {
  4247.               v[i] += n;
  4248.             }
  4249.             v[i] -= n;
  4250.           };
  4251.           /**
  4252.            * @param {!Function} a
  4253.            * @param {!Array} b
  4254.            * @return {?}
  4255.            */
  4256.           var u = function(a, b) {
  4257.             return a.isVersionSupported(b[0] + "." + b[1] + "." + b[2] + "." + b[3]);
  4258.           };
  4259.           /** @type {!Array} */
  4260.           var label = [1, 0, 0, 0];
  4261.           a(o, label, 0, 1);
  4262.           a(o, label, 1, 1);
  4263.           a(o, label, 2, 1E4);
  4264.           a(o, label, 2, 1E3);
  4265.           a(o, label, 2, 100);
  4266.           a(o, label, 2, 10);
  4267.           a(o, label, 2, 1);
  4268.           a(o, label, 3, 1);
  4269.           /** @type {string} */
  4270.           $scope._silverlightVersion = label.join(".");
  4271.         } catch (e) {
  4272.         }
  4273.       } else {
  4274.         if (a = window.navigator, a = a.plugins && a.plugins["Silverlight Plug-In"]) {
  4275.           /** @type {string} */
  4276.           $scope._silverlightVersion = a.description;
  4277.         }
  4278.       }
  4279.     }
  4280.     return $scope._silverlightVersion || "";
  4281.   };
  4282.   /** @type {number} */
  4283.   $scope._flashVersion = 0;
  4284.   /**
  4285.    * @return {?}
  4286.    */
  4287.   $scope.getFlashVersion = function() {
  4288.     if (!$scope._flashVersion) {
  4289.       /** @type {!Navigator} */
  4290.       var n = window.navigator;
  4291.       if ("undefined" != typeof n.plugins && "object" == typeof n.plugins["Shockwave Flash"]) {
  4292.         /** @type {!Plugin} */
  4293.         var v = n.plugins["Shockwave Flash"];
  4294.         var a = v.version;
  4295.         if ((v = v.description) || a) {
  4296.           if (n = n.mimeTypes, "undefined" == typeof n || !n["application/x-shockwave-flash"] || n["application/x-shockwave-flash"].enabledPlugin) {
  4297.             if (a) {
  4298.               $scope._flashVersion = a;
  4299.             } else {
  4300.               if (v) {
  4301.                 /** @type {string} */
  4302.                 $scope._flashVersion = v.replace(/([a-zA-Z]|\s)+/, "").replace(/(\s+r|\s+b[0-9]+)/, ".");
  4303.               }
  4304.             }
  4305.           }
  4306.         }
  4307.       } else {
  4308.         if ("undefined" != typeof window.ActiveXObject) {
  4309.           try {
  4310.             if (a = new ActiveXObject("ShockwaveFlash.ShockwaveFlash"), v = a.GetVariable("$version")) {
  4311.               $scope._flashVersion = v.split(" ")[1].replace(/,/g, ".").replace(/[^.\d]/g, "");
  4312.             }
  4313.           } catch (d) {
  4314.           }
  4315.         }
  4316.       }
  4317.     }
  4318.     return $scope._flashVersion;
  4319.   };
  4320.   /**
  4321.    * @return {?}
  4322.    */
  4323.   $scope.getLanguage = function() {
  4324.     var y = (window.navigator ? navigator.language || navigator.userLanguage || navigator.browserLanguage || navigator.systemLanguage : "").toLowerCase();
  4325.     return _.isString(y) ? y : "";
  4326.   };
  4327.   /**
  4328.    * @return {?}
  4329.    */
  4330.   $scope.getJavaEnabled = function() {
  4331.     try {
  4332.       return navigator.javaEnabled();
  4333.     } catch (a) {
  4334.       return false;
  4335.     }
  4336.   };
  4337.   /**
  4338.    * @param {string} str
  4339.    * @return {?}
  4340.    */
  4341.   _.fnv32a = function(str) {
  4342.     /** @type {number} */
  4343.     var hval = 2166136261;
  4344.     var stringLen;
  4345.     /** @type {number} */
  4346.     var i = 0;
  4347.     stringLen = str.length;
  4348.     for (; i < stringLen; ++i) {
  4349.       /** @type {number} */
  4350.       hval = hval ^ str.charCodeAt(i);
  4351.       /** @type {number} */
  4352.       hval = hval + ((hval << 1) + (hval << 4) + (hval << 7) + (hval << 8) + (hval << 24));
  4353.     }
  4354.     return hval >>> 0;
  4355.   };
  4356.   /**
  4357.    * @return {?}
  4358.    */
  4359.   $scope.getFingerPrint = function() {
  4360.     /** @type {!Array} */
  4361.     var a = [];
  4362.     var i;
  4363.     if (navigator.plugins && navigator.plugins.length) {
  4364.       /** @type {number} */
  4365.       i = 0;
  4366.       for (; i < navigator.plugins.length; i++) {
  4367.         /** @type {!Plugin} */
  4368.         var item = navigator.plugins[i];
  4369.         _.mergeArrays(a, [item.name, item.version, item.description, item.filename]);
  4370.       }
  4371.     }
  4372.     if (navigator.mimeTypes && navigator.mimeTypes.length) {
  4373.       /** @type {number} */
  4374.       i = 0;
  4375.       for (; i < navigator.mimeTypes.length; i++) {
  4376.         /** @type {!MimeType} */
  4377.         item = navigator.mimeTypes[i];
  4378.         _.mergeArrays(a, [item.type, item.description, item.suffixes]);
  4379.       }
  4380.     }
  4381.     return _.fnv32a(a.join(";")) + "01";
  4382.   };
  4383.   /**
  4384.    * @return {?}
  4385.    */
  4386.   $scope.getNotificationPermission = function() {
  4387.     try {
  4388.       /** @type {string} */
  4389.       var permissionState = Notification.permission;
  4390.     } catch (b) {
  4391.     }
  4392.     switch(permissionState) {
  4393.       case "denied":
  4394.         return 1;
  4395.       case "granted":
  4396.         return 2;
  4397.     }
  4398.   };
  4399.   /**
  4400.    * @return {?}
  4401.    */
  4402.   $scope.isIframe = function() {
  4403.     try {
  4404.       return window.top != window.self;
  4405.     } catch (a) {
  4406.       return false;
  4407.     }
  4408.   };
  4409.   $scope._nMap = {
  4410.     other : "0",
  4411.     none : "1",
  4412.     unknown : "2",
  4413.     wifi : "3",
  4414.     ethernet : "4",
  4415.     bluetooth : "5",
  4416.     cellular : "6",
  4417.     wimax : "7",
  4418.     mixed : "8"
  4419.   };
  4420.   /**
  4421.    * @return {?}
  4422.    */
  4423.   $scope.netType = function() {
  4424.     /** @type {string} */
  4425.     var p = (navigator.connection || {
  4426.       type : ""
  4427.     }).type;
  4428.     return $scope._nMap[p] || p;
  4429.   };
  4430.   /**
  4431.    * @return {?}
  4432.    */
  4433.   $scope.getNavigationStart = function() {
  4434.     /** @type {!Performance} */
  4435.     var perf = window.performance || window.webkitPerformance;
  4436.     return perf && perf.timing && perf.timing.navigationStart;
  4437.   };
  4438.   /**
  4439.    * @return {?}
  4440.    */
  4441.   $scope.isSameOriginTopFrame = function() {
  4442.     try {
  4443.       return window.top.contentWindow || true;
  4444.     } catch (a) {
  4445.       return false;
  4446.     }
  4447.   };
  4448.   /**
  4449.    * @param {!Object} self
  4450.    * @return {?}
  4451.    */
  4452.   $scope.isDesktop = function(self) {
  4453.     var options = self.get("bt", {});
  4454.     if (self.get("bt") === undefined) {
  4455.       /** @type {(Promise<BatteryManager>|null)} */
  4456.       options.p = navigator.getBattery ? navigator.getBattery() : null;
  4457.       self.set("bt", options);
  4458.       if (options.p && options.p.then) {
  4459.         options.p.then(function(battery) {
  4460.           /** @type {boolean} */
  4461.           options.v = battery.charging && 0 === battery.chargingTime;
  4462.         });
  4463.       }
  4464.     }
  4465.     return options.v;
  4466.   };
  4467.   /**
  4468.    * @param {!Function} data
  4469.    * @return {undefined}
  4470.    */
  4471.   self.ready = function(data) {
  4472.     /** @type {string} */
  4473.     var readyState = document.readyState;
  4474.     if ("interactive" === readyState || "complete" === readyState) {
  4475.       _.setTimeout(data, 0, "evt::ready");
  4476.     } else {
  4477.       /**
  4478.        * @return {undefined}
  4479.        */
  4480.       var handler = function() {
  4481.         self.un(document, "DOMContentLoaded", handler);
  4482.         self.un(window, "load", handler);
  4483.         data();
  4484.       };
  4485.       self.on(document, "DOMContentLoaded", handler);
  4486.       self.on(window, "load", handler);
  4487.     }
  4488.   };
  4489.   var a = {
  4490.     url : options.protocol + "//" + options.host + "/metrika/",
  4491.     _value : null,
  4492.     init : function(s) {
  4493.       var newState = this._getLs().read("isad");
  4494.       this.globalConfig = s || api;
  4495.       if (newState) {
  4496.         this._set(newState);
  4497.       } else {
  4498.         if (!this._getReqStatus()) {
  4499.           this._send();
  4500.         }
  4501.       }
  4502.     },
  4503.     getVal : function() {
  4504.       return this._value;
  4505.     },
  4506.     _set : function(value) {
  4507.       this._value = "1" == value || "2" == value ? value : null;
  4508.     },
  4509.     _send : function() {
  4510.       var channel_collection = this;
  4511.       this._setReqStatus("process");
  4512.       self.ready(function() {
  4513.         /** @type {!Element} */
  4514.         var b = document.createElement("img");
  4515.         /**
  4516.          * @return {undefined}
  4517.          */
  4518.         b.onload = function() {
  4519.           channel_collection._saveReq(false);
  4520.           util.removeNode(this);
  4521.         };
  4522.         /**
  4523.          * @return {undefined}
  4524.          */
  4525.         b.onerror = function() {
  4526.           channel_collection._saveReq(true);
  4527.           util.removeNode(this);
  4528.         };
  4529.         /** @type {string} */
  4530.         b.src = channel_collection.url + String.fromCharCode(97, 100, 118, 101, 114, 116, 46, 103, 105, 102);
  4531.         if ($scope.isSafari()) {
  4532.           /** @type {string} */
  4533.           b.style.position = "absolute";
  4534.           /** @type {string} */
  4535.           b.style.visibility = "hidden";
  4536.           /** @type {string} */
  4537.           b.style.width = "0px";
  4538.           /** @type {string} */
  4539.           b.style.height = "0px";
  4540.           util.getRootElement().appendChild(b);
  4541.         }
  4542.       });
  4543.     },
  4544.     _saveReq : function(value) {
  4545.       /** @type {string} */
  4546.       this._value = value = value ? "1" : "2";
  4547.       this._setReqStatus("complete");
  4548.       this._getLs().create("isad", value, 1200);
  4549.     },
  4550.     _setReqStatus : function(fn) {
  4551.       try {
  4552.         this.globalConfig.set("adStatus", fn);
  4553.       } catch (b) {
  4554.       }
  4555.     },
  4556.     _getReqStatus : function() {
  4557.       try {
  4558.         return this.globalConfig.get("adStatus");
  4559.       } catch (a) {
  4560.         return "complete";
  4561.       }
  4562.     },
  4563.     _getLs : function() {
  4564.       if (!this._ls) {
  4565.         this._ls = new Error;
  4566.       }
  4567.       return this._ls;
  4568.     }
  4569.   };
  4570.   var base64 = {
  4571.     encode : function(s) {
  4572.       /** @type {!Array} */
  4573.       var buff = [];
  4574.       var l;
  4575.       /** @type {number} */
  4576.       var i = 0;
  4577.       l = s.length;
  4578.       for (; i < l; i++) {
  4579.         var c = s.charCodeAt(i);
  4580.         if (128 > c) {
  4581.           buff.push(c);
  4582.         } else {
  4583.           if (127 < c && 2048 > c) {
  4584.             buff.push(c >> 6 | 192);
  4585.           } else {
  4586.             buff.push(c >> 12 | 224);
  4587.             buff.push(c >> 6 & 63 | 128);
  4588.           }
  4589.           buff.push(c & 63 | 128);
  4590.         }
  4591.       }
  4592.       return buff;
  4593.     },
  4594.     decode : function(a) {
  4595.       /** @type {string} */
  4596.       var s = "";
  4597.       /** @type {number} */
  4598.       var i = 0;
  4599.       var c;
  4600.       var e;
  4601.       var f;
  4602.       for (; i < a.length;) {
  4603.         c = a.charCodeAt(i);
  4604.         if (128 > c) {
  4605.           /** @type {string} */
  4606.           s = s + String.fromCharCode(c);
  4607.           i++;
  4608.         } else {
  4609.           if (191 < c && 224 > c) {
  4610.             e = a.charCodeAt(i + 1);
  4611.             /** @type {string} */
  4612.             s = s + String.fromCharCode((c & 31) << 6 | e & 63);
  4613.             /** @type {number} */
  4614.             i = i + 2;
  4615.           } else {
  4616.             e = a.charCodeAt(i + 1);
  4617.             f = a.charCodeAt(i + 2);
  4618.             /** @type {string} */
  4619.             s = s + String.fromCharCode((c & 15) << 12 | (e & 63) << 6 | f & 63);
  4620.             /** @type {number} */
  4621.             i = i + 3;
  4622.           }
  4623.         }
  4624.       }
  4625.       return s;
  4626.     }
  4627.   };
  4628.   /**
  4629.    * @param {string} e
  4630.    * @param {string} isSelected
  4631.    * @return {?}
  4632.    */
  4633.   that.decode = function(e, isSelected) {
  4634.     /** @type {string} */
  4635.     var related_node_ids = that.abc + (isSelected ? that.tailSafe : that.tail);
  4636.     /** @type {number} */
  4637.     var i = 0;
  4638.     /** @type {string} */
  4639.     var output = "";
  4640.     var byte1;
  4641.     var byte2;
  4642.     var byte3;
  4643.     var WORK;
  4644.     var encoded4;
  4645.     for (; e.length % 4;) {
  4646.       /** @type {string} */
  4647.       e = e + "=";
  4648.     }
  4649.     do {
  4650.       /** @type {number} */
  4651.       byte1 = related_node_ids.indexOf(e.charAt(i++));
  4652.       /** @type {number} */
  4653.       byte2 = related_node_ids.indexOf(e.charAt(i++));
  4654.       /** @type {number} */
  4655.       WORK = related_node_ids.indexOf(e.charAt(i++));
  4656.       /** @type {number} */
  4657.       encoded4 = related_node_ids.indexOf(e.charAt(i++));
  4658.       if (0 > byte1 || 0 > byte2 || 0 > WORK || 0 > encoded4) {
  4659.         return null;
  4660.       }
  4661.       /** @type {number} */
  4662.       byte3 = byte1 << 18 | byte2 << 12 | WORK << 6 | encoded4;
  4663.       /** @type {number} */
  4664.       byte1 = byte3 >> 16 & 255;
  4665.       /** @type {number} */
  4666.       byte2 = byte3 >> 8 & 255;
  4667.       /** @type {number} */
  4668.       byte3 = byte3 & 255;
  4669.       /** @type {string} */
  4670.       output = 64 == WORK ? output + String.fromCharCode(byte1) : 64 == encoded4 ? output + String.fromCharCode(byte1, byte2) : output + String.fromCharCode(byte1, byte2, byte3);
  4671.     } while (i < e.length);
  4672.     return output;
  4673.   };
  4674.   /**
  4675.    * @param {!Function} fun
  4676.    * @param {string} val
  4677.    * @param {!Array} obj
  4678.    * @return {?}
  4679.    */
  4680.   _.reduce = function(fun, val, obj) {
  4681.     /** @type {number} */
  4682.     var i = 0;
  4683.     if (val == undefined) {
  4684.       val = obj[0];
  4685.       i++;
  4686.     }
  4687.     for (; i < obj.length;) {
  4688.       val = fun(val, obj[i]);
  4689.       i++;
  4690.     }
  4691.     return val;
  4692.   };
  4693.   /**
  4694.    * @param {!Function} func
  4695.    * @param {!Array} array
  4696.    * @return {?}
  4697.    */
  4698.   _.filter = function(func, array) {
  4699.     var i;
  4700.     /** @type {!Array} */
  4701.     var ret = [];
  4702.     /** @type {number} */
  4703.     i = 0;
  4704.     for (; i < array.length; i++) {
  4705.       if (func(array[i])) {
  4706.         ret.push(array[i]);
  4707.       }
  4708.     }
  4709.     return ret;
  4710.   };
  4711.   /**
  4712.    * @param {string} args
  4713.    * @return {?}
  4714.    */
  4715.   service.parse = function(args) {
  4716.     try {
  4717.       return JSON.parse(args);
  4718.     } catch (b) {
  4719.       return null;
  4720.     }
  4721.   };
  4722.   var Container = config.inherit({
  4723.     hitId : 0,
  4724.     trackHash : false,
  4725.     trimParams : false,
  4726.     webvisor : false,
  4727.     counter : null,
  4728.     counterNum : 0,
  4729.     resource : "watch",
  4730.     retry : true,
  4731.     paramsQueue : {
  4732.       paramsQueue : [],
  4733.       length : function() {
  4734.         return this.paramsQueue.length;
  4735.       },
  4736.       push : function(key) {
  4737.         this.paramsQueue.push(key);
  4738.       },
  4739.       _reduce : function(values) {
  4740.         return function(conf, extras) {
  4741.           _.arrayEvery(_.keys(extras), function(prop) {
  4742.             if (conf.hasOwnProperty(prop)) {
  4743.               return 1;
  4744.             }
  4745.             if (-1 == _.arrayIndexOf(values, prop)) {
  4746.               conf[prop] = extras[prop];
  4747.               delete extras[prop];
  4748.             }
  4749.             return 1;
  4750.           });
  4751.           return conf;
  4752.         };
  4753.       },
  4754.       _filter : function(filters) {
  4755.         return _.keys(filters).length;
  4756.       },
  4757.       mixin : function(obj) {
  4758.         var parameters = {};
  4759.         if (this.paramsQueue.length) {
  4760.           parameters = _.reduce(this._reduce(_.keys(obj)), {}, this.paramsQueue);
  4761.           this.paramsQueue = _.filter(this._filter, this.paramsQueue);
  4762.         }
  4763.         return _.mixin({}, obj, parameters);
  4764.       }
  4765.     },
  4766.     postParams : ["site-info"],
  4767.     countersNoTitle : "22836271 1143050 29626870 9928105 26128362 29850769".split(" "),
  4768.     fake : false,
  4769.     sendTitle : true,
  4770.     _initComponent : function() {
  4771.       Container.superclass._initComponent.apply(this, arguments);
  4772.       this._trackHash = this.trackHash;
  4773.       if ("0" === "" + this.counterType) {
  4774.         /** @type {boolean} */
  4775.         this.sendTitle = -1 === _.arrayIndexOf(this.countersNoTitle, "" + this.counterId);
  4776.       }
  4777.     },
  4778.     setTrackHash : function(prop) {
  4779.       /** @type {boolean} */
  4780.       this._trackHash = prop;
  4781.     },
  4782.     sendHit : function(options) {
  4783.       this._hitExt({
  4784.         url : options.url,
  4785.         title : options.title,
  4786.         referrer : options.referrer,
  4787.         vParams : options.vParams,
  4788.         modes : _.mixin(options.modes || {}, {
  4789.           ar : true,
  4790.           saveRef : true,
  4791.           pv : true
  4792.         }),
  4793.         callback : options.callback,
  4794.         ctx : options.ctx
  4795.       }, "hit");
  4796.     },
  4797.     sendExperiments : function(data) {
  4798.       this._hitExt({
  4799.         url : parse().href,
  4800.         title : "",
  4801.         referrer : "",
  4802.         modes : {
  4803.           ex : true,
  4804.           ar : true
  4805.         },
  4806.         experiments : data.experiments,
  4807.         callback : data.callback,
  4808.         ctx : data.ctx
  4809.       }, "exp");
  4810.     },
  4811.     sendPrerenderHit : function(data) {
  4812.       this._hitExt({
  4813.         url : data.url,
  4814.         title : data.title,
  4815.         referrer : data.referrer,
  4816.         modes : {
  4817.           ar : true,
  4818.           pq : true
  4819.         }
  4820.       }, "hit");
  4821.     },
  4822.     sendAjaxHit : function(data) {
  4823.       this._hitExt({
  4824.         url : data.url,
  4825.         title : data.title,
  4826.         referrer : data.referrer,
  4827.         modes : data.modes
  4828.       }, "hit");
  4829.     },
  4830.     sendParams : function(params, key, message) {
  4831.       this._hitExt({
  4832.         url : parse().href,
  4833.         title : "",
  4834.         referrer : "",
  4835.         forceNoRedirect : true,
  4836.         vParams : params,
  4837.         modes : {
  4838.           ar : true,
  4839.           pa : true,
  4840.           onlyData : true
  4841.         },
  4842.         callback : key,
  4843.         ctx : message
  4844.       }, "pa");
  4845.     },
  4846.     sendGoal : function(a, opts) {
  4847.       if (/[/&=?#]/.test(a)) {
  4848.         _.warning("Incorrect goal");
  4849.       } else {
  4850.         if (a) {
  4851.           var data = parse();
  4852.           this._hitExt({
  4853.             url : "goal://" + data.hostname + "/" + encodeURIComponent(a),
  4854.             title : util.getDocumentTitle(),
  4855.             referrer : data.href,
  4856.             forceNoRedirect : true,
  4857.             vParams : opts.vParams,
  4858.             modes : {
  4859.               ar : true
  4860.             },
  4861.             callback : opts.callback,
  4862.             ctx : opts.ctx
  4863.           }, "go");
  4864.         } else {
  4865.           _.warning("Empty goal");
  4866.         }
  4867.       }
  4868.     },
  4869.     sendClickLink : function(view) {
  4870.       this._hitExt({
  4871.         url : view.url,
  4872.         title : view.title,
  4873.         referrer : parse().href,
  4874.         modes : view.modes
  4875.       });
  4876.     },
  4877.     sendExtLink : function(options) {
  4878.       this._hitExt({
  4879.         url : options.url,
  4880.         title : options.title || "",
  4881.         referrer : parse().href,
  4882.         vParams : options.vParams,
  4883.         modes : {
  4884.           ar : true,
  4885.           ln : true,
  4886.           ut : up
  4887.         },
  4888.         callback : options.callback,
  4889.         ctx : options.ctx
  4890.       }, "cl");
  4891.     },
  4892.     sendFileUpload : function(options) {
  4893.       this._hitExt({
  4894.         url : options.url,
  4895.         title : options.title || "",
  4896.         referrer : parse().href,
  4897.         vParams : options.vParams,
  4898.         modes : {
  4899.           ar : true,
  4900.           ln : true,
  4901.           dl : true
  4902.         },
  4903.         callback : options.callback,
  4904.         ctx : options.ctx
  4905.       }, "fu");
  4906.     },
  4907.     sendNotBounce : function(className, context) {
  4908.       this._hitExt({
  4909.         url : parse().href,
  4910.         title : "",
  4911.         referrer : "",
  4912.         modes : {
  4913.           cl : className,
  4914.           ar : true,
  4915.           nb : true,
  4916.           onlyData : true
  4917.         },
  4918.         callback : context.callback,
  4919.         ctx : context.ctx
  4920.       }, "nb");
  4921.     },
  4922.     sendDevice : function(context) {
  4923.       this._hitExt({
  4924.         browserInfo : {
  4925.           di : context.data,
  4926.           dip : context.port
  4927.         },
  4928.         callback : context.callback,
  4929.         ctx : context.ctx
  4930.       }, "de");
  4931.     },
  4932.     _hitExt : function(data, key) {
  4933.       /**
  4934.        * @param {string} name
  4935.        * @param {!Object} a
  4936.        * @return {undefined}
  4937.        */
  4938.       function callback(name, a) {
  4939.         if (a) {
  4940.           /** @type {!Object} */
  4941.           body[name] = a;
  4942.         }
  4943.       }
  4944.       var header;
  4945.       var value;
  4946.       var g;
  4947.       var info = {};
  4948.       if (!_.isMetrikaPlayer()) {
  4949.         var item = data.modes || {};
  4950.         var res = data.browserInfo || {};
  4951.         var url = "undefined" !== typeof data.referrer ? data.referrer : message.lastReferrer;
  4952.         var v = data.url || "";
  4953.         var body = {};
  4954.         if (data.nohit) {
  4955.           callback("nohit", 1);
  4956.         }
  4957.         if (item.ar && !item.onlyData) {
  4958.           url = null === url || "" === url ? "" : this._prepareHitUrl(url);
  4959.           v = this._prepareHitUrl(data.url);
  4960.         }
  4961.         callback("forceNoRedirect", data.forceNoRedirect);
  4962.         callback("page-ref", _.trim(url, batch));
  4963.         callback("page-url", _.trim(v, batch));
  4964.         if (_.is4Bytes(data.title)) {
  4965.           callback("charset", "utf-8");
  4966.         }
  4967.         if (-1 != parse().hostname.search(/(?:^|\.)(?:ya|yandex)\.(?:\w+|com?\.\w+)$/)) {
  4968.           callback("ut", up);
  4969.         } else {
  4970.           if ("undefined" != typeof item.ut) {
  4971.             callback("ut", _.trim(item.ut, opts));
  4972.           }
  4973.         }
  4974.         callback("exp", data.experiments);
  4975.         if ((value = data.vParams) && value.__ym) {
  4976.           if (_.isNumber(value.__ym.turbo_page)) {
  4977.             info.tp = value.__ym.turbo_page;
  4978.           }
  4979.           if (_.isNumber(value.__ym.turbo_page_id)) {
  4980.             info.tpid = value.__ym.turbo_page_id;
  4981.           }
  4982.         }
  4983.         if ((!value || _.isObject(value) && !value.__ym && !value.__ymu) && this.paramsQueue.length() && _.inArray(["go", "hit", "pa"], key)) {
  4984.           value = this.paramsQueue.mixin(value);
  4985.         }
  4986.         if (value) {
  4987.           v = _.toJSON(value);
  4988.           if (this.trimParams && v.length > polymorphLimit) {
  4989.             /** @type {boolean} */
  4990.             g = true;
  4991.           } else {
  4992.             callback("site-info", v);
  4993.           }
  4994.         }
  4995.         if (item.saveRef) {
  4996.           message.lastReferrer = url;
  4997.         }
  4998.         info = function(date, handlers) {
  4999.           var options = {};
  5000.           _.forEachKey(handlers, function(operator, value) {
  5001.             if (-1 === _.arrayIndexOf(["", undefined, null], value)) {
  5002.               /** @type {string} */
  5003.               options[operator] = value;
  5004.             }
  5005.           });
  5006.           return _.mixin({}, date, options);
  5007.         }(info, {
  5008.           gdpr : img.getState(this.globalConfig),
  5009.           eu : this.globalConfig.get("isEU"),
  5010.           v : this._getVersion()
  5011.         });
  5012.         if (!this.fake) {
  5013.           header = this._getTechInfo(data.title, item, this.counterId, data.ts, data.tz, this._trackHash, this.hitId, this.webvisor, this.counter, data.nohit);
  5014.         }
  5015.         _.mixin(res, header, info);
  5016.         this.send(body, res, function() {
  5017.           if (g) {
  5018.             this.counter.params(value);
  5019.           }
  5020.           if (data.userParams) {
  5021.             this.counter.userParams(data.userParams);
  5022.           }
  5023.           if (_.isFunction(data.callback)) {
  5024.             data.callback.apply(data.ctx, arguments);
  5025.           }
  5026.         }, this);
  5027.       }
  5028.     },
  5029.     _prepareHitUrl : function(text) {
  5030.       var url = parse();
  5031.       var params = url.host;
  5032.       url = url.href;
  5033.       if (!_.isString(text)) {
  5034.         return url;
  5035.       }
  5036.       if (-1 != text.search(/^[a-z][\w.+-]+:\/\//i)) {
  5037.         return text;
  5038.       }
  5039.       var start = text.charAt(0);
  5040.       if ("?" == start) {
  5041.         return start = url.search(/\?/), -1 == start ? url + text : url.substr(0, start) + text;
  5042.       }
  5043.       if ("#" == start) {
  5044.         return start = url.search(/#/), -1 == start ? url + text : url.substr(0, start) + text;
  5045.       }
  5046.       if ("/" == start) {
  5047.         if (start = url.search(params), -1 != start) {
  5048.           return url.substr(0, start + params.length) + text;
  5049.         }
  5050.       } else {
  5051.         return params = url.split("/"), params[params.length - 1] = text, params.join("/");
  5052.       }
  5053.       return text;
  5054.     },
  5055.     _getTechInfo : function(type, data, c, i, row, name, s, index, target, propertiesToClear) {
  5056.       /**
  5057.        * @param {string} name
  5058.        * @param {!Object} value
  5059.        * @param {boolean} range
  5060.        * @return {undefined}
  5061.        */
  5062.       function $(name, value, range) {
  5063.         /** @type {string} */
  5064.         var id = "" + value;
  5065.         if (name && value && (range || -1 === id.indexOf(":"))) {
  5066.           /** @type {string} */
  5067.           clsNameMap[name] = id;
  5068.         }
  5069.       }
  5070.       /**
  5071.        * @param {string} status
  5072.        * @return {undefined}
  5073.        */
  5074.       function equal(status) {
  5075.         if (data[status]) {
  5076.           $(status, "1");
  5077.         }
  5078.       }
  5079.       var clsNameMap = {};
  5080.       data = data || {};
  5081.       i = i || context.getTimestamp();
  5082.       row = row || context.getTimezone();
  5083.       $("j", $scope.getJavaEnabled() ? "1" : "");
  5084.       var resolution = $scope.isDesktop(this.globalConfig);
  5085.       if (resolution !== undefined) {
  5086.         $("dp", resolution ? "1" : "0");
  5087.       }
  5088.       $("nt", $scope.netType());
  5089.       $("ns", $scope.getNavigationStart());
  5090.       if (screen) {
  5091.         $("s", screen.width + "x" + screen.height + "x" + (screen.colorDepth || screen.pixelDepth));
  5092.       }
  5093.       if (window.devicePixelRatio) {
  5094.         $("sk", window.devicePixelRatio);
  5095.       }
  5096.       if ($scope.isIframe()) {
  5097.         $("ifr", "1");
  5098.         $("sti", $scope.isSameOriginTopFrame() ? "1" : "0");
  5099.       }
  5100.       if (window.ia_document && window.ia_document.shareURL && window.ia_document.referrer) {
  5101.         $("iia", "1");
  5102.       }
  5103.       $("adb", a.getVal());
  5104.       $("f", $scope.getFlashVersion());
  5105.       $("l", $scope.getSilverlightVersion());
  5106.       $("fpr", $scope.getFingerPrint());
  5107.       $("cn", this.counterNum);
  5108.       if (!data.pa) {
  5109.         resolution = util.getViewportSize();
  5110.         $("w", resolution[0] + "x" + resolution[1]);
  5111.       }
  5112.       $("z", row);
  5113.       $("i", i);
  5114.       $("et", context.getSeconds());
  5115.       $("en", util.getDocumentCharset());
  5116.       $("c", navigator.cookieEnabled ? "1" : "");
  5117.       $("la", $scope.getLanguage());
  5118.       $("ntf", $scope.getNotificationPermission());
  5119.       if (!_.random(100)) {
  5120.         $("np", that.encode(base64.encode(_.trim($scope.getPlatform(), 100))));
  5121.       }
  5122.       if (name) {
  5123.         $("wh", "1");
  5124.       }
  5125.       /** @type {!Array<string>} */
  5126.       row = "ar ln dl cpf ad nb pa pq pv ex".split(" ");
  5127.       /** @type {number} */
  5128.       i = 0;
  5129.       for (; i < row.length; i++) {
  5130.         equal(row[i]);
  5131.       }
  5132.       /** @type {!Array<string>} */
  5133.       row = "va vt sn sa he fu".split(" ");
  5134.       if (data.nb) {
  5135.         row.push("cl");
  5136.       }
  5137.       /** @type {number} */
  5138.       i = 0;
  5139.       for (; i < row.length; i++) {
  5140.         /** @type {string} */
  5141.         name = row[i];
  5142.         $(name, data[name]);
  5143.       }
  5144.       row = new Array({
  5145.         counterId : c
  5146.       });
  5147.       if (row.isEnabled()) {
  5148.         c = row.getStorageId();
  5149.         i = row.get("reqNum");
  5150.         if (!propertiesToClear) {
  5151.           if (i) {
  5152.             i++;
  5153.           } else {
  5154.             /** @type {number} */
  5155.             i = 1;
  5156.           }
  5157.         }
  5158.         row.set("reqNum", i);
  5159.         if (row.get("reqNum") == i) {
  5160.           $("ls", c);
  5161.           $("rqn", i);
  5162.         } else {
  5163.           row.remove("reqNum");
  5164.           row.clearStorageId();
  5165.           if (1 < i) {
  5166.             $("ls", c);
  5167.             $("rqn", 0);
  5168.           }
  5169.         }
  5170.       }
  5171.       $("rn", _.random());
  5172.       $("hid", s);
  5173.       $("ds", assign(target));
  5174.       if (!target._firstPaint) {
  5175.         target._firstPaint = draw();
  5176.         $("fp", target._firstPaint);
  5177.       }
  5178.       if (index) {
  5179.         if (!window.name) {
  5180.           /** @type {number} */
  5181.           window.name = Math.round(65535 * Math.random());
  5182.         }
  5183.         if (s = +window.name) {
  5184.           if (0 > s) {
  5185.             /** @type {number} */
  5186.             s = s * -1;
  5187.           }
  5188.           /** @type {number} */
  5189.           s = s % 65535;
  5190.         }
  5191.         $("wn", s || _.fletcher(window.name));
  5192.         try {
  5193.           if (window.history) {
  5194.             $("hl", String(window.history.length));
  5195.           }
  5196.         } catch (Ma) {
  5197.         }
  5198.       }
  5199.       /** @type {string} */
  5200.       s = "";
  5201.       if (this.sendTitle) {
  5202.         s = this._getTitle(type);
  5203.       }
  5204.       $("t", s, true);
  5205.       return clsNameMap;
  5206.     },
  5207.     _getTitle : function(data) {
  5208.       data = "undefined" == typeof data ? (data = util.getDocumentTitle()) ? _.trim(data, depth) : "" : _.trim(data, depth);
  5209.       return data;
  5210.     }
  5211.   });
  5212.   /**
  5213.    * @param {!Array} s
  5214.    * @return {?}
  5215.    */
  5216.   _.array2Props = function(s) {
  5217.     var n = s.length;
  5218.     var HHgText = {};
  5219.     var t = HHgText;
  5220.     var i;
  5221.     /** @type {number} */
  5222.     i = 0;
  5223.     for (; i < n - 1; i++) {
  5224.       var k = s[i];
  5225.       t[k] = {};
  5226.       if (i < n - 2) {
  5227.         t = t[k];
  5228.       }
  5229.     }
  5230.     t[k] = s[n - 1];
  5231.     return HHgText;
  5232.   };
  5233.   var Event = Class.inherit({
  5234.     sampling : 1,
  5235.     counterId : 26302566,
  5236.     _initComponent : function() {
  5237.       Event.superclass._initComponent.apply(this, arguments);
  5238.       this._sender = new Container({
  5239.         protocol : "https:",
  5240.         counterId : this.counterId,
  5241.         retry : false,
  5242.         counter : {}
  5243.       });
  5244.     },
  5245.     log : function() {
  5246.       this.logParams(_.array2Props(arguments));
  5247.     },
  5248.     logParams : function(partKeys) {
  5249.       if (Math.random() < this.sampling) {
  5250.         this._sender.sendHit({
  5251.           url : result.href,
  5252.           title : "",
  5253.           referrer : "",
  5254.           vParams : partKeys
  5255.         });
  5256.       }
  5257.     }
  5258.   });
  5259.   var FirewallRule = config.inherit({
  5260.     resource : "webvisor",
  5261.     retry : true,
  5262.     postParams : ["wv-data"],
  5263.     sendPacket : function(name, callback, options, instance, data, type, id, cb) {
  5264.       if (!name || !name.length) {
  5265.         return false;
  5266.       }
  5267.       var mergeName = that.encode(name, true);
  5268.       if (0 == mergeName.indexOf("AAAAAAAAADw") && window.Error) {
  5269.         /** @type {!Error} */
  5270.         var error = Error();
  5271.         if ("string" == typeof error.stack) {
  5272.           (new Event({
  5273.             sampling : .1
  5274.           })).log("bad visor packet 5", 1);
  5275.         }
  5276.       }
  5277.       name = {
  5278.         rn : _.random(),
  5279.         "page-url" : callback,
  5280.         wmode : 0,
  5281.         "wv-type" : 0,
  5282.         "wv-hit" : options,
  5283.         "wv-part" : instance + 1,
  5284.         "wv-check" : _.fletcher(name),
  5285.         "wv-data" : mergeName
  5286.       };
  5287.       data = {
  5288.         v : this._getVersion(),
  5289.         z : data,
  5290.         i : type
  5291.       };
  5292.       return this.send(name, data, id, cb);
  5293.     }
  5294.   });
  5295.   var Model = A.inherit({
  5296.     protocol : "",
  5297.     counterId : "",
  5298.     counterType : "",
  5299.     meta : null,
  5300.     maxBufferSize : 7500,
  5301.     flushTimeout : 3E4,
  5302.     storageKey : "visorbuff",
  5303.     active : false,
  5304.     _initComponent : function() {
  5305.       this.storage = new Array({
  5306.         counterId : this.counterId
  5307.       });
  5308.       this._sender = new FirewallRule({
  5309.         globalConfig : this.globalConfig,
  5310.         protocol : this.protocol,
  5311.         counterId : this.counterId,
  5312.         counterType : this.counterType
  5313.       });
  5314.       Model.superclass._initComponent.apply(this, arguments);
  5315.     },
  5316.     onFlush : function(type, data, callback) {
  5317.       this._sender.sendPacket(type, data.url, data.hitId, callback, data.timezone, data.timestamp);
  5318.     }
  5319.   });
  5320.   var ConsoleController = config.inherit({
  5321.     resource : "webvisor",
  5322.     transports : [inputs, ret],
  5323.     postParams : ["wv-data"],
  5324.     sendContent : function(res, callback, content, req, e, context, body) {
  5325.       if (!res) {
  5326.         return false;
  5327.       }
  5328.       if (-1 < res.indexOf("\r")) {
  5329.         res = res.replace(/\r\n/g, "\n");
  5330.       }
  5331.       res = {
  5332.         "wv-type" : 1,
  5333.         "page-url" : parse().href,
  5334.         "wv-hit" : content,
  5335.         "wv-data" : that.encode(base64.encode(res))
  5336.       };
  5337.       return 245E3 < res["wv-data"].length ? false : this.send(res, {
  5338.         z : req,
  5339.         i : e,
  5340.         pct : callback || ""
  5341.       }, context, body);
  5342.     }
  5343.   });
  5344.   /**
  5345.    * @return {?}
  5346.    */
  5347.   util.getDocumentHTML = function() {
  5348.     /** @type {string} */
  5349.     var a = "";
  5350.     /** @type {!Element} */
  5351.     var e = document.documentElement;
  5352.     /** @type {string} */
  5353.     var elem = e.outerHTML;
  5354.     var j;
  5355.     var data;
  5356.     if (elem) {
  5357.       /** @type {string} */
  5358.       e = elem;
  5359.     } else {
  5360.       /** @type {!NamedNodeMap<Attr>} */
  5361.       elem = e.attributes;
  5362.       /** @type {string} */
  5363.       var token = "";
  5364.       /** @type {number} */
  5365.       j = 0;
  5366.       for (; j < elem.length; j++) {
  5367.         if (data = elem[j]) {
  5368.           /** @type {string} */
  5369.           token = token + (" " + data.name + '="' + (data.value || "") + '"');
  5370.         }
  5371.       }
  5372.       /** @type {string} */
  5373.       e = "<html" + token + ">" + e.innerHTML + "</html>";
  5374.     }
  5375.     if (elem = document.doctype) {
  5376.       /** @type {string} */
  5377.       a = elem.publicId ? ' PUBLIC "' + elem.publicId + '"' : "";
  5378.       /** @type {string} */
  5379.       token = elem.systemId ? ' "' + elem.systemId + '"' : "";
  5380.       /** @type {string} */
  5381.       a = "<!DOCTYPE " + elem.name + a + token + ">\n";
  5382.     }
  5383.     return a + e;
  5384.   };
  5385.   /**
  5386.    * @return {?}
  5387.    */
  5388.   util.getDocumentScroll = function() {
  5389.     var body = util.getBody();
  5390.     return [window.pageXOffset || document.documentElement && document.documentElement.scrollLeft || body && body.scrollLeft || 0, window.pageYOffset || document.documentElement && document.documentElement.scrollTop || body && body.scrollTop || 0];
  5391.   };
  5392.   /**
  5393.    * @param {!HTMLElement} el
  5394.    * @return {?}
  5395.    */
  5396.   util.getElementParent = function(el) {
  5397.     if (!el || el == document.documentElement) {
  5398.       return null;
  5399.     }
  5400.     if (el == util.getBody()) {
  5401.       return document.documentElement;
  5402.     }
  5403.     /** @type {null} */
  5404.     var elExt = null;
  5405.     try {
  5406.       elExt = el.parentNode;
  5407.     } catch (c) {
  5408.     }
  5409.     return elExt;
  5410.   };
  5411.   /**
  5412.    * @param {!Node} element
  5413.    * @param {boolean} name
  5414.    * @return {?}
  5415.    */
  5416.   util.getElementChildren = function(element, name) {
  5417.     /** @type {!Array} */
  5418.     var defaultOptions = [];
  5419.     var childNodes;
  5420.     var e;
  5421.     var length;
  5422.     if (element && (childNodes = element.childNodes)) {
  5423.       /** @type {number} */
  5424.       var i = 0;
  5425.       length = childNodes.length;
  5426.       for (; i < length; i++) {
  5427.         var node = childNodes[i];
  5428.         if (!((e = "INPUT" == node.nodeName && node.type && "hidden" == node.type.toLocaleLowerCase()) || name && node.nodeName != name)) {
  5429.           _.mergeArrays(defaultOptions, [node]);
  5430.         }
  5431.       }
  5432.     }
  5433.     return defaultOptions;
  5434.   };
  5435.   /**
  5436.    * @param {!Object} target
  5437.    * @return {?}
  5438.    */
  5439.   util.getElementNeighborPosition = function(target) {
  5440.     var items = util.getElementParent(target);
  5441.     var i;
  5442.     if (items) {
  5443.       /** @type {number} */
  5444.       var d = 0;
  5445.       items = items.childNodes;
  5446.       var stripTerrain = target && target.nodeName;
  5447.       /** @type {number} */
  5448.       i = 0;
  5449.       for (; i < items.length; i++) {
  5450.         var river = items[i] && items[i].nodeName;
  5451.         if (stripTerrain == river) {
  5452.           if (target == items[i]) {
  5453.             return d;
  5454.           }
  5455.           d++;
  5456.         }
  5457.       }
  5458.     }
  5459.     return 0;
  5460.   };
  5461.   /**
  5462.    * @param {!Object} el
  5463.    * @return {?}
  5464.    */
  5465.   util.getElementXY = function(el) {
  5466.     var ctop;
  5467.     if (!el || !el.ownerDocument || "PARAM" == el.tagName || el == util.getBody() || el == document.documentElement) {
  5468.       return [0, 0];
  5469.     }
  5470.     if (el.getBoundingClientRect) {
  5471.       el = el.getBoundingClientRect();
  5472.       var offset = util.getDocumentScroll();
  5473.       return [Math.round(el.left + offset[0]), Math.round(el.top + offset[1])];
  5474.     }
  5475.     /** @type {number} */
  5476.     ctop = offset = 0;
  5477.     for (; el;) {
  5478.       offset = offset + el.offsetLeft;
  5479.       ctop = ctop + el.offsetTop;
  5480.       el = el.offsetParent;
  5481.     }
  5482.     return [offset, ctop];
  5483.   };
  5484.   /**
  5485.    * @return {?}
  5486.    */
  5487.   util.getDocumentSize = function() {
  5488.     var relElement = util.getRootElement();
  5489.     var cloneLengths = util.getViewportSize();
  5490.     return [Math.max(relElement.scrollWidth, cloneLengths[0]), Math.max(relElement.scrollHeight, cloneLengths[1])];
  5491.   };
  5492.   /**
  5493.    * @param {!HTMLElement} element
  5494.    * @return {?}
  5495.    */
  5496.   util.getElementSize = function(element) {
  5497.     var cssChanges;
  5498.     return element == util.getBody() || element == document.documentElement ? util.getDocumentSize() : (cssChanges = element.getBoundingClientRect && element.getBoundingClientRect()) ? [cssChanges.width, cssChanges.height] : [element.offsetWidth, element.offsetHeight];
  5499.   };
  5500.   /**
  5501.    * @param {string} container
  5502.    * @return {?}
  5503.    */
  5504.   util.getElementRegion = function(container) {
  5505.     var allBlock = util.getElementXY(container);
  5506.     container = util.getElementSize(container);
  5507.     return [allBlock[0], allBlock[1], container[0], container[1]];
  5508.   };
  5509.   /**
  5510.    * @param {!Object} a
  5511.    * @return {?}
  5512.    */
  5513.   util.calcChildrenChecksum = function(a) {
  5514.     var docstr = require(function() {
  5515.       return a.innerHTML;
  5516.     }, "", true)() || "";
  5517.     return _.fletcher(docstr.replace(/(<[^>]*>|[\u0000-\u0020])/g, ""));
  5518.   };
  5519.   /**
  5520.    * @param {!Element} b
  5521.    * @return {?}
  5522.    */
  5523.   util.getFormNumber = function(b) {
  5524.     /** @type {!NodeList<Element>} */
  5525.     var results = document.getElementsByTagName("form");
  5526.     var distance;
  5527.     /** @type {number} */
  5528.     var length = 0;
  5529.     /** @type {number} */
  5530.     distance = results.length;
  5531.     for (; length < distance; length++) {
  5532.       if (results[length] == b) {
  5533.         return length;
  5534.       }
  5535.     }
  5536.     return -1;
  5537.   };
  5538.   /**
  5539.    * @param {!Element} a
  5540.    * @return {?}
  5541.    */
  5542.   util.isEmptyField = function(a) {
  5543.     return "INPUT" == a.nodeName && "submit" != a.type && "image" != a.type && "hidden" != a.type ? "radio" == a.type || "checkbox" == a.type ? !a.checked : !a.value : "TEXTAREA" == a.nodeName ? !a.value : "SELECT" == a.nodeName ? 0 > a.selectedIndex : true;
  5544.   };
  5545.   /**
  5546.    * @param {!Object} items
  5547.    * @return {?}
  5548.    */
  5549.   util.calcTextChecksum = function(items) {
  5550.     /** @type {string} */
  5551.     var str2 = "";
  5552.     items = items.childNodes;
  5553.     var l;
  5554.     /** @type {number} */
  5555.     var i = 0;
  5556.     l = items.length;
  5557.     for (; i < l; i++) {
  5558.       if (items[i] && 3 == items[i].nodeType) {
  5559.         /** @type {string} */
  5560.         str2 = str2 + items[i].nodeValue;
  5561.       }
  5562.     }
  5563.     return _.fletcher(str2.replace(/[\u0000-\u0020]+/g, ""));
  5564.   };
  5565.   /**
  5566.    * @param {!Object} el
  5567.    * @return {?}
  5568.    */
  5569.   util.calcAttribChecksum = function(el) {
  5570.     /** @type {string} */
  5571.     var latestLineText = "";
  5572.     /** @type {!Array<string>} */
  5573.     var cells = "width height align title alt name".split(" ");
  5574.     var i;
  5575.     if ("IMG" == el.tagName) {
  5576.       latestLineText = latestLineText + el.src.toLowerCase();
  5577.     }
  5578.     if ("A" == el.tagName) {
  5579.       latestLineText = latestLineText + el.href.toLowerCase();
  5580.     }
  5581.     /** @type {string} */
  5582.     latestLineText = latestLineText + String(el.className || "").toLowerCase();
  5583.     /** @type {number} */
  5584.     i = 0;
  5585.     for (; i < cells.length; i++) {
  5586.       if (el.getAttribute) {
  5587.         /** @type {string} */
  5588.         latestLineText = latestLineText + String(el.getAttribute(cells[i]) || "").toLowerCase();
  5589.       }
  5590.     }
  5591.     return _.fletcher(latestLineText.replace(/[\u0000-\u0020]+/g, ""));
  5592.   };
  5593.   /**
  5594.    * @param {!Object} a
  5595.    * @param {string} fn
  5596.    * @return {?}
  5597.    */
  5598.   util.classNameExists = function(a, fn) {
  5599.     try {
  5600.       return (new RegExp("(?:^|\\s)" + fn + "(?:\\s|$)")).test(a.className);
  5601.     } catch (c) {
  5602.       return false;
  5603.     }
  5604.   };
  5605.   /**
  5606.    * @param {string} name
  5607.    * @param {string} context
  5608.    * @return {?}
  5609.    */
  5610.   util.getElementsByClassName = function(name, context) {
  5611.     var i;
  5612.     context = context || document;
  5613.     var files = context.getElementsByTagName("*");
  5614.     /** @type {!Array} */
  5615.     var result = [];
  5616.     /** @type {number} */
  5617.     i = 0;
  5618.     for (; i < files.length; i++) {
  5619.       if (util.classNameExists(files[i], name)) {
  5620.         result.push(files[i]);
  5621.       }
  5622.     }
  5623.     return result;
  5624.   };
  5625.   /**
  5626.    * @param {!Array} array
  5627.    * @param {!Function} fn
  5628.    * @param {?} that
  5629.    * @return {?}
  5630.    */
  5631.   _.arrayFilter = function(array, fn, that) {
  5632.     /** @type {!Array} */
  5633.     var ret = [];
  5634.     var i;
  5635.     /** @type {number} */
  5636.     i = 0;
  5637.     for (; i < array.length; i++) {
  5638.       if (fn.call(that, array[i], i, array)) {
  5639.         ret.push(array[i]);
  5640.       }
  5641.     }
  5642.     return ret;
  5643.   };
  5644.   /**
  5645.    * @param {!Array} b
  5646.    * @param {!Array} a
  5647.    * @return {?}
  5648.    */
  5649.   _.arrDiff = function(b, a) {
  5650.     return _.arrayFilter(b, function(type) {
  5651.       return -1 === _.arrayIndexOf(a, type);
  5652.     });
  5653.   };
  5654.   /**
  5655.    * @param {string} x
  5656.    * @param {number} value
  5657.    * @return {?}
  5658.    */
  5659.   _.encodeURIComponent = function(x, value) {
  5660.     /** @type {string} */
  5661.     x = String(x);
  5662.     if (value && x.length > value) {
  5663.       /** @type {string} */
  5664.       x = x.substr(0, value);
  5665.     }
  5666.     return (window.encodeURIComponent || window.escape)(x).replace(/\+/g, "%2B");
  5667.   };
  5668.   /**
  5669.    * @param {!Function} callback
  5670.    * @param {!Object} context
  5671.    * @return {?}
  5672.    */
  5673.   _.bind = function(callback, context) {
  5674.     /** @type {!Array<?>} */
  5675.     var headArgs = [].slice.call(arguments, 2);
  5676.     return function() {
  5677.       return callback.apply(context || this, headArgs.concat([].slice.call(arguments, 0)));
  5678.     };
  5679.   };
  5680.   /**
  5681.    * @param {?} id
  5682.    * @return {?}
  5683.    */
  5684.   _.clearTimeout = function(id) {
  5685.     return _.getNativeFunction("clearTimeout")(id);
  5686.   };
  5687.   /** @type {null} */
  5688.   _._urlParser = null;
  5689.   /**
  5690.    * @param {string} url
  5691.    * @return {?}
  5692.    */
  5693.   _.parseUrl = function(url) {
  5694.     if (!this._urlParser) {
  5695.       try {
  5696.         /** @type {!Element} */
  5697.         this._urlParser = document.createElement("a");
  5698.       } catch (b) {
  5699.       }
  5700.     }
  5701.     return this._urlParser ? (this._urlParser.href = url, {
  5702.       protocol : this._urlParser.protocol,
  5703.       host : this._urlParser.host,
  5704.       port : this._urlParser.port,
  5705.       hostname : this._urlParser.hostname,
  5706.       hash : this._urlParser.hash,
  5707.       search : this._urlParser.search,
  5708.       query : this._urlParser.search.replace(/^\?/, ""),
  5709.       pathname : this._urlParser.pathname || "/",
  5710.       path : (this._urlParser.pathname || "/") + this._urlParser.search,
  5711.       href : this._urlParser.href
  5712.     }) : {};
  5713.   };
  5714.   /**
  5715.    * @param {string} str
  5716.    * @return {?}
  5717.    */
  5718.   _.safeDecodeURIComponent = function(str) {
  5719.     try {
  5720.       return decodeURIComponent(str);
  5721.     } catch (b) {
  5722.       return "";
  5723.     }
  5724.   };
  5725.   /**
  5726.    * @return {?}
  5727.    */
  5728.   _.isDev = function() {
  5729.     return false;
  5730.   };
  5731.   var Cb = !split(/webkit/) && split(/gecko/);
  5732.   var Schema = Class.inherit({
  5733.     hid : 0,
  5734.     tz : 0,
  5735.     ts : 0,
  5736.     counterId : 0,
  5737.     counterType : 0,
  5738.     url : "",
  5739.     protocol : "",
  5740.     enabled : false,
  5741.     _initComponent : function() {
  5742.       if (this.isEnabled()) {
  5743.         var location = this._getStorage();
  5744.         var v = location.read("visorc");
  5745.         if ("b" !== v && "w" !== v) {
  5746.           /** @type {string} */
  5747.           v = "";
  5748.         }
  5749.         if (!location.isEnabled() || split("opera mini")) {
  5750.           /** @type {string} */
  5751.           v = "b";
  5752.         }
  5753.         this._vc = v;
  5754.         if ("b" !== v) {
  5755.           this._recorder = new init(this.protocol, this.counterId, this.counterType, this.hid, this.globalConfig);
  5756.         }
  5757.         Schema.superclass._initComponent.apply(this, arguments);
  5758.       }
  5759.     },
  5760.     start : function(value) {
  5761.       if (this.isEnabled() && this._recorder) {
  5762.         value = value || {};
  5763.         /** @type {number} */
  5764.         var b = +value.recp;
  5765.         if (!isFinite(b) || 0 > b || 1 < b) {
  5766.           /** @type {string} */
  5767.           var width = "w";
  5768.         }
  5769.         if (!width) {
  5770.           /** @type {string} */
  5771.           width = this.hid % 1E4 / 1E4 < b ? "w" : "b";
  5772.         }
  5773.         this._getStorage().create("visorc", width, 30);
  5774.         if ("w" === width) {
  5775.           this._recorder.start();
  5776.           b = value.arch_type;
  5777.           if ((value = value.urls) && b && "none" !== b) {
  5778.             this._recorder.uploadPages(value, b);
  5779.           }
  5780.         } else {
  5781.           this._recorder.stop();
  5782.         }
  5783.       }
  5784.     },
  5785.     stop : function() {
  5786.       if (this._recorder) {
  5787.         this._recorder.stop();
  5788.       }
  5789.     },
  5790.     isEnabled : function() {
  5791.       /** @type {boolean} */
  5792.       var probe = !this.globalConfig.get("oo");
  5793.       return this.enabled && probe;
  5794.     },
  5795.     getVc : function() {
  5796.       return this._vc;
  5797.     },
  5798.     _getStorage : function() {
  5799.       if (!this._storage) {
  5800.         this._storage = new Error({
  5801.           counterId : this.counterId
  5802.         });
  5803.       }
  5804.       return this._storage;
  5805.     }
  5806.   });
  5807.   /**
  5808.    * @param {?} data
  5809.    * @param {!Object} win
  5810.    * @return {?}
  5811.    */
  5812.   util.loadScript = function(data, win) {
  5813.     win = win || window;
  5814.     var options = _.mixin({
  5815.       type : "text/javascript",
  5816.       charset : "utf-8",
  5817.       async : true
  5818.     }, data);
  5819.     var document = win.document;
  5820.     var el = _.getNativeFunction("createElement", document);
  5821.     var s = el("script");
  5822.     if (s) {
  5823.       s.type = options.type;
  5824.       s.charset = options.charset;
  5825.       s.src = options.src;
  5826.       if (options.async) {
  5827.         /** @type {boolean} */
  5828.         s.async = true;
  5829.       }
  5830.       try {
  5831.         var container = document.getElementsByTagName("head")[0];
  5832.         if (!container) {
  5833.           var accordion4 = document.getElementsByTagName("html")[0];
  5834.           container = el("head");
  5835.           if (accordion4) {
  5836.             accordion4.appendChild(container);
  5837.           }
  5838.         }
  5839.         container.insertBefore(s, container.firstChild);
  5840.         return s;
  5841.       } catch (G) {
  5842.       }
  5843.     }
  5844.   };
  5845.   httpModule = $.inherit({
  5846.     id : "script",
  5847.     index : 6,
  5848.     request : function(url, obj, message, stream) {
  5849.       /** @type {boolean} */
  5850.       var inNext = false;
  5851.       var node = _.getNativeFunction("createElement", document)("script");
  5852.       if (this.timeout) {
  5853.         _.setTimeout(function() {
  5854.           if (!inNext) {
  5855.             /** @type {boolean} */
  5856.             inNext = true;
  5857.             util.removeNode(node);
  5858.             message.call(stream, false);
  5859.           }
  5860.         }, this.timeout, "ts.request");
  5861.       }
  5862.       if (!node) {
  5863.         return inNext = true, message.call(stream, false), false;
  5864.       }
  5865.       /** @type {string} */
  5866.       var key = "_ymjsp" + _.random();
  5867.       window[key] = require(function() {
  5868.         if (!inNext) {
  5869.           try {
  5870.             delete window[key];
  5871.           } catch (G) {
  5872.             window[key] = undefined;
  5873.           }
  5874.           message.apply(stream, _.mergeArrays([true], arguments));
  5875.           /** @type {boolean} */
  5876.           inNext = true;
  5877.           util.removeNode(node);
  5878.         }
  5879.       }, "transport.script");
  5880.       /** @type {string} */
  5881.       node.type = "text/javascript";
  5882.       node.src = this._buildUrl(url, _.mixin({
  5883.         wmode : 5,
  5884.         callback : key
  5885.       }, obj));
  5886.       /** @type {string} */
  5887.       node.async = "async";
  5888.       /** @type {!Element} */
  5889.       var head = document.getElementsByTagName("head")[0];
  5890.       if (!head) {
  5891.         /** @type {!Element} */
  5892.         head = document.createElement("head");
  5893.         document.documentElement.appendChild(head);
  5894.       }
  5895.       _.async(function() {
  5896.         head.insertBefore(node, head.firstChild);
  5897.       });
  5898.       /**
  5899.        * @return {undefined}
  5900.        */
  5901.       node.onerror = function() {
  5902.         /** @type {boolean} */
  5903.         inNext = true;
  5904.         message.call(stream, false);
  5905.         window[key] = undefined;
  5906.       };
  5907.       return true;
  5908.     }
  5909.   });
  5910.   var Access = inputs.inherit({
  5911.     id : "XHRhit",
  5912.     index : 10,
  5913.     _buildUrl : function(url, params) {
  5914.       /** @type {number} */
  5915.       params.wmode = 7;
  5916.       return Access.superclass._buildUrl.apply(this, [url, params]);
  5917.     },
  5918.     _parseResp : function(obj) {
  5919.       var key = service.parse(obj);
  5920.       if (!key) {
  5921.         throw "";
  5922.       }
  5923.       return _.map(function(letter) {
  5924.         return key[letter];
  5925.       }, _.keys(key));
  5926.     }
  5927.   });
  5928.   var Page = Container.inherit({
  5929.     transports : [Access, httpModule],
  5930.     trimParams : true,
  5931.     _initComponent : function() {
  5932.       Page.superclass._initComponent.apply(this, arguments);
  5933.       this._ilStorage = new Array({
  5934.         counterId : this.counterId
  5935.       });
  5936.     },
  5937.     postParams : [],
  5938.     checkYandexHost : function(url) {
  5939.       if (url) {
  5940.         a: {
  5941.           if (url = _.parseUrl(url).host.match(/(?:^|\.)(?:ya|yandex)\.(?:\w+|com?\.\w+)$/)) {
  5942.             if (url = url[0].split("yandex").reverse()[0].substring(1), -1 != _.arrayIndexOf(options.yandexWhiteListTld, url)) {
  5943.               break a;
  5944.             }
  5945.           }
  5946.           /** @type {boolean} */
  5947.           url = false;
  5948.         }
  5949.         if (url) {
  5950.           /** @type {string} */
  5951.           this.host = options.baseUrl + url;
  5952.         }
  5953.       }
  5954.     },
  5955.     sendHit : function(data) {
  5956.       var self = {};
  5957.       var i = this._ilStorage.get("il");
  5958.       if (data.visitColor) {
  5959.         self.vc = data.visitColor;
  5960.       }
  5961.       if (data.hasPrerender) {
  5962.         /** @type {number} */
  5963.         self.pr = 1;
  5964.       }
  5965.       if (i) {
  5966.         this._ilStorage.remove("il");
  5967.         self.ilt = that.encode(base64.encode(_.trim(i, end)));
  5968.       }
  5969.       this.checkYandexHost(data.referrer);
  5970.       this._hitExt({
  5971.         url : data.url,
  5972.         forceNoRedirect : data.forceNoRedirect,
  5973.         nohit : data.nohit,
  5974.         title : data.title,
  5975.         referrer : data.referrer,
  5976.         vParams : data.vParams,
  5977.         userParams : data.userParams,
  5978.         experiments : data.experiments,
  5979.         modes : data.modes,
  5980.         browserInfo : self,
  5981.         ts : data.ts,
  5982.         tz : data.tz,
  5983.         callback : data.callback,
  5984.         ctx : data.ctx
  5985.       }, "hit");
  5986.     }
  5987.   });
  5988.   var Ua = Class.inherit({
  5989.     cid : 3,
  5990.     cnt : 0,
  5991.     KEY_NAME : "wasSynced",
  5992.     _initComponent : function() {
  5993.       this._storage = new Array;
  5994.       this._cookie = new Error;
  5995.     },
  5996.     hit : function(cb, force) {
  5997.       var self = this;
  5998.       /** @type {boolean} */
  5999.       var obj = force === undefined ? true : false;
  6000.       var options = obj ? this._storage.get(this.KEY_NAME) : false;
  6001.       /** @type {!Array} */
  6002.       var g = [];
  6003.       var cb = this.globalConfig.get("fakeHit");
  6004.       if (cb) {
  6005.         return cb(function(fallbackReleases) {
  6006.           cb(fallbackReleases);
  6007.         });
  6008.       }
  6009.       if (!options && obj && (options = this._cookie.read(this.KEY_NAME))) {
  6010.         options = service.parse(options);
  6011.       }
  6012.       if (options && options.time + 864E5 > context.getMs()) {
  6013.         self.globalConfig.set("isEU", options.params.eu);
  6014.         cb(options);
  6015.       } else {
  6016.         this.globalConfig.set("fakeHit", function(a) {
  6017.           g.push(a);
  6018.         });
  6019.         this._getSender().sendHit({
  6020.           forceNoRedirect : this.forceNoRedirect,
  6021.           callback : function(obj, name) {
  6022.             var data = obj || {};
  6023.             options = {
  6024.               time : context.getMs(),
  6025.               params : data,
  6026.               bkParams : name
  6027.             };
  6028.             self.globalConfig.set("isEU", data.eu);
  6029.             self._storage.set(self.KEY_NAME, options);
  6030.             self._cookie.create(self.KEY_NAME, service.stringify(options), 1728);
  6031.             cb(options);
  6032.             self.globalConfig.set("fakeHit", function(requestParser) {
  6033.               requestParser(options);
  6034.             });
  6035.             _.arrayEvery(g, function(requestParser) {
  6036.               requestParser(options);
  6037.               return 1;
  6038.             });
  6039.           }
  6040.         });
  6041.       }
  6042.     },
  6043.     _getSender : function() {
  6044.       if (!this._sender) {
  6045.         this._sender = new Page({
  6046.           protocol : "https:",
  6047.           counterType : this.cnt,
  6048.           counterId : this.cid,
  6049.           sendTitle : false,
  6050.           globalConfig : this.globalConfig,
  6051.           fake : true
  6052.         });
  6053.       }
  6054.       return this._sender;
  6055.     }
  6056.   });
  6057.   var Uint8Array = Class.inherit({
  6058.     baseUrl : options.baseUrl,
  6059.     globalConfig : api,
  6060.     baseTld : "ru",
  6061.     partners : {
  6062.       "mc.beru.ru" : {
  6063.         regex : /^([^/]+\.)?beru\.ru$/,
  6064.         tld : "ru"
  6065.       },
  6066.       "mc.kinopoisk.ru" : {
  6067.         regex : /^([^/]+\.)?kinopoisk\.ru$/,
  6068.         tld : "ru"
  6069.       }
  6070.     },
  6071.     _initComponent : function() {
  6072.       var codes = this;
  6073.       Uint8Array.superclass._initComponent.apply(this, arguments);
  6074.       this.syncTlds = _.reduce(function(notifications, saveNotifs) {
  6075.         return saveNotifs(notifications);
  6076.       }, options.yandexWhiteListTld, [_.bind(_.filter, null, function(b) {
  6077.         return b !== codes.baseTld;
  6078.       }), _.bind(_.reduce, null, function(animations, i) {
  6079.         /** @type {!Array} */
  6080.         animations[i] = [i];
  6081.         return animations;
  6082.       }, {})]);
  6083.       _.forEachKey(this.partners, function(a, options) {
  6084.         if (options.regex.test(window.location.hostname)) {
  6085.           if (!this.syncTlds[options.tld]) {
  6086.             /** @type {!Array} */
  6087.             this.syncTlds[options.tld] = [];
  6088.           }
  6089.           this.syncTlds[options.tld].push(a);
  6090.           /** @type {boolean} */
  6091.           this._replaceBase[a] = true;
  6092.         }
  6093.       }, this);
  6094.     },
  6095.     _replaceBase : {},
  6096.     langToDomain : {
  6097.       ka : "ge",
  6098.       ro : "md",
  6099.       tg : "tj",
  6100.       tk : "tm",
  6101.       et : "ee",
  6102.       hy : "com.am",
  6103.       he : "co.li",
  6104.       ky : "kg",
  6105.       uk : "ua",
  6106.       be : "by",
  6107.       tr : "com.tr",
  6108.       kk : "kz"
  6109.     },
  6110.     sync : function(fn) {
  6111.       var self = this;
  6112.       var name = this._need();
  6113.       /** @type {boolean} */
  6114.       var d = -1 != parse().hostname.search(/(?:^|\.)(?:ya|yandex|beru|kinopoisk)\.(?:\w+|com?\.\w+)$/);
  6115.       if (!this._is() && name) {
  6116.         this._setStatus(true);
  6117.         if (d) {
  6118.           this._getCn().hit(function() {
  6119.             self._sync(name, fn);
  6120.           });
  6121.         } else {
  6122.           fn();
  6123.         }
  6124.       } else {
  6125.         fn();
  6126.       }
  6127.       if (d) {
  6128.         this._addMda();
  6129.       }
  6130.     },
  6131.     _addMda : function() {
  6132.       var a = new Error({
  6133.         skipPrefix : true
  6134.       });
  6135.       var cookie = new Error;
  6136.       var undefinedType = a.read("mda");
  6137.       if ("0" !== undefinedType && "1" !== undefinedType) {
  6138.         a.create("mda", "0", 1036800);
  6139.       }
  6140.       if (cookie.read("mda")) {
  6141.         cookie.erase("mda");
  6142.       }
  6143.     },
  6144.     _is : function() {
  6145.       try {
  6146.         return !!this.globalConfig.get("startSync");
  6147.       } catch (a) {
  6148.         return false;
  6149.       }
  6150.     },
  6151.     _setStatus : function(value) {
  6152.       try {
  6153.         this.globalConfig.set("startSync", value);
  6154.       } catch (b) {
  6155.       }
  6156.     },
  6157.     _need : function() {
  6158.       var i = this._getDomainByLang();
  6159.       var j = this._getTld();
  6160.       /** @type {!Array} */
  6161.       var data = [];
  6162.       var range;
  6163.       if (range = this.syncTlds[j]) {
  6164.         data.push.apply(data, range);
  6165.       }
  6166.       range = this.syncTlds[i];
  6167.       if (i !== j && range) {
  6168.         data.push.apply(data, range);
  6169.       }
  6170.       var subwikiListsCache = this._getLs().get("synced") || {};
  6171.       data = _.arrayFilter(data, function(wikiId) {
  6172.         return (subwikiListsCache[wikiId] || 1) + 1440 < context.getMinutes();
  6173.       });
  6174.       return data.length && data || false;
  6175.     },
  6176.     _sync : function(src, callback) {
  6177.       var j;
  6178.       /** @type {number} */
  6179.       var len2 = 0;
  6180.       /** @type {string} */
  6181.       var prefix = options.protocol + "//";
  6182.       var len = src.length;
  6183.       var config = this;
  6184.       if (0 < len) {
  6185.         callback = callback || function() {
  6186.         };
  6187.         /**
  6188.          * @return {undefined}
  6189.          */
  6190.         var success = function() {
  6191.           len2++;
  6192.           if (len === len2) {
  6193.             callback();
  6194.           }
  6195.         };
  6196.         var state = config._getLs();
  6197.         var reqres2 = new ReqRes({});
  6198.         /** @type {number} */
  6199.         j = 0;
  6200.         for (; j < len; j++) {
  6201.           (function(name) {
  6202.             reqres2.request(prefix + (config._replaceBase[name] ? name : config.baseUrl + name) + "/sync_cookie_image_check", {}, function(prop) {
  6203.               success();
  6204.               var dummy = context.getMinutes();
  6205.               if (!prop) {
  6206.                 /** @type {number} */
  6207.                 dummy = dummy - 1435;
  6208.               }
  6209.               prop = state.get("synced") || {};
  6210.               prop[name] = dummy;
  6211.               state.set("synced", prop);
  6212.             });
  6213.           })(src[j]);
  6214.         }
  6215.       } else {
  6216.         callback();
  6217.       }
  6218.     },
  6219.     _getCn : function() {
  6220.       if (!this._cn) {
  6221.         this._cn = new Ua({
  6222.           fake : true,
  6223.           globalConfig : this.globalConfig
  6224.         });
  6225.       }
  6226.       return this._cn;
  6227.     },
  6228.     _getLs : function() {
  6229.       if (!this._ls) {
  6230.         this._ls = new Array;
  6231.       }
  6232.       return this._ls;
  6233.     },
  6234.     _getTld : function() {
  6235.       var mask = _.getTld();
  6236.       return {
  6237.         am : "com.am",
  6238.         tr : "com.tr",
  6239.         ge : "com.ge",
  6240.         il : "co.il",
  6241.         "\u0440\u0444" : "ru",
  6242.         "xn--p1ai" : "ru",
  6243.         "\u0443\u043a\u0440" : "ua",
  6244.         "xn--j1amh" : "ua",
  6245.         "\u0431\u0435\u043b" : "by",
  6246.         "xn--90ais" : "by"
  6247.       }[mask] || mask;
  6248.     },
  6249.     _getDomainByLang : function() {
  6250.       if (!window.navigator) {
  6251.         return "ru";
  6252.       }
  6253.       try {
  6254.         var category = navigator.languages ? navigator.languages[0] : $scope.getLanguage();
  6255.       } catch (b) {
  6256.       }
  6257.       category = (category || "").toLowerCase().split("-")[0];
  6258.       return this.langToDomain[category] || "ru";
  6259.     }
  6260.   });
  6261.   var Request = inputs.inherit({
  6262.     id : "RawBodyXHR",
  6263.     index : 9,
  6264.     postParams : ["body"],
  6265.     _setHeaders : function() {
  6266.     },
  6267.     _preparePostParams : function(a) {
  6268.       return a.post.body || "";
  6269.     }
  6270.   });
  6271.   $scope.isAndroid = require(function() {
  6272.     /** @type {string} */
  6273.     var ua = navigator.userAgent.toLowerCase();
  6274.     var b = $scope.getPlatform() || "";
  6275.     return -1 < ua.indexOf("android") && -1 < ua.indexOf("mobile") && b.match(/^android|linux armv/i);
  6276.   }, "", true);
  6277.   var methods = {
  6278.     _url : options.protocol + "//" + options.host + "/user_storage_set?",
  6279.     _params : {},
  6280.     init : function(s) {
  6281.       this._params = s || {};
  6282.     },
  6283.     save : function(obj, edge) {
  6284.       this._getReq().request(this._url + s.stringify({
  6285.         key : obj,
  6286.         value : _.toJSON(edge)
  6287.       }));
  6288.       this._getLs().set(obj, edge);
  6289.     },
  6290.     get : function(id) {
  6291.       return {
  6292.         remote : this._params[id],
  6293.         local : this._getLs().get(id)
  6294.       };
  6295.     },
  6296.     getNum : function(obj) {
  6297.       obj = this.get(obj);
  6298.       return Math.max(+obj.remote || 0, +obj.local || 0);
  6299.     },
  6300.     _getLs : function() {
  6301.       if (!this._ls) {
  6302.         this._ls = new Array;
  6303.       }
  6304.       return this._ls;
  6305.     },
  6306.     _getReq : function() {
  6307.       if (!this._req) {
  6308.         this._req = new ReqRes;
  6309.       }
  6310.       return this._req;
  6311.     }
  6312.   };
  6313.   var store = {
  6314.     sync : require(function(rawData, inmediate_node, array, opt_eventSource) {
  6315.       var data = {
  6316.         t : 'UV|L7,!"T[rwe&D_>ZIb\\aW#98Y.PC6k'
  6317.       };
  6318.       this.globalConfig = opt_eventSource || api;
  6319.       if (this._enabled(rawData, inmediate_node, array)) {
  6320.         this._setStatus(true);
  6321.         var stream = new Request({
  6322.           method : "GET",
  6323.           withCredentials : false
  6324.         });
  6325.         var _editorActionRegInfo = this._getHosts();
  6326.         var l = _editorActionRegInfo.length;
  6327.         (function save(i) {
  6328.           var info = _editorActionRegInfo[i];
  6329.           if (i < l) {
  6330.             stream.request(info[0] + ":" + info[1] + "/p", data, function(key, value) {
  6331.               if (key) {
  6332.                 this._save(key, value, info[1]);
  6333.               } else {
  6334.                 save.call(this, i + 1);
  6335.               }
  6336.             }, this);
  6337.           } else {
  6338.             this._save(false);
  6339.           }
  6340.         }).call(this, 0);
  6341.       }
  6342.     }, "ds"),
  6343.     _getHosts : function() {
  6344.       /** @type {!Array} */
  6345.       var newNodeLists = [];
  6346.       var string = result.protocol;
  6347.       var pubStr = $scope.isIOS();
  6348.       if ($scope.isAndroid() || pubStr && "http:" === string) {
  6349.         newNodeLists.push(["http://127.0.0.1", "30102"], ["http://127.0.0.1", "29009"]);
  6350.       }
  6351.       if (pubStr && "https:" === string) {
  6352.         newNodeLists.push(["https://yandexmetrica.com", "30103"], ["https://yandexmetrica.com", "29010"]);
  6353.       }
  6354.       return newNodeLists;
  6355.     },
  6356.     _save : function(value, type, i) {
  6357.       var e = context.getMinutes();
  6358.       if (value) {
  6359.         (new Container({
  6360.           protocol : "https:",
  6361.           counterType : 0,
  6362.           counterId : 42822899,
  6363.           sendTitle : false,
  6364.           fake : true
  6365.         })).sendDevice({
  6366.           data : _.trim(type),
  6367.           port : i
  6368.         });
  6369.       } else {
  6370.         /** @type {number} */
  6371.         e = e - 45;
  6372.       }
  6373.       methods.save("ds", e);
  6374.     },
  6375.     _is : function() {
  6376.       try {
  6377.         return !!this.globalConfig.get("dSync");
  6378.       } catch (a) {
  6379.         return false;
  6380.       }
  6381.     },
  6382.     _enabled : function(el, node, rawData) {
  6383.       if (!(60 < context.getMinutes() - methods.getNum("ds")) || this._is() || _.isDev(this.globalConfig)) {
  6384.         return false;
  6385.       }
  6386.       /** @type {boolean} */
  6387.       el = 0 === node && 0 <= _.arrayIndexOf([39370095, 1282253, 29302335, 43653484, 41734944, 31048081, 16443139, 27737346, 41870499, 33911514, 30744873, 5564395, 2580487], el);
  6388.       el = runDouban() || !rawData && .1 >= Math.random() && el;
  6389.       rawData = $scope.isIOS() && el;
  6390.       return $scope.isAndroid() && el || rawData;
  6391.     },
  6392.     _setStatus : function(value) {
  6393.       try {
  6394.         this.globalConfig.set("dSync", value);
  6395.       } catch (b) {
  6396.       }
  6397.     }
  6398.   };
  6399.   var _this = {
  6400.     getPos : function(e) {
  6401.       var body = util.getRootElement();
  6402.       var nearby = util.getDocumentScroll();
  6403.       return [e.pageX || e.clientX + nearby[0] - (body.clientLeft || 0) || 0, e.pageY || e.clientY + nearby[1] - (body.clientTop || 0) || 0];
  6404.     },
  6405.     getTarget : function(e) {
  6406.       /** @type {null} */
  6407.       var el = null;
  6408.       try {
  6409.         if (el = e.target || e.srcElement) {
  6410.           if (!el.ownerDocument && el.documentElement) {
  6411.             el = el.documentElement;
  6412.           } else {
  6413.             if (el.ownerDocument !== document) {
  6414.               /** @type {null} */
  6415.               el = null;
  6416.             }
  6417.           }
  6418.         }
  6419.       } catch (c) {
  6420.       }
  6421.       return el;
  6422.     },
  6423.     getMouseButton : function(event) {
  6424.       return event.which || event.button == undefined ? event.which : event.button & 1 ? 1 : event.button & 2 ? 3 : event.button & 4 ? 2 : 0;
  6425.     },
  6426.     prevent : function(event) {
  6427.       event = event || window.event;
  6428.       if (event.preventDefault) {
  6429.         event.preventDefault();
  6430.       } else {
  6431.         /** @type {boolean} */
  6432.         event.returnValue = false;
  6433.       }
  6434.     }
  6435.   };
  6436.   _this.dispatchCustomEvent = require(function(type, element) {
  6437.     var event;
  6438.     element = element || document;
  6439.     if (event = _.getNativeFunction("createEvent", document)("Event")) {
  6440.       event.initEvent(type, false, false);
  6441.       _.getNativeFunction("dispatchEvent", element)(event);
  6442.     }
  6443.   }, "evt.dispatch");
  6444.   var message = {
  6445.     lastReferrer : null
  6446.   };
  6447.   var w = Class.inherit({
  6448.     counter : null,
  6449.     prefsEcommerce : null,
  6450.     status : {
  6451.       NEW : undefined,
  6452.       PENDING : 1,
  6453.       OK : 2,
  6454.       FAIL : 3
  6455.     },
  6456.     dataLayerName : "dataLayer",
  6457.     _initComponent : function() {
  6458.       /** @type {string} */
  6459.       var newSlideNum = "customArr";
  6460.       w.superclass._initComponent.apply(this, arguments);
  6461.       if (this.frameConnector) {
  6462.         this.frameConnector.addHandler("params", function(a, options) {
  6463.           if (this.counter && this.counter.params) {
  6464.             this.counter.params(options.data);
  6465.           }
  6466.         }, this);
  6467.       }
  6468.       this._overridePush(this.globalConfig.get("dataLayer"));
  6469.       if (this.prefsEcommerce || this.prefsUseDataLayer) {
  6470.         if (!this._overridePush(this.prefsEcommerce)) {
  6471.           if (_.isString(this.prefsEcommerce)) {
  6472.             this.dataLayerName = this.prefsEcommerce;
  6473.           }
  6474.           newSlideNum = this.dataLayerName;
  6475.           this._tryTimeout = _.bind(this._tryTimeout, this);
  6476.           this._tryTimeout();
  6477.         }
  6478.         this.counter._ecommerce = newSlideNum;
  6479.       }
  6480.     },
  6481.     _overridePush : function(obj) {
  6482.       if (obj && "function" == typeof obj.push) {
  6483.         var log = this;
  6484.         log._send(obj);
  6485.         /** @type {!Function} */
  6486.         var item = obj.push;
  6487.         /**
  6488.          * @return {?}
  6489.          */
  6490.         obj.push = function() {
  6491.           var new_length = item.apply(this, arguments);
  6492.           log._send([].slice.call(arguments, 0));
  6493.           return new_length;
  6494.         };
  6495.         return true;
  6496.       }
  6497.       return false;
  6498.     },
  6499.     _tryTimeout : function() {
  6500.       if (!this._overridePush(window[this.dataLayerName])) {
  6501.         _.setTimeout(this._tryTimeout, 1E3, "dlObserver");
  6502.       }
  6503.     },
  6504.     _callHandlers : function(data) {
  6505.       _.arrayEvery(w.handlers, function(src) {
  6506.         if (src && src.type) {
  6507.           _.arrayEvery(src.type.split(","), function(proxyValue) {
  6508.             if (proxyValue.replace(" ", "") === data.type && src.callback) {
  6509.               src.callback(data);
  6510.             }
  6511.             return 1;
  6512.           });
  6513.         }
  6514.         return 1;
  6515.       });
  6516.     },
  6517.     allowedEvents : "currencyCode add delete remove purchase checkout detail".split(" "),
  6518.     _convert : function(to, data) {
  6519.       var valid = _.keys(data);
  6520.       /** @type {boolean} */
  6521.       var v = false;
  6522.       var props = {
  6523.         transaction_id : "id",
  6524.         value : "revenue"
  6525.       };
  6526.       if (data.items) {
  6527.         var value = {};
  6528.         value[to] = {
  6529.           products : data.items
  6530.         };
  6531.         if (1 < valid.length) {
  6532.           value[to].actionField = _.reduce(function(event, i) {
  6533.             if (props[i]) {
  6534.               event[props[i]] = data[i];
  6535.             } else {
  6536.               if ("currency" === i) {
  6537.                 v = data[i];
  6538.               } else {
  6539.                 if ("items" !== i && data[i]) {
  6540.                   event[i] = data[i];
  6541.                 }
  6542.               }
  6543.             }
  6544.             return event;
  6545.           }, {}, valid);
  6546.         }
  6547.         if (v) {
  6548.           value.currencyCode = v;
  6549.         }
  6550.         return value;
  6551.       }
  6552.     },
  6553.     _checkGtag : function(l) {
  6554.       var geometries = {
  6555.         view_item : "detail",
  6556.         add_to_cart : "add",
  6557.         remove_from_cart : "remove",
  6558.         begin_checkout : "checkout",
  6559.         purchase : "purchase"
  6560.       };
  6561.       /** @type {!Array} */
  6562.       var _title_labels = [];
  6563.       if (l && "event" === l[0] && geometries[l[1]] && (l = this._convert(geometries[l[1]], l[2]))) {
  6564.         _title_labels.push(l);
  6565.       }
  6566.       return _title_labels;
  6567.     },
  6568.     _send : function(o) {
  6569.       /** @type {!Array} */
  6570.       var added = [];
  6571.       var a = this.allowedEvents;
  6572.       var d;
  6573.       var textWidth;
  6574.       /** @type {number} */
  6575.       var i = 0;
  6576.       textWidth = o.length;
  6577.       for (; i < textWidth; i++) {
  6578.         if ((d = o[i]) && d.ymetrikaEvent) {
  6579.           var data = d.ymetrikaEvent;
  6580.           this._callHandlers(data);
  6581.           if ("params" === data.type && data.data) {
  6582.             if (!data.sended) {
  6583.               /** @type {!Array} */
  6584.               data.sended = [];
  6585.             }
  6586.             if (data.counter) {
  6587.               if (this.counter && this.counter.params && this.counterId == data.counter) {
  6588.                 this.counter.params(data.data);
  6589.                 data.sended.push(this.counterId);
  6590.               }
  6591.             } else {
  6592.               _.forEachKey(this.globalConfig.get("counters"), function(clusterShardData, params) {
  6593.                 var c = clusterShardData.split(":")[0];
  6594.                 if (!_.inArray(data.sended, c) && params && params.params) {
  6595.                   params.params(data.data);
  6596.                   data.sended.push(c);
  6597.                 }
  6598.               }, this);
  6599.             }
  6600.             if (data.status == this.status.NEW && data.parent && this.frameConnector && this.frameConnector.checkFrame(window.parent) && window.parent !== window) {
  6601.               this.frameConnector.sendToParents({
  6602.                 type : "params",
  6603.                 data : data.data
  6604.               }, function() {
  6605.                 data.status = this.status.OK;
  6606.               }, this);
  6607.               data.status = this.status.PENDING;
  6608.             }
  6609.           }
  6610.         }
  6611.         if (d && d.ecommerce) {
  6612.           var item = {};
  6613.           /** @type {boolean} */
  6614.           var n = false;
  6615.           _.forEachKey(d.ecommerce, function(type, values) {
  6616.             if (0 <= _.arrayIndexOf(a, type)) {
  6617.               /** @type {boolean} */
  6618.               n = true;
  6619.               item[type] = values;
  6620.             }
  6621.           });
  6622.           if (n) {
  6623.             added.push(item);
  6624.           }
  6625.         }
  6626.         /** @type {!Array<?>} */
  6627.         added = added.concat(this._checkGtag(d));
  6628.       }
  6629.       if (added.length) {
  6630.         this.counter.params({
  6631.           __ym : {
  6632.             ecommerce : added
  6633.           }
  6634.         });
  6635.       }
  6636.     }
  6637.   });
  6638.   /** @type {!Array} */
  6639.   w.handlers = [];
  6640.   var request = {
  6641.     asyncChunk : 400,
  6642.     maxDuration : 20,
  6643.     restTime : 100,
  6644.     asyncBuffer : [],
  6645.     timeout : null,
  6646.     addAsyncItem : function(f, ctx, path, callparams, options) {
  6647.       var stream = this;
  6648.       this.asyncBuffer.push({
  6649.         fn : f,
  6650.         ctx : ctx,
  6651.         args : callparams || [],
  6652.         loggerName : options || ""
  6653.       });
  6654.       if (path) {
  6655.         stream.flushAsync(true);
  6656.       } else {
  6657.         clearTimeout(this.timeout);
  6658.         this.timeout = _.setTimeout(function() {
  6659.           stream.flushAsync();
  6660.           /** @type {null} */
  6661.           stream.timeout = null;
  6662.         }, this.restTime);
  6663.       }
  6664.     },
  6665.     chain : function(a, f, data, service) {
  6666.       var console = this;
  6667.       /**
  6668.        * @param {!Object} key
  6669.        * @return {?}
  6670.        */
  6671.       a.push = function(key) {
  6672.         throw 'Try to push in Executor when it started "' + key + '"';
  6673.       };
  6674.       (function fn(index, y, key) {
  6675.         console.addAsyncItem(function(i, b, validation) {
  6676.           b = a[i++](b);
  6677.           if (i <= a.length - 1) {
  6678.             fn(i, b, validation);
  6679.           }
  6680.         }, null, key, [index, y], service + "." + index);
  6681.       })(0, f, data);
  6682.     },
  6683.     callByTimeout : function(a, b) {
  6684.       /** @type {number} */
  6685.       var _startTime = +new Date;
  6686.       /** @type {number} */
  6687.       var currentTime = 0;
  6688.       var item = (b || 0) + 1;
  6689.       var dataHelpers = this;
  6690.       _.arrayEvery(this.asyncBuffer, function(options, idxC) {
  6691.         if (options.isExecuted) {
  6692.           return true;
  6693.         }
  6694.         require(function() {
  6695.           options.fn.apply(options.ctx, options.args);
  6696.         }, "AsyncExecutor." + options.loggerName)();
  6697.         /** @type {number} */
  6698.         currentTime = +new Date - _startTime;
  6699.         /** @type {boolean} */
  6700.         options.isExecuted = true;
  6701.         this.asyncBuffer.splice(idxC, 1);
  6702.         return a || 0 == this.asyncBuffer.length ? true : idxC >= this.asyncChunk || currentTime >= this.maxDuration ? (_.setTimeout(function() {
  6703.           dataHelpers.callByTimeout(a, item);
  6704.         }, this.restTime), false) : true;
  6705.       }, this);
  6706.     },
  6707.     flushAsync : function(a) {
  6708.       if (this.asyncBuffer.length) {
  6709.         this.callByTimeout(a);
  6710.       }
  6711.     }
  6712.   };
  6713.   /** @type {!Array<string>} */
  6714.   var value = "GDPR-ok GDPR-cross GDPR-cancel GDPR-skip GDPR-frame-skip GDPR-frame-ya GDPR-frame-noya GDPR-open-start GDPR-eu-skip GDPR-open-fail GDPR-open-success GDPR-cookie-success GDPR-cookie-fail GDPR-skip-login GDPR-skip-domain GDPR-skip-na GDPR-skip-eu-na GDPR-skip-wv".split(" ");
  6715.   /** @type {!Array} */
  6716.   var range = ["https://brozen.yandex.ru", "https://yabro1.zen-test.yandex.ru/yabro/index.html", "https://yabro2.zen-test.yandex.ru/yabro/index.html"];
  6717.   var img = Class.inherit({
  6718.     globalKey : "f1",
  6719.     MAX_SIZE : 1E6,
  6720.     isYAN : false,
  6721.     trigger : function(type) {
  6722.       this.globalConfig.get("dataLayer").push({
  6723.         ymetrikaEvent : {
  6724.           type : type
  6725.         }
  6726.       });
  6727.     },
  6728.     initCounter : function() {
  6729.     },
  6730.     enabled : runDouban() && -1 < window.location.href.indexOf("yagdprcheck=1"),
  6731.     _initComponent : function() {
  6732.       this._cookie = img.cookie;
  6733.       this._sender = new Ua({
  6734.         fake : true,
  6735.         globalConfig : this.globalConfig,
  6736.         forceNoRedirect : true
  6737.       });
  6738.     },
  6739.     realise : function(a, b) {
  6740.       this.initCounter.apply(window, a);
  6741.       this.globalConfig.set(this.globalKey, function(saveNotifs) {
  6742.         saveNotifs();
  6743.       });
  6744.       if (b.length) {
  6745.         request.chain(b.concat([function() {
  6746.           /** @type {!Array} */
  6747.           b = [];
  6748.         }]));
  6749.       }
  6750.     },
  6751.     showPopup : function(i, e, info, item, type) {
  6752.       var this_text = this;
  6753.       i = util.loadScript({
  6754.         src : "https://yastatic.net/q/global-notifications/cc/_lego-cc" + i + "." + e + ".js"
  6755.       });
  6756.       this_text.trigger("GDPR-open-start");
  6757.       /**
  6758.        * @param {?} event
  6759.        * @return {undefined}
  6760.        */
  6761.       i.onerror = function(event) {
  6762.         require(function() {
  6763.           throw event;
  6764.         }, "gdpr-popup")();
  6765.         this_text.trigger("GDPR-open-fail");
  6766.         this_text.realise(info, item);
  6767.         this_text.frameConnector.sendToChildren({
  6768.           type : "GDPR-ok"
  6769.         });
  6770.       };
  6771.       /**
  6772.        * @return {undefined}
  6773.        */
  6774.       i.onload = function() {
  6775.         this_text.trigger("GDPR-open-success");
  6776.         w.handlers = w.handlers.concat([{
  6777.           type : "GDPR-ok, GDPR-cross",
  6778.           callback : function(object) {
  6779.             if (!object.once) {
  6780.               type.create("gdpr", "0", 525600);
  6781.               this_text.realise(info, item);
  6782.               this_text.frameConnector.sendToChildren({
  6783.                 type : "GDPR-ok"
  6784.               });
  6785.               /** @type {boolean} */
  6786.               object.once = true;
  6787.             }
  6788.           }
  6789.         }, {
  6790.           type : "GDPR-cancel",
  6791.           callback : function() {
  6792.             type.create("gdpr", "1");
  6793.             this_text.logCancel();
  6794.             this_text.frameConnector.sendToChildren({
  6795.               type : "GDPR-cancel"
  6796.             });
  6797.           }
  6798.         }]);
  6799.       };
  6800.     },
  6801.     askGDPR : function(rules, element, options, d, f, o) {
  6802.       if (_.inArray([null, ""], rules)) {
  6803.         this.showPopup(element, options, d, f, o);
  6804.       } else {
  6805.         if ("0" === rules) {
  6806.           this.trigger("GDPR-cookie-success");
  6807.           this.realise(d, f);
  6808.         } else {
  6809.           if ("1" === rules) {
  6810.             return this.trigger("GDPR-cookie-fail"), this.logCancel(), false;
  6811.           }
  6812.         }
  6813.       }
  6814.     },
  6815.     logCancel : function() {
  6816.       this._sender.hit(function() {
  6817.       }, false);
  6818.     },
  6819.     handle : function() {
  6820.       var hittable = this._sender;
  6821.       /** @type {!Array} */
  6822.       var options = [];
  6823.       var value = ($scope.getLanguage() || "").toLowerCase().split("-")[0];
  6824.       /** @type {string} */
  6825.       var d = "ontouchstart" in window ? "-touch" : "";
  6826.       var group = this._cookie;
  6827.       var rules = group.read("gdpr");
  6828.       var filename = group.read("yaGdprCheck");
  6829.       var _this = this;
  6830.       var escapeTable = this.globalConfig.get(this.globalKey);
  6831.       /** @type {!Arguments} */
  6832.       var r = arguments;
  6833.       /** @type {number} */
  6834.       options.size = 0;
  6835.       if (escapeTable) {
  6836.         return escapeTable(function() {
  6837.           _this.realise(r, options);
  6838.         });
  6839.       }
  6840.       if (!_.inArray("ru en kk be ky tr tt uk".split(" "), value)) {
  6841.         /** @type {string} */
  6842.         value = "en";
  6843.       }
  6844.       if (!this.enabled && ("0" === rules || $scope.isSafariWebView() || $scope.isAndroidWebView() || _.inArray(range, window.location.href.split("?")[0]) || !runDouban() || group.read("yandex_login") || this.disable)) {
  6845.         return group.read("yandex_login") ? this.trigger("GDPR-skip-login") : runDouban() ? "0" === rules ? this.trigger("GDPR-skip") : $scope.isSafariWebView() || $scope.isAndroidWebView() ? this.trigger("GDPR-skip-wv") : this.trigger("GDPR-skip-na") : this.trigger("GDPR-skip-domain"), this.realise(r, options);
  6846.       }
  6847.       this.globalConfig.set(this.globalKey, function(a, c) {
  6848.         /** @type {number} */
  6849.         var str = 0;
  6850.         try {
  6851.           /** @type {number} */
  6852.           str = JSON.stringify(c).length || 0;
  6853.         } catch (Y) {
  6854.         }
  6855.         if (options.size + str < _this.MAX_SIZE) {
  6856.           options.push(a);
  6857.           options.size += str;
  6858.         } else {
  6859.           _.warning("GDPR buffer is exceeded");
  6860.         }
  6861.       });
  6862.       hittable.hit(function(originalFunctionTypeObj) {
  6863.         if (originalFunctionTypeObj.params.eu || filename || _this.enabled) {
  6864.           if (_this.frameConnector && _this.frameConnector.addHandler("isYandex", function() {
  6865.             return {
  6866.               type : "isYandex",
  6867.               isYandex : runDouban()
  6868.             };
  6869.           }), _this.frameConnector.isIframe) {
  6870.             _this.frameConnector.sendToParents({
  6871.               type : "isYandex"
  6872.             }, function(a, c) {
  6873.               /** @type {boolean} */
  6874.               var d = false;
  6875.               clearTimeout(_takingTooLongTimeout);
  6876.               if (c[0].isYandex) {
  6877.                 _this.trigger("GDPR-frame-ya");
  6878.                 _this.frameConnector.addHandler("GDPR-ok", function() {
  6879.                   if (!d) {
  6880.                     group.create("gdpr", "0", 525600);
  6881.                     _this.realise(c, options);
  6882.                     /** @type {boolean} */
  6883.                     d = true;
  6884.                   }
  6885.                 });
  6886.                 _this.frameConnector.addHandler("GDPR-cancel", function() {
  6887.                   group.create("gdpr", "1");
  6888.                 });
  6889.               } else {
  6890.                 _this.trigger("GDPR-frame-noya");
  6891.                 _this.realise(c, options);
  6892.               }
  6893.             });
  6894.             var _takingTooLongTimeout = _.setTimeout(function() {
  6895.               _this.trigger("GDPR-frame-skip");
  6896.               _this.realise(r, options);
  6897.             }, 2E3);
  6898.           } else {
  6899.             _this.askGDPR(rules, d, value, r, options, group);
  6900.           }
  6901.         } else {
  6902.           return originalFunctionTypeObj.params.eu ? _this.trigger("GDPR-skip-eu-na") : _this.trigger("GDPR-eu-skip"), _this.realise(r, options);
  6903.         }
  6904.       });
  6905.     }
  6906.   });
  6907.   /** @type {string} */
  6908.   img.globalKey = "f1";
  6909.   img.cookie = new Error({
  6910.     skipPrefix : true
  6911.   });
  6912.   /**
  6913.    * @param {string} path
  6914.    * @return {?}
  6915.    */
  6916.   img.getState = function(path) {
  6917.     var mode = img.cookie.read("gdpr");
  6918.     path = _.reduce(function(result, event) {
  6919.       if (event.ymetrikaEvent && _.inArray(value, event.ymetrikaEvent.type)) {
  6920.         result.push(_.arrayIndexOf(value, event.ymetrikaEvent.type));
  6921.       }
  6922.       return result;
  6923.     }, [], path.get("dataLayer"));
  6924.     return path.length ? (path = path.join(","), mode && (path = path + ("-" + (_.inArray(["0", "1"], mode) ? mode : "2"))), path) : "";
  6925.   };
  6926.   var FACTORY = {
  6927.     init : function(options, port) {
  6928.       /** @type {!Element} */
  6929.       var img = document.createElement("img");
  6930.       if (options && options.account && options.tmsec && port) {
  6931.         /** @type {string} */
  6932.         img.src = "https://www.tns-counter.ru/V13a****" + options.account + "/ru/UTF-8/tmsec=" + options.tmsec + "/" + port;
  6933.       }
  6934.     }
  6935.   };
  6936.   /**
  6937.    * @return {?}
  6938.    */
  6939.   $scope.isIE = function() {
  6940.     return document && !document.addEventListener || false;
  6941.   };
  6942.   /**
  6943.    * @return {?}
  6944.    */
  6945.   $scope.isChromePdf = function() {
  6946.     var i;
  6947.     /** @type {!PluginArray} */
  6948.     var plugins = navigator.plugins;
  6949.     if (plugins && plugins.length) {
  6950.       /** @type {number} */
  6951.       i = 0;
  6952.       for (; i < plugins.length; i++) {
  6953.         if (/Chrome PDF Viewer/.test(plugins[i].name)) {
  6954.           return true;
  6955.         }
  6956.       }
  6957.     }
  6958.     return false;
  6959.   };
  6960.   var me = {};
  6961.   me._cookie = new Error({
  6962.     onlyCurrentDomain : true
  6963.   });
  6964.   me._check = require(function() {
  6965.     return -1 < window.location.href.indexOf("_ym_debug=1") || window._ym_debug || "1" === me._cookie.read("debug");
  6966.   });
  6967.   me.enabled = me._check();
  6968.   me.log = require(function() {
  6969.     if (-1 < result.href.indexOf("_ym_debug=1") || window._ym_debug) {
  6970.       this._cookie.create("debug", "1");
  6971.     }
  6972.     if (window.console && console.log && this._check()) {
  6973.       /** @type {boolean} */
  6974.       me.enabled = true;
  6975.       console.log.apply(console, arguments);
  6976.     }
  6977.   }, "DebugConsole.log");
  6978.   var SenderClass = config.inherit({
  6979.     resource : "clmap",
  6980.     retry : true,
  6981.     transports : [ReqRes],
  6982.     sendClick : function(event, targetElement, e, cb) {
  6983.       this.send({
  6984.         "page-url" : event,
  6985.         "pointer-click" : targetElement
  6986.       }, {}, e, cb);
  6987.     }
  6988.   });
  6989.   var KeepAlive = Class.inherit({
  6990.     filter : null,
  6991.     ignoreTags : [],
  6992.     quota : 0,
  6993.     isTrackHash : false,
  6994.     protocol : "",
  6995.     counterId : 0,
  6996.     counterType : 0,
  6997.     startTime : 0,
  6998.     MAX_LEN_PATH : 128,
  6999.     TIMEOUT_CLICK : 50,
  7000.     TIMEOUT_SAME_CLICKS : 1E3,
  7001.     DELTA_SAME_CLICKS : 2,
  7002.     tags : "A B BIG BODY BUTTON DD DIV DL DT EM FIELDSET FORM H1 H2 H3 H4 H5 H6 HR I IMG INPUT LI OL P PRE SELECT SMALL SPAN STRONG SUB SUP TABLE TBODY TD TEXTAREA TFOOT TH THEAD TR U UL ABBR AREA BLOCKQUOTE CAPTION CENTER CITE CODE CANVAS DFN EMBED FONT INS KBD LEGEND LABEL MAP OBJECT Q S SAMP STRIKE TT ARTICLE AUDIO ASIDE FOOTER HEADER MENU METER NAV PROGRESS SECTION TIME VIDEO NOINDEX NOBR MAIN svg circle clippath ellipse defs foreignobject g glyph glyphref image line lineargradient marker mask path pattern polygon polyline radialgradient rect set text textpath title".split(" "),
  7003.     _initComponent : function() {
  7004.       var b;
  7005.       var i;
  7006.       /** @type {null} */
  7007.       this._lastClick = null;
  7008.       /** @type {boolean} */
  7009.       this.hasQuota = !!this.quota;
  7010.       this._quota = this.quota;
  7011.       /** @type {!Array} */
  7012.       this._ignoreTags = [];
  7013.       if (this.ignoreTags) {
  7014.         /** @type {number} */
  7015.         b = 0;
  7016.         for (; b < this.ignoreTags.length; b++) {
  7017.           if (this.ignoreTags[b]) {
  7018.             _.mergeArrays(this._ignoreTags, [String(this.ignoreTags[b]).toUpperCase()]);
  7019.           }
  7020.         }
  7021.       }
  7022.       this._cacheTags = {};
  7023.       /** @type {number} */
  7024.       b = 59;
  7025.       /** @type {function(...number): string} */
  7026.       var fromCharCode = String.fromCharCode;
  7027.       /** @type {number} */
  7028.       i = 0;
  7029.       for (; i < this.tags.length; i++) {
  7030.         /** @type {string} */
  7031.         this._cacheTags[this.tags[i]] = fromCharCode(b);
  7032.         fromCharCode(b);
  7033.         b++;
  7034.       }
  7035.       this._sender = new SenderClass({
  7036.         globalConfig : this.globalConfig,
  7037.         protocol : this.protocol,
  7038.         counterId : this.counterId,
  7039.         counterType : this.counterType
  7040.       });
  7041.       /** @type {boolean} */
  7042.       this._start = false;
  7043.       this.start();
  7044.     },
  7045.     destroy : function() {
  7046.       this.stop();
  7047.     },
  7048.     start : function() {
  7049.       if (!this._start) {
  7050.         self.on(document, "click", this._handler, this);
  7051.       }
  7052.       /** @type {boolean} */
  7053.       this._start = true;
  7054.     },
  7055.     stop : function() {
  7056.       if (this._start) {
  7057.         self.un(document, "click", this._handler, this);
  7058.       }
  7059.       /** @type {boolean} */
  7060.       this._start = false;
  7061.     },
  7062.     setTrackHash : function(prop) {
  7063.       /** @type {boolean} */
  7064.       this.isTrackHash = prop;
  7065.     },
  7066.     _isIgnore : function(c) {
  7067.       return util.classNameExists(c, "(ym-disable-clickmap|ym-clickmap-ignore)");
  7068.     },
  7069.     _handler : function(e) {
  7070.       e = {
  7071.         el : _this.getTarget(e),
  7072.         pos : _this.getPos(e),
  7073.         button : _this.getMouseButton(e),
  7074.         time : +new Date
  7075.       };
  7076.       if (this._isTrackingClick(e)) {
  7077.         var ret = util.getElementSize(e.el);
  7078.         var obj = util.getElementXY(e.el);
  7079.         /** @type {!Array} */
  7080.         ret = ["rn", _.random(), "x", Math.floor(65535 * (e.pos[0] - obj[0]) / (ret[0] || 1)), "y", Math.floor(65535 * (e.pos[1] - obj[1]) / (ret[1] || 1)), "t", Math.floor((e.time - this.startTime) / 100), "p", this._getElPath(e.el)];
  7081.         obj = parse().href;
  7082.         if (this.isTrackHash) {
  7083.           _.mergeArrays(ret, ["wh", "1"]);
  7084.         } else {
  7085.           obj = obj.split("#")[0];
  7086.         }
  7087.         this._sender.sendClick(_.trim(obj, batch), ret.join(":"));
  7088.         /** @type {!Object} */
  7089.         this._lastClick = e;
  7090.       }
  7091.     },
  7092.     _isTrackingClick : function(data) {
  7093.       var i;
  7094.       if (window.ymDisabledClickmap || _.isMetrikaPlayer() || !data.el) {
  7095.         return false;
  7096.       }
  7097.       var target = data.el.tagName;
  7098.       if ((2 == data.button || 3 == data.button) && "A" != target || this.filter && !this.filter(data.el, target)) {
  7099.         return false;
  7100.       }
  7101.       /** @type {number} */
  7102.       i = 0;
  7103.       for (; i < this._ignoreTags.length; i++) {
  7104.         if (this._ignoreTags[i] == target) {
  7105.           return false;
  7106.         }
  7107.       }
  7108.       target = data.el;
  7109.       for (; target;) {
  7110.         if (this._isIgnore(target)) {
  7111.           return false;
  7112.         }
  7113.         target = target.parentNode;
  7114.       }
  7115.       if (this._lastClick) {
  7116.         if (data.time - this._lastClick.time < this.TIMEOUT_CLICK) {
  7117.           return false;
  7118.         }
  7119.         /** @type {number} */
  7120.         target = Math.abs(this._lastClick.pos[0] - data.pos[0]);
  7121.         /** @type {number} */
  7122.         i = Math.abs(this._lastClick.pos[1] - data.pos[1]);
  7123.         /** @type {number} */
  7124.         var d = data.time - this._lastClick.time;
  7125.         if (this._lastClick.el == data.el && target < this.DELTA_SAME_CLICKS && i < this.DELTA_SAME_CLICKS && d < this.TIMEOUT_SAME_CLICKS) {
  7126.           return false;
  7127.         }
  7128.       }
  7129.       if (this.hasQuota) {
  7130.         if (!this._quota) {
  7131.           return false;
  7132.         }
  7133.         this._quota--;
  7134.       }
  7135.       return true;
  7136.     },
  7137.     _getElPath : function(element) {
  7138.       /** @type {string} */
  7139.       var ret = "";
  7140.       for (; element && element.parentNode && "BODY" != element.tagName && "HTML" != element.tagName;) {
  7141.         ret = ret + (this._cacheTags[element.tagName] || "*");
  7142.         ret = ret + (util.getElementNeighborPosition(element) || "");
  7143.         element = element.parentNode;
  7144.       }
  7145.       return _.trim(ret, this.MAX_LEN_PATH);
  7146.     }
  7147.   });
  7148.   var Embassy = Class.inherit({
  7149.     injectHash : {
  7150.       Wjw75ghm7fa7JW8p : "https://yastatic.net/metrika-static-watch/assessor-init.js",
  7151.       Z4RhWJNDJanzkGJa : "https://yastatic.net/metrika-static-watch/assessor-compare.js"
  7152.     },
  7153.     ASSESSOR_COOKIE : "assessor",
  7154.     REMOTE_CONTROL : "i",
  7155.     getInjectHash : function() {
  7156.       var subscriptions = {};
  7157.       _.forEachKey(this.injectHash, function(key) {
  7158.         subscriptions[k + ("" + _.fnv32a(key))] = this.injectHash[key];
  7159.       }, this);
  7160.       return subscriptions;
  7161.     },
  7162.     checkAssessor : function() {
  7163.       /** @type {!Array} */
  7164.       var result = [];
  7165.       var handlers = this.getInjectHash();
  7166.       _.forEachKey(handlers, function(name) {
  7167.         if ((new RegExp(name)).test(window.location.hash) || Error.get(this.ASSESSOR_COOKIE + name)) {
  7168.           Error.set(this.ASSESSOR_COOKIE + name);
  7169.           result.push(handlers[name]);
  7170.         }
  7171.       }, this);
  7172.       return result;
  7173.     },
  7174.     _initComponent : function() {
  7175.       var a = this.checkAssessor();
  7176.       if (!this.globalConfig.get(this.REMOTE_CONTROL)) {
  7177.         this.globalConfig.set(this.REMOTE_CONTROL, true);
  7178.         Embassy.superclass._initComponent.apply(this, arguments);
  7179.         this._executedMsgs = {};
  7180.         self.on(window, "message", this._onMessage, this);
  7181.         if (a.length) {
  7182.           this.globalConfig.set("oo", true);
  7183.           this.globalConfig.get("stopRecoder", function() {
  7184.           })();
  7185.           _.arrayEvery(a, function(cssSrc) {
  7186.             util.loadScript({
  7187.               src : cssSrc
  7188.             }, window);
  7189.             return 1;
  7190.           });
  7191.         }
  7192.       }
  7193.     },
  7194.     _buildRemoteIframe : function(cssSrc) {
  7195.       var element = _.getNativeFunction("createElement", document)("div");
  7196.       var c = util.getBody() || document.documentElement;
  7197.       if (c) {
  7198.         /** @type {string} */
  7199.         element.innerHTML = '<iframe name="RemoteIframe" allowtransparency="true" style="position: absolute; left: -999px; top: -999px; width: 1px; height: 1px;"></iframe>';
  7200.         var d = element.firstChild;
  7201.         /**
  7202.          * @return {undefined}
  7203.          */
  7204.         d.onload = function() {
  7205.           util.loadScript({
  7206.             src : cssSrc
  7207.           }, d.contentWindow);
  7208.         };
  7209.         window._ym__remoteIframeEl = d;
  7210.         if (element.createShadowRoot || element.webkitCreateShadowRoot) {
  7211.           c.appendChild(element);
  7212.           element.removeChild(d);
  7213.           if (c = element.createShadowRoot ? element.createShadowRoot() : element.webkitCreateShadowRoot()) {
  7214.             c.appendChild(d);
  7215.           }
  7216.           window._ym__remoteIframeContainer = element;
  7217.         } else {
  7218.           c.appendChild(d);
  7219.           window._ym__remoteIframeContainer = d;
  7220.         }
  7221.       }
  7222.     },
  7223.     _isAllowedLang : function(type) {
  7224.       return -1 !== _.arrayIndexOf(["ru", "uk", "en", "tr"], type);
  7225.     },
  7226.     _isAllowedOrigin : function(subName) {
  7227.       return /^http:\/\/([\w\-.]+\.)?webvisor\.com\/?$/.test(subName);
  7228.     },
  7229.     _isAllowedStatic : function(pathToDestinationFile) {
  7230.       return /^(([\w\-.]+\.)?dev\.webvisor\.com|yastatic\.net)$/.test(pathToDestinationFile);
  7231.     },
  7232.     _onMessage : function(data) {
  7233.       try {
  7234.         var opts = data.origin;
  7235.       } catch (c) {
  7236.       }
  7237.       if (opts && this._isAllowedOrigin(opts) && (opts = service.parse(data.data)) && "appendremote" === opts.action && this._isAllowedStatic(_.parseUrl(opts.domain).host) && this._isAllowedLang(opts.lang) && !this._executedMsgs[opts.id]) {
  7238.         /** @type {boolean} */
  7239.         this._executedMsgs[opts.id] = true;
  7240.         /** @type {!Object} */
  7241.         window._ym__postMessageEvent = data;
  7242.         window._ym__inpageMode = opts.inpageMode;
  7243.         window._ym__initMessage = opts.initMessage;
  7244.         this._buildRemoteIframe(opts.domain + "/cdn/inpage-remote/" + (opts.newScriptAddr ? "_inpage-remote_" : "inpage-remote.") + opts.lang + ".js");
  7245.       }
  7246.     }
  7247.   });
  7248.   var body = {
  7249.     match : function() {
  7250.       if (this.enabled()) {
  7251.         self.ready(function() {
  7252.           var iframe = _.getNativeFunction("createElement", document)("iframe");
  7253.           /**
  7254.            * @return {undefined}
  7255.            */
  7256.           iframe.onload = function() {
  7257.             methods.save("cm", context.getMinutes());
  7258.             util.removeNode(iframe);
  7259.           };
  7260.           /** @type {string} */
  7261.           iframe.style.display = "none";
  7262.           /** @type {string} */
  7263.           iframe.src = options.protocol + "//" + options.host + "/metrika/watch_match.html";
  7264.           document.documentElement.appendChild(iframe);
  7265.         });
  7266.       }
  7267.     },
  7268.     enabled : function() {
  7269.       return 1440 < context.getMinutes() - methods.getNum("cm") && "tr" === _.getTld();
  7270.     }
  7271.   };
  7272.   require(function() {
  7273.     (function(modules) {
  7274.       /**
  7275.        * @param {string} moduleId
  7276.        * @return {?}
  7277.        */
  7278.       function __webpack_require__(moduleId) {
  7279.         if (installedModules[moduleId]) {
  7280.           return installedModules[moduleId].exports;
  7281.         }
  7282.         var module = installedModules[moduleId] = {
  7283.           i : moduleId,
  7284.           l : false,
  7285.           exports : {}
  7286.         };
  7287.         modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  7288.         /** @type {boolean} */
  7289.         module.l = true;
  7290.         return module.exports;
  7291.       }
  7292.       var installedModules = {};
  7293.       __webpack_require__.m = modules;
  7294.       __webpack_require__.c = installedModules;
  7295.       /**
  7296.        * @param {!Function} exports
  7297.        * @param {string} name
  7298.        * @param {!Function} getter
  7299.        * @return {undefined}
  7300.        */
  7301.       __webpack_require__.d = function(exports, name, getter) {
  7302.         if (!__webpack_require__.o(exports, name)) {
  7303.           Object.defineProperty(exports, name, {
  7304.             configurable : false,
  7305.             enumerable : true,
  7306.             get : getter
  7307.           });
  7308.         }
  7309.       };
  7310.       /**
  7311.        * @param {!Object} module
  7312.        * @return {?}
  7313.        */
  7314.       __webpack_require__.n = function(module) {
  7315.         /** @type {function(): ?} */
  7316.         var getter = module && module.__esModule ? function() {
  7317.           return module["default"];
  7318.         } : function() {
  7319.           return module;
  7320.         };
  7321.         __webpack_require__.d(getter, "a", getter);
  7322.         return getter;
  7323.       };
  7324.       /**
  7325.        * @param {!Function} a
  7326.        * @param {string} x
  7327.        * @return {?}
  7328.        */
  7329.       __webpack_require__.o = function(a, x) {
  7330.         return Object.prototype.hasOwnProperty.call(a, x);
  7331.       };
  7332.       /** @type {string} */
  7333.       __webpack_require__.p = "";
  7334.       return __webpack_require__(__webpack_require__.s = 3);
  7335.     })({
  7336.       0 : function(fi, obj, signatureOnly) {
  7337.         /** @type {boolean} */
  7338.         obj.__esModule = true;
  7339.         /**
  7340.          * @param {string} separator
  7341.          * @return {?}
  7342.          */
  7343.         obj.listToArray = function(separator) {
  7344.           return separator ? [].slice.call(separator) : [];
  7345.         };
  7346.       },
  7347.       1 : function(module, exports, __weex_require__) {
  7348.         /** @type {boolean} */
  7349.         exports.__esModule = true;
  7350.         /** @type {!Array} */
  7351.         var eCfgEl = [".googlesyndication.com/", "/googleads"];
  7352.         /**
  7353.          * @param {string} BRANCHES
  7354.          * @return {?}
  7355.          */
  7356.         exports.isGoogleSrc = function(BRANCHES) {
  7357.           return !(!BRANCHES || !eCfgEl.filter(function(b) {
  7358.             return 0 < BRANCHES.indexOf(b);
  7359.           }).length);
  7360.         };
  7361.       },
  7362.       3 : function(params, obj, kvPredicate) {
  7363.         /** @type {boolean} */
  7364.         obj.__esModule = true;
  7365.         params = {
  7366.           detectAd : kvPredicate(4).detectAd
  7367.         };
  7368.         if (window.Ya) {
  7369.           if (window.Ya.AdDetector) {
  7370.             params = window.Ya.AdDetector;
  7371.           } else {
  7372.             /** @type {number} */
  7373.             window.Ya.AdDetector = params;
  7374.           }
  7375.         } else {
  7376.           window.Ya = {
  7377.             AdDetector : params
  7378.           };
  7379.         }
  7380.         /** @type {number} */
  7381.         obj.AdDetector = params;
  7382.       },
  7383.       34 : function(module, exports, __weex_require__) {
  7384.         /** @type {boolean} */
  7385.         exports.__esModule = true;
  7386.         /**
  7387.          * @param {!Object} immediate
  7388.          * @return {?}
  7389.          */
  7390.         exports.getParentElementsCount = function(immediate) {
  7391.           /** @type {number} */
  7392.           var b = 0;
  7393.           for (;;) {
  7394.             if (immediate = immediate.parentElement) {
  7395.               b++;
  7396.             } else {
  7397.               return b;
  7398.             }
  7399.           }
  7400.         };
  7401.       },
  7402.       4 : function(module, exports, __weex_require__) {
  7403.         /** @type {boolean} */
  7404.         exports.__esModule = true;
  7405.         var modal = __weex_require__(5);
  7406.         var picker = __weex_require__(9);
  7407.         var navigator = __weex_require__(34);
  7408.         var animation = __weex_require__(6);
  7409.         /** @type {!HTMLBodyElement} */
  7410.         var container = document.body;
  7411.         /** @type {!Element} */
  7412.         var element = document.documentElement;
  7413.         /**
  7414.          * @return {?}
  7415.          */
  7416.         exports.detectAd = function() {
  7417.           /** @type {number} */
  7418.           var i = window.pageYOffset || element.scrollTop || container.scrollTop;
  7419.           /** @type {number} */
  7420.           var offset = window.pageXOffset || element.scrollLeft || container.scrollLeft;
  7421.           /** @type {number} */
  7422.           var d = element.clientTop || container.clientTop || 0;
  7423.           /** @type {number} */
  7424.           var delta = element.clientLeft || container.clientLeft || 0;
  7425.           var len = element.scrollWidth || element.offsetWidth || window.innerWidth;
  7426.           var b = element.scrollHeight || element.offsetHeight || window.innerHeight;
  7427.           var view = animation.getFrienlyWindowsTree(window);
  7428.           /** @type {!Array} */
  7429.           var registeredBreakpoints = [];
  7430.           animation.windowsTreeEach(view, function(options) {
  7431.             var win = options.window;
  7432.             var model = options.parent;
  7433.             /** @type {boolean} */
  7434.             var headlessmaterial = 0 < modal.getParentFriendlyIFrames(win.document.documentElement).length;
  7435.             var root = picker.getAdsInWindow(win, {
  7436.               isInIFrame : headlessmaterial
  7437.             });
  7438.             headlessmaterial = root.adElements;
  7439.             root = root.iframeProviders;
  7440.             if (model) {
  7441.               var parent = win.frameElement;
  7442.               var self = registeredBreakpoints.filter(function(options) {
  7443.                 return options.windowsTree === model;
  7444.               })[0].adElements;
  7445.               root.forEach(function(provider) {
  7446.                 self.push({
  7447.                   provider : provider,
  7448.                   element : parent
  7449.                 });
  7450.               });
  7451.             }
  7452.             registeredBreakpoints.push({
  7453.               windowsTree : options,
  7454.               adElements : headlessmaterial
  7455.             });
  7456.           });
  7457.           registeredBreakpoints.forEach(function(ls1) {
  7458.             ls1.adElements = ls1.adElements.sort(function(options, scope) {
  7459.               return navigator.getParentElementsCount(options.element) - navigator.getParentElementsCount(scope.element);
  7460.             });
  7461.           });
  7462.           /** @type {!Array} */
  7463.           var dataArea = [];
  7464.           /** @type {!Array} */
  7465.           var self = [];
  7466.           registeredBreakpoints.forEach(function(a) {
  7467.             var c = a.windowsTree;
  7468.             var b = c.parent;
  7469.             a = a.adElements;
  7470.             c = modal.getParentFriendlyIFrames(c.window.document.documentElement);
  7471.             var source = c[c.length - 1];
  7472.             a.forEach(function(data) {
  7473.               var element = data.element;
  7474.               self.push({
  7475.                 provider : data.provider,
  7476.                 element : b ? source : element
  7477.               });
  7478.             });
  7479.           });
  7480.           self.forEach(function(data) {
  7481.             var e = data.element;
  7482.             var pos = e.getBoundingClientRect();
  7483.             /** @type {number} */
  7484.             var g = pos.top + i - d;
  7485.             /** @type {number} */
  7486.             pos = pos.left + offset - delta;
  7487.             var px = e.clientWidth;
  7488.             e = e.clientHeight;
  7489.             var val = pos + px;
  7490.             var current = g + e;
  7491.             var min = 0 > pos ? 0 : pos < len ? pos : len;
  7492.             var minSize = 0 > g ? 0 : g < b ? g : b;
  7493.             if (100 <= ((val > len ? len : val > min ? val : min) - min) * ((current > b ? b : current > minSize ? current : minSize) - minSize)) {
  7494.               dataArea.push({
  7495.                 top : g,
  7496.                 left : pos,
  7497.                 width : px,
  7498.                 height : e,
  7499.                 provider : data.provider
  7500.               });
  7501.             }
  7502.           });
  7503.           return {
  7504.             page : {
  7505.               width : len,
  7506.               height : b
  7507.             },
  7508.             window : {
  7509.               top : i,
  7510.               left : offset,
  7511.               width : window.innerWidth,
  7512.               height : window.innerHeight
  7513.             },
  7514.             ads : dataArea
  7515.           };
  7516.         };
  7517.       },
  7518.       5 : function(module, exports, __weex_require__) {
  7519.         /** @type {boolean} */
  7520.         exports.__esModule = true;
  7521.         /**
  7522.          * @param {!Object} el
  7523.          * @return {?}
  7524.          */
  7525.         exports.getParentFriendlyIFrames = function(el) {
  7526.           /** @type {!Array} */
  7527.           var foundEls = [];
  7528.           for (;;) {
  7529.             try {
  7530.               if (el = el.ownerDocument.defaultView.frameElement) {
  7531.                 foundEls.push(el);
  7532.               } else {
  7533.                 return foundEls;
  7534.               }
  7535.             } catch (t) {
  7536.               return foundEls;
  7537.             }
  7538.           }
  7539.         };
  7540.       },
  7541.       6 : function(depsLoaded, module, require) {
  7542.         /**
  7543.          * @param {!Window} host
  7544.          * @return {?}
  7545.          */
  7546.         function post(host) {
  7547.           return Drawable.listToArray(host.document.getElementsByTagName("iframe")).filter(function(elem) {
  7548.             if (platform.isSafari) {
  7549.               return false;
  7550.             }
  7551.             try {
  7552.               return elem.contentWindow.document;
  7553.             } catch (m) {
  7554.               return false;
  7555.             }
  7556.           }).map(function(bridgeFrame) {
  7557.             return bridgeFrame.contentWindow;
  7558.           });
  7559.         }
  7560.         /**
  7561.          * @param {!Window} name
  7562.          * @param {?} selector
  7563.          * @return {?}
  7564.          */
  7565.         function create(name, selector) {
  7566.           var data = {
  7567.             window : name,
  7568.             children : [],
  7569.             parent : selector
  7570.           };
  7571.           data.children = post(name).map(function(RequestError) {
  7572.             return create(RequestError, data);
  7573.           });
  7574.           return data;
  7575.         }
  7576.         /**
  7577.          * @param {!Object} type
  7578.          * @param {!Function} name
  7579.          * @return {undefined}
  7580.          */
  7581.         function f(type, name) {
  7582.           name(type);
  7583.           type.children.forEach(function(onExit) {
  7584.             return f(onExit, name);
  7585.           });
  7586.         }
  7587.         /** @type {boolean} */
  7588.         module.__esModule = true;
  7589.         var platform = require(7);
  7590.         var Drawable = require(0);
  7591.         /** @type {function(!Window, ?): ?} */
  7592.         module.getFrienlyWindowsTree = create;
  7593.         /** @type {function(!Object, !Function): undefined} */
  7594.         module.windowsTreeEach = f;
  7595.       },
  7596.       7 : function(t, d, h) {
  7597.         /** @type {boolean} */
  7598.         d.__esModule = true;
  7599.         t = h(8);
  7600.         d.isSafari = t.isSafari();
  7601.       },
  7602.       8 : function(a, b, variableNames) {
  7603.         /** @type {boolean} */
  7604.         b.__esModule = true;
  7605.         /**
  7606.          * @return {?}
  7607.          */
  7608.         b.isSafari = function() {
  7609.           /** @type {string} */
  7610.           var ua = navigator.userAgent.toLowerCase();
  7611.           return -1 !== ua.indexOf("safari") && -1 === ua.indexOf("chrome") && -1 === ua.indexOf("android");
  7612.         };
  7613.       },
  7614.       9 : function(module, exports, __webpack_require__) {
  7615.         /** @type {boolean} */
  7616.         exports.__esModule = true;
  7617.         var assert = __webpack_require__(0);
  7618.         var t = __webpack_require__(1);
  7619.         /**
  7620.          * @param {!Window} n
  7621.          * @param {?} game
  7622.          * @return {?}
  7623.          */
  7624.         exports.getAdsInWindow = function(n, game) {
  7625.           /**
  7626.            * @param {string} name
  7627.            * @param {!Array} selector
  7628.            * @return {undefined}
  7629.            */
  7630.           function isEnabled(name, selector) {
  7631.             selector.forEach(function(mathML) {
  7632.               self.push({
  7633.                 provider : name,
  7634.                 element : mathML
  7635.               });
  7636.             });
  7637.           }
  7638.           var s = game.isInIFrame;
  7639.           var parent = n.document.body;
  7640.           var variantViewer = assert.listToArray(parent.querySelectorAll("img"));
  7641.           var defectTypeCollection = assert.listToArray(parent.querySelectorAll("iframe"));
  7642.           var arrRef = assert.listToArray(parent.querySelectorAll("script"));
  7643.           var contatos = assert.listToArray(parent.querySelectorAll("div"));
  7644.           /** @type {!Array} */
  7645.           var self = [];
  7646.           /** @type {!Array} */
  7647.           var firebaseRef = [];
  7648.           var eCfgEl = assert.listToArray(parent.querySelectorAll("yatag"));
  7649.           var scenes = assert.listToArray(parent.querySelectorAll("yatag yatag"));
  7650.           isEnabled("yandex", eCfgEl.filter(function(sceneUid) {
  7651.             return -1 === scenes.indexOf(sceneUid);
  7652.           }));
  7653.           isEnabled("adriver", defectTypeCollection.filter(function(cur) {
  7654.             return (cur = cur.src) && -1 < cur.indexOf(".adriver.ru/");
  7655.           }));
  7656.           isEnabled("adfox", defectTypeCollection.filter(function(s) {
  7657.             return (s = s.id) && -1 < s.toLowerCase().indexOf("adfox");
  7658.           }));
  7659.           isEnabled("adfox", variantViewer.filter(function(cur) {
  7660.             return (cur = cur.src) && -1 < cur.indexOf("/banners.adfox.ru/");
  7661.           }));
  7662.           isEnabled("adfox", contatos.filter(function(vertexSet) {
  7663.             return -1 < vertexSet.id.indexOf("AdFox_banner_");
  7664.           }));
  7665.           if (s && variantViewer.filter(function(cur) {
  7666.             return (cur = cur.src) && -1 < cur.indexOf(".adfox.ru/");
  7667.           }).length) {
  7668.             firebaseRef.push("adfox");
  7669.           }
  7670.           defectTypeCollection.filter(function(a) {
  7671.             return t.isGoogleSrc(a.src);
  7672.           }).forEach(function(mathML) {
  7673.             self.push({
  7674.               provider : "google",
  7675.               element : mathML
  7676.             });
  7677.           });
  7678.           if (s && arrRef.filter(function(ci) {
  7679.             return t.isGoogleSrc(ci.src);
  7680.           }).length) {
  7681.             firebaseRef.push("google");
  7682.           }
  7683.           isEnabled("awaps", defectTypeCollection.filter(function(cur) {
  7684.             return (cur = cur.src) && -1 < cur.indexOf("awaps.yandex.net/");
  7685.           }));
  7686.           isEnabled("criteo", defectTypeCollection.filter(function(s) {
  7687.             var src = s.src;
  7688.             s = s.id;
  7689.             return src && (-1 < src.indexOf(".criteo.com/") || s && -1 < s.indexOf("cto_iframe_")) ? true : false;
  7690.           }));
  7691.           return {
  7692.             adElements : self,
  7693.             iframeProviders : firebaseRef
  7694.           };
  7695.         };
  7696.       }
  7697.     });
  7698.   }, "", true)();
  7699.   var atap = {
  7700.     init : function(a, be) {
  7701.       if (Math.random() < (be || .005) && !api.get("adDetect")) {
  7702.         api.set("adDetect", true);
  7703.         /**
  7704.          * @param {boolean} prev
  7705.          * @return {undefined}
  7706.          */
  7707.         var next = function(prev) {
  7708.           var options = window.Ya.AdDetector.detectAd();
  7709.           var el = options.window;
  7710.           var parent = options.page;
  7711.           a.sendParams({
  7712.             __ym : {
  7713.               ads : {
  7714.                 w : {
  7715.                   t : el.top,
  7716.                   l : el.left,
  7717.                   w : el.width,
  7718.                   h : el.height
  7719.                 },
  7720.                 p : {
  7721.                   w : parent.width,
  7722.                   h : parent.height
  7723.                 },
  7724.                 a : _.map(function(p) {
  7725.                   return {
  7726.                     t : p.top,
  7727.                     l : p.left,
  7728.                     w : p.width,
  7729.                     h : p.height,
  7730.                     p : p.provider
  7731.                   };
  7732.                 }, options.ads),
  7733.                 full : prev ? 1 : 0
  7734.               }
  7735.             }
  7736.           });
  7737.         };
  7738.         var fn = require(function() {
  7739.           self.un(window, "load", fn);
  7740.           next(true);
  7741.         }, "", true);
  7742.         self.on(window, "load", fn);
  7743.         _.setTimeout(next, 1E4, "AdDetector", true);
  7744.       }
  7745.     }
  7746.   };
  7747.   var ctor = Class.inherit({
  7748.     message : window.postMessage,
  7749.     spliter : ":",
  7750.     nameSpace : "__yminfo",
  7751.     pending : {},
  7752.     childs : {},
  7753.     isIframe : false,
  7754.     parents : {},
  7755.     dataToSend : {
  7756.       parents : [],
  7757.       childs : []
  7758.     },
  7759.     checkFrame : function(port) {
  7760.       try {
  7761.         var statsPort = port && port.postMessage;
  7762.       } catch (c) {
  7763.         return false;
  7764.       }
  7765.       return statsPort;
  7766.     },
  7767.     checkChildrenData : function(globeDepth, context) {
  7768.       _.arrayEvery(this.dataToSend.childs, function(options) {
  7769.         if (-1 == _.arrayIndexOf(options.tryTo, context.counterId)) {
  7770.           options.tryTo.push(context.counterId);
  7771.           _.mixin(options.data, {
  7772.             toCounter : context.counterId
  7773.           });
  7774.           this.sendToIframe(globeDepth, options.data, function() {
  7775.             options.sendedTo.push(context.counterId);
  7776.             if (options.callback) {
  7777.               options.callback(context, arguments);
  7778.             }
  7779.           });
  7780.         }
  7781.         return true;
  7782.       }, this);
  7783.     },
  7784.     checkParentData : function(globeDepth, context) {
  7785.       _.arrayEvery(this.dataToSend.parents, function(options) {
  7786.         if (-1 == _.arrayIndexOf(options.tryTo, context.counterId)) {
  7787.           options.tryTo.push(context.counterId);
  7788.           _.mixin(options.data, {
  7789.             toCounter : context.counterId
  7790.           });
  7791.           this.sendToIframe(globeDepth, options.data, function() {
  7792.             options.sendedTo.push(context.counterId);
  7793.             if (options.callback) {
  7794.               options.callback(context, arguments);
  7795.             }
  7796.           });
  7797.         }
  7798.         return true;
  7799.       }, this);
  7800.     },
  7801.     getHandlers : function() {
  7802.       return {
  7803.         initToChild : [{
  7804.           fn : function(x, y) {
  7805.             if (x.source === window.top) {
  7806.               this.trigger("parentConnect", x, y);
  7807.             }
  7808.           }
  7809.         }],
  7810.         initToParent : [{
  7811.           fn : function(doc, options) {
  7812.             this.childs[options.counterId] = {
  7813.               info : options,
  7814.               window : doc.source
  7815.             };
  7816.             this.checkChildrenData(doc.source, options);
  7817.           }
  7818.         }],
  7819.         parentConnect : [{
  7820.           fn : function(doc, options) {
  7821.             this.parents[options.counterId] = {
  7822.               info : options,
  7823.               window : doc.source
  7824.             };
  7825.             this.checkParentData(doc.source, options);
  7826.           }
  7827.         }]
  7828.       };
  7829.     },
  7830.     genMessage : function(event, row) {
  7831.       var data = {
  7832.         date : context.getMs(),
  7833.         key : Math.random(),
  7834.         dir : 0
  7835.       };
  7836.       if (row) {
  7837.         data = {
  7838.           date : row[0],
  7839.           key : row[1],
  7840.           dir : row[2]
  7841.         };
  7842.       }
  7843.       _.mixin(event, {
  7844.         counterId : this.counterId,
  7845.         hid : this.hid
  7846.       });
  7847.       var result = {
  7848.         data : event
  7849.       };
  7850.       /** @type {string} */
  7851.       result[this.nameSpace] = [this.nameSpace, data.date, data.key, data.dir].join(this.spliter);
  7852.       return {
  7853.         meta : data,
  7854.         string : service.stringify(result)
  7855.       };
  7856.     },
  7857.     sendToIframe : function(channel, data, size, options) {
  7858.       data = this.genMessage(data);
  7859.       var chartData = this;
  7860.       /** @type {string} */
  7861.       var i = [data.meta.date, data.meta.key].join(this.spliter);
  7862.       if (this.checkFrame(channel)) {
  7863.         channel.postMessage(data.string, "*");
  7864.         this.pending[i] = _.bind(size, options || this);
  7865.         _.setTimeout(function() {
  7866.           delete chartData.pending[i];
  7867.         }, 5E3, this, "fc.toSendToIframe");
  7868.       }
  7869.     },
  7870.     sendToChildren : function(a, callback, options) {
  7871.       var self = this;
  7872.       /** @type {number} */
  7873.       var i = this.dataToSend.childs.push({
  7874.         sendedTo : [],
  7875.         tryTo : [],
  7876.         callback : callback ? _.bind(callback, options || this) : false,
  7877.         data : a
  7878.       }) - 1;
  7879.       _.forEachKey(this.childs, function(a) {
  7880.         this.dataToSend.childs[i].tryTo.push(a);
  7881.         return 1;
  7882.       }, this);
  7883.       if (_.keys(this.childs).length) {
  7884.         _.forEachKey(this.childs, function(pid) {
  7885.           this.sendToIframe(self.childs[pid].window, _.mixin(a, {
  7886.             toCounter : pid
  7887.           }), function(inp) {
  7888.             this.dataToSend.childs[i].sendedTo.push(pid);
  7889.             if (this.dataToSend.childs[i].callback) {
  7890.               this.dataToSend.childs[i].callback(inp);
  7891.             }
  7892.           }, this);
  7893.         }, this);
  7894.       }
  7895.     },
  7896.     sendToParents : function(a, callback, options) {
  7897.       /** @type {number} */
  7898.       var id = this.dataToSend.parents.push({
  7899.         sendedTo : [],
  7900.         tryTo : [],
  7901.         callback : callback ? _.bind(callback, options || this) : false,
  7902.         data : a
  7903.       }) - 1;
  7904.       _.forEachKey(this.parents, function(a) {
  7905.         this.dataToSend.parents[id].tryTo.push(a);
  7906.         return 1;
  7907.       }, this);
  7908.       if (_.keys(this.parents).length) {
  7909.         this.sendToIframe(window.parent, a, function(inp) {
  7910.           _.forEachKey(this.parents, function(derTrigger) {
  7911.             this.dataToSend.parents[id].sendedTo.push(derTrigger);
  7912.             if (this.dataToSend.parents[id].callback) {
  7913.               this.dataToSend.parents[id].callback(inp);
  7914.             }
  7915.           }, this);
  7916.         }, this);
  7917.       }
  7918.     },
  7919.     addHandler : function(a, fn, context) {
  7920.       if (!this.handlers[a]) {
  7921.         /** @type {!Array} */
  7922.         this.handlers[a] = [];
  7923.       }
  7924.       this.handlers[a].push({
  7925.         fn : fn,
  7926.         ctx : context
  7927.       });
  7928.     },
  7929.     _initComponent : function() {
  7930.       /** @type {!NodeList<Element>} */
  7931.       var eiFrame = window.document.getElementsByTagName("iframe");
  7932.       /** @type {number} */
  7933.       var i = 0;
  7934.       ctor.superclass._initComponent.apply(this, arguments);
  7935.       this.handlers = _.mixin({}, this.getHandlers());
  7936.       this.isIframe = $scope.isIframe();
  7937.       if (this.message) {
  7938.         /** @type {number} */
  7939.         i = 0;
  7940.         for (; i < eiFrame.length; i++) {
  7941.           /** @type {!Element} */
  7942.           var subdoc = eiFrame[i];
  7943.           (function(self, doc) {
  7944.             self.sendToIframe(doc.contentWindow, {
  7945.               type : "initToChild"
  7946.             }, function(params) {
  7947.               self.childs[params.counterId] = {
  7948.                 info : params,
  7949.                 window : doc.contentWindow
  7950.               };
  7951.             });
  7952.           })(this, subdoc);
  7953.         }
  7954.         if (this.isIframe) {
  7955.           this.sendToIframe(window.parent, {
  7956.             type : "initToParent"
  7957.           }, function(height) {
  7958.             this.trigger("parentConnect", {
  7959.               source : window.parent
  7960.             }, height);
  7961.           });
  7962.         }
  7963.         self.on(window, "message", this.onMessage, this, {
  7964.           passive : false,
  7965.           name : "FrameConnector"
  7966.         });
  7967.       }
  7968.     },
  7969.     trigger : function(id, data, elem) {
  7970.       var _this = this;
  7971.       return _.map(function(item) {
  7972.         item = item.fn.call(item.ctx || _this, data, elem) || {};
  7973.         return _.mixin(item, {
  7974.           counterId : _this.counterId,
  7975.           hid : _this.hid
  7976.         });
  7977.       }, this.handlers[id]);
  7978.     },
  7979.     DIR_INDEX : 2,
  7980.     onMessage : function(message) {
  7981.       var b;
  7982.       /** @type {!Array} */
  7983.       var parent = [];
  7984.       try {
  7985.         var data = message.data;
  7986.         data = service.parse(message.data);
  7987.         var a = data[this.nameSpace];
  7988.       } catch (h) {
  7989.         return;
  7990.       }
  7991.       if (a && a.substring && a.substring(0, this.nameSpace.length) == this.nameSpace) {
  7992.         /** @type {number} */
  7993.         b = 0;
  7994.         for (; 3 >= b; b++) {
  7995.           var result = _.arrayIndexOf(a, this.spliter);
  7996.           if (-1 !== result) {
  7997.             parent.push(a.substring(0, result));
  7998.           } else {
  7999.             parent.push(a);
  8000.           }
  8001.           a = a.substring(result + 1);
  8002.         }
  8003.         /** @type {!Array<?>} */
  8004.         b = parent.splice(1, 3);
  8005.         if ((data = data.data) && data.type && this.handlers[data.type] && "0" === b[this.DIR_INDEX]) {
  8006.           if (!data.toCounter || data.toCounter === this.counterId) {
  8007.             try {
  8008.               message.source;
  8009.             } catch (h) {
  8010.               return;
  8011.             }
  8012.             if (data.counterId && this.checkFrame(message.source)) {
  8013.               result = this.trigger(data.type, message, data);
  8014.               message.source.postMessage(this.genMessage(result, [b[0], b[1], data.counterId]).string, "*");
  8015.             }
  8016.           }
  8017.         } else {
  8018.           if (b[this.DIR_INDEX] == this.counterId && _.isArray(data) && _.arrayEvery(data, function(options) {
  8019.             return options.counterId && options.hid;
  8020.           }) && (message = this.pending[[b[0], b[1]].join(this.spliter)])) {
  8021.             message.apply(this, data);
  8022.           }
  8023.         }
  8024.       }
  8025.     }
  8026.   });
  8027.   var result = parse();
  8028.   var offset = context.getTimezone();
  8029.   var date = context.getTimestamp();
  8030.   /** @type {!Screen} */
  8031.   var screen = window.screen;
  8032.   /** @type {number} */
  8033.   var opts = 64;
  8034.   /** @type {number} */
  8035.   var batch = $scope.isIE() ? 512 : 2048;
  8036.   /** @type {number} */
  8037.   var polymorphLimit = $scope.isIE() ? 512 : 2048;
  8038.   /** @type {number} */
  8039.   var depth = $scope.isIE() ? 100 : 400;
  8040.   /** @type {number} */
  8041.   var end = 100;
  8042.   /** @type {string} */
  8043.   var up = "noindex";
  8044.   /** @type {!RegExp} */
  8045.   var reBlockName = /\.(3gp|7z|aac|ac3|acs|ai|avi|ape|apk|asf|bmp|bz2|cab|cdr|crc32|css|csv|cue|divx|dmg|djvu?|doc(x|m|b)?|emf|eps|exe|flac?|flv|iso|swf|gif|t?gz|jpe?g?|js|m3u8?|m4a|mp(3|4|e?g?)|m4v|md5|mkv|mov|msi|ods|og(g|m|v)|psd|rar|rss|rtf|sea|sfv|sit|sha1|svg|tar|tif?f|torrent|ts|txt|vob|wave?|wma|wmv|wmf|webm|ppt(x|m|b)?|xls(x|m|b)?|pdf|phps|png|xpi|g?zip)$/i;
  8046.   /** @type {number} */
  8047.   var barStartTime = +new Date;
  8048.   var line2StartX;
  8049.   var line1StartX;
  8050.   var k = function() {
  8051.     return "1227";
  8052.   }();
  8053.   api.init().setSafe("counters", {}).setSafe("hitParam", {}).setSafe("counterNum", 0).setSafe("dataLayer", []).setSafe("hitId", _.random(1, 1073741824)).setSafe("_globalMetrikaHitId", _.random()).setSafe("v", k);
  8054.   /**
  8055.    * @param {!Object} r
  8056.    * @param {?} t
  8057.    * @param {string} c
  8058.    * @param {!Object} n
  8059.    * @return {?}
  8060.    */
  8061.   window.Ya.Metrika = function(r, t, c, n) {
  8062.     var options = this;
  8063.     return require(function() {
  8064.       /**
  8065.        * @param {!Object} opts
  8066.        * @return {?}
  8067.        */
  8068.       function check(opts) {
  8069.         /** @type {string} */
  8070.         var text = document.referrer || "";
  8071.         var i;
  8072.         var g;
  8073.         if ((new RegExp("^https?://" + result.host + "/")).test(text)) {
  8074.           return false;
  8075.         }
  8076.         var p = opts.patterns;
  8077.         /** @type {number} */
  8078.         i = 0;
  8079.         for (; i < p.length; i++) {
  8080.           /** @type {!RegExp} */
  8081.           var e = new RegExp(p[i], "i");
  8082.           if (text.match(e)) {
  8083.             if (e = opts.params || [], e.length) {
  8084.               var h = _.safeDecodeURIComponent((RegExp.$1 || "").replace(/\+/g, "%20"));
  8085.               /** @type {number} */
  8086.               g = 0;
  8087.               for (; g < e.length; g++) {
  8088.                 if (h == _.safeDecodeURIComponent(e[g])) {
  8089.                   return true;
  8090.                 }
  8091.               }
  8092.             } else {
  8093.               return true;
  8094.             }
  8095.           }
  8096.         }
  8097.         return false;
  8098.       }
  8099.       /**
  8100.        * @param {!Object} data
  8101.        * @param {boolean} dir
  8102.        * @return {?}
  8103.        */
  8104.       function walk(data, dir) {
  8105.         /** @type {boolean} */
  8106.         var x = false;
  8107.         var i;
  8108.         if (data && "string" != typeof data && data.length) {
  8109.           /** @type {number} */
  8110.           i = 0;
  8111.           for (; i < data.length; i++) {
  8112.             var n = data[i].selector;
  8113.             var txt = data[i].text;
  8114.             var key = n.charAt(0);
  8115.             n = n.slice(1);
  8116.             if ("#" == key) {
  8117.               if (key = document.getElementById(n)) {
  8118.                 /** @type {boolean} */
  8119.                 x = true;
  8120.                 if (dir) {
  8121.                   pairs.unshift([key, key.innerHTML]);
  8122.                 }
  8123.                 key.innerHTML = txt;
  8124.               }
  8125.             } else {
  8126.               if ("." == key) {
  8127.                 key = util.getElementsByClassName(n);
  8128.                 /** @type {number} */
  8129.                 n = 0;
  8130.                 for (; n < key.length; n++) {
  8131.                   /** @type {boolean} */
  8132.                   x = true;
  8133.                   var name = key[n];
  8134.                   var text = txt;
  8135.                   if (dir) {
  8136.                     pairs.unshift([name, name.innerHTML]);
  8137.                   }
  8138.                   name.innerHTML = text;
  8139.                 }
  8140.               }
  8141.             }
  8142.           }
  8143.         }
  8144.         return x;
  8145.       }
  8146.       /**
  8147.        * @return {undefined}
  8148.        */
  8149.       function handleTweets() {
  8150.         var i;
  8151.         /** @type {number} */
  8152.         i = 0;
  8153.         for (; i < pairs.length; i++) {
  8154.           pairs[i][0].innerHTML = pairs[i][1];
  8155.         }
  8156.       }
  8157.       /**
  8158.        * @param {string} s
  8159.        * @param {string} obj
  8160.        * @return {?}
  8161.        */
  8162.       function cb(s, obj) {
  8163.         var x;
  8164.         /** @type {string} */
  8165.         var line = "";
  8166.         s = s && s.replace(/^\?/, "");
  8167.         obj = obj && obj.replace(/^#/, "") || "";
  8168.         if (s) {
  8169.           var i = s.split("&");
  8170.           /** @type {number} */
  8171.           x = 0;
  8172.           for (; x < i.length; x++) {
  8173.             var gbBackgroundData = i[x].split("=");
  8174.             if ("_openstat" === gbBackgroundData[0]) {
  8175.               line = gbBackgroundData[1];
  8176.             }
  8177.           }
  8178.         }
  8179.         var serverListArray = obj.split("?");
  8180.         /** @type {number} */
  8181.         x = 0;
  8182.         for (; x < serverListArray.length; x++) {
  8183.           var sessionOperatorStrings = serverListArray[x].split("&");
  8184.           /** @type {number} */
  8185.           i = 0;
  8186.           for (; i < sessionOperatorStrings.length; i++) {
  8187.             gbBackgroundData = sessionOperatorStrings[i].split("=");
  8188.             if ("_openstat" === gbBackgroundData[0]) {
  8189.               line = gbBackgroundData[1];
  8190.             }
  8191.           }
  8192.         }
  8193.         if (line) {
  8194.           line = -1 < line.indexOf(";") ? _.safeDecodeURIComponent(line) : base64.decode(that.decode(line.replace(/[-*_]/g, function(operator) {
  8195.             return {
  8196.               "*" : "+",
  8197.               "-" : "/",
  8198.               _ : "="
  8199.             }[operator] || operator;
  8200.           })));
  8201.         }
  8202.         return line && (x = line.split(";"), 4 == x.length) ? {
  8203.           service : x[0],
  8204.           campaign : x[1],
  8205.           ad : x[2],
  8206.           source : x[3]
  8207.         } : null;
  8208.       }
  8209.       /**
  8210.        * @param {string} command
  8211.        * @param {string} text
  8212.        * @return {?}
  8213.        */
  8214.       function update(command, text) {
  8215.         /** @type {boolean} */
  8216.         var CMD_REQUIRES_CONFIG = command !== result.href;
  8217.         /** @type {string} */
  8218.         var eventName = document.referrer.replace(/\/$/, "");
  8219.         var request = (text || "").replace(/\/$/, "");
  8220.         /** @type {boolean} */
  8221.         eventName = eventName !== request;
  8222.         /** @type {number} */
  8223.         request = 0;
  8224.         if (eventName && CMD_REQUIRES_CONFIG) {
  8225.           /** @type {number} */
  8226.           request = 3;
  8227.         } else {
  8228.           if (eventName) {
  8229.             /** @type {number} */
  8230.             request = 1;
  8231.           } else {
  8232.             if (CMD_REQUIRES_CONFIG) {
  8233.               /** @type {number} */
  8234.               request = 2;
  8235.             }
  8236.           }
  8237.         }
  8238.         return request;
  8239.       }
  8240.       /**
  8241.        * @param {!Function} topic
  8242.        * @param {string} var_args
  8243.        * @return {?}
  8244.        */
  8245.       function merge(topic, var_args) {
  8246.         return require(function() {
  8247.           if (!options.isDestructing()) {
  8248.             return topic.apply(this, arguments);
  8249.           }
  8250.         }, var_args || "");
  8251.       }
  8252.       /**
  8253.        * @param {?} escapeNodeOffset
  8254.        * @return {?}
  8255.        */
  8256.       function create(escapeNodeOffset) {
  8257.         /** @type {boolean} */
  8258.         var that = false;
  8259.         if (!jointKeys) {
  8260.           config.initCookie();
  8261.           a.init(api);
  8262.         }
  8263.         config.retransmit(api);
  8264.         if (obj) {
  8265.           FACTORY.init(obj, i);
  8266.         }
  8267.         legacyLoader.init(val);
  8268.         if (api.get("hitParam")[name]) {
  8269.           if (1 != c || api.get("counters")[name]) {
  8270.             return false;
  8271.           }
  8272.           /** @type {boolean} */
  8273.           that = true;
  8274.         }
  8275.         api.get("counters")[name] = options;
  8276.         /** @type {number} */
  8277.         api.get("hitParam")[name] = 1;
  8278.         _.async(function() {
  8279.           config.initFingerPrint();
  8280.         });
  8281.         options._webvisor = data && data.webvisor || false;
  8282.         options._directCampaign = data && data.directCampaign;
  8283.         if (data && data.trackHash) {
  8284.           dispose(true);
  8285.         }
  8286.         if (!that) {
  8287.           s = new Schema({
  8288.             protocol : "https:",
  8289.             globalConfig : api,
  8290.             counterId : r,
  8291.             counterType : c,
  8292.             hid : i,
  8293.             tz : offset,
  8294.             ts : date,
  8295.             url : result.href,
  8296.             enabled : options._webvisor
  8297.           });
  8298.           options.replacePhones();
  8299.           that = new Uint8Array({
  8300.             globalConfig : api
  8301.           });
  8302.           /**
  8303.            * @param {?} cbAsync
  8304.            * @return {undefined}
  8305.            */
  8306.           var initialize = function(cbAsync) {
  8307.             var links = new Page({
  8308.               protocol : "https:",
  8309.               counterType : c,
  8310.               counterId : r,
  8311.               trackHash : length,
  8312.               hitId : i,
  8313.               webvisor : options._webvisor,
  8314.               counter : options,
  8315.               globalConfig : api,
  8316.               counterNum : Ja
  8317.             });
  8318.             var post = {
  8319.               ut : hover,
  8320.               he : data ? ~~data.httpError : 0,
  8321.               ad : 1 == c && window.Ya && window.Ya.Direct,
  8322.               pv : true,
  8323.               cpf : $scope.isChromePdf(),
  8324.               fu : update(url, key),
  8325.               saveRef : true
  8326.             };
  8327.             /** @type {number} */
  8328.             line2StartX = +new Date;
  8329.             links.sendHit({
  8330.               url : url,
  8331.               referrer : key,
  8332.               title : util.getDocumentTitle(),
  8333.               vParams : t,
  8334.               userParams : newUserAttributes,
  8335.               nohit : n,
  8336.               experiments : experiments,
  8337.               modes : post,
  8338.               visitColor : s.getVc(),
  8339.               hasPrerender : escapeNodeOffset,
  8340.               ts : date,
  8341.               tz : offset,
  8342.               callback : function(data, id) {
  8343.                 var node;
  8344.                 data = data || {};
  8345.                 if (!(node = "0" !== data.pcs)) {
  8346.                   open.initZZ();
  8347.                 }
  8348.                 if (data.eu !== undefined) {
  8349.                   api.set("isEU", data.eu);
  8350.                 }
  8351.                 methods.init(id);
  8352.                 body.match();
  8353.                 store.sync(r, c, node, api);
  8354.                 me.log("PageView. Counter ", r, ". URL: ", result.href, ". Referrer: " + document.referrer, ". Params: ", t);
  8355.                 if (!line1StartX) {
  8356.                   /** @type {number} */
  8357.                   line1StartX = +new Date;
  8358.                 }
  8359.                 if (data.webvisor) {
  8360.                   data.webvisor.isEU = api.get("isEU");
  8361.                 }
  8362.                 if (!options.isDestructing()) {
  8363.                   s.start(data.webvisor);
  8364.                   var params = data.mp2;
  8365.                   node = new Error({
  8366.                     counterId : r
  8367.                   });
  8368.                   node.erase("mp2_substs");
  8369.                   if (params) {
  8370.                     b: {
  8371.                       var s = params.conditions;
  8372.                       var i;
  8373.                       if (s && s.length) {
  8374.                         /** @type {number} */
  8375.                         i = 0;
  8376.                         for (; i < s.length; i++) {
  8377.                           var c = s[i];
  8378.                           if ("ref" == c.type) {
  8379.                             c = check(c);
  8380.                           } else {
  8381.                             if ("adv" == c.type) {
  8382.                               var p;
  8383.                               var e = c;
  8384.                               var n = window.Ya._metrika.counter._directCampaign;
  8385.                               var a = e.ServiceNamePattern;
  8386.                               var k = e.RefererPattern;
  8387.                               c = n ? e.direct_orders : e.direct_camp;
  8388.                               /** @type {string} */
  8389.                               var referrer = document.referrer;
  8390.                               var other = s.parse(result.search);
  8391.                               var context = cb(result.search, result.hash);
  8392.                               var obj = {};
  8393.                               /** @type {!Array} */
  8394.                               var key = ["source", "medium", "campaign", "term", "content"];
  8395.                               /** @type {number} */
  8396.                               p = 0;
  8397.                               for (; p < key.length; p++) {
  8398.                                 if (other["utm_" + key[p]]) {
  8399.                                   obj[key[p]] = other["utm_" + key[p]];
  8400.                                 }
  8401.                               }
  8402.                               var m = n ? "direct.yandex.ru" : context && context.service || obj.source;
  8403.                               /** @type {boolean} */
  8404.                               p = false;
  8405.                               if (!p && a && a.length) {
  8406.                                 /** @type {number} */
  8407.                                 key = 0;
  8408.                                 for (; key < a.length; key++) {
  8409.                                   if ((new RegExp(a[key], "i")).test(m)) {
  8410.                                     /** @type {boolean} */
  8411.                                     p = true;
  8412.                                     break;
  8413.                                   }
  8414.                                 }
  8415.                               }
  8416.                               if (!p && !e.yandex_direct && k && k.length) {
  8417.                                 /** @type {number} */
  8418.                                 a = 0;
  8419.                                 for (; a < k.length; a++) {
  8420.                                   if ((new RegExp(k[a], "i")).test(referrer)) {
  8421.                                     /** @type {boolean} */
  8422.                                     p = true;
  8423.                                     break;
  8424.                                   }
  8425.                                 }
  8426.                               }
  8427.                               if (!p && e.google_adwords && other.gclid) {
  8428.                                 /** @type {boolean} */
  8429.                                 p = true;
  8430.                               }
  8431.                               if (p && c && c.length && (p = false, n = n || context && context.campaign || obj && obj.campaign)) {
  8432.                                 /** @type {number} */
  8433.                                 e = 0;
  8434.                                 for (; e < c.length; e++) {
  8435.                                   if (c[e] == n) {
  8436.                                     /** @type {boolean} */
  8437.                                     p = true;
  8438.                                     break;
  8439.                                   }
  8440.                                 }
  8441.                               }
  8442.                               /** @type {boolean} */
  8443.                               c = p;
  8444.                             } else {
  8445.                               /** @type {boolean} */
  8446.                               c = false;
  8447.                             }
  8448.                           }
  8449.                           if (c) {
  8450.                             if (s[i].track_id) {
  8451.                               node.create("mp2_track", s[i].track_id, 43200);
  8452.                             }
  8453.                             break b;
  8454.                           }
  8455.                         }
  8456.                       }
  8457.                     }
  8458.                     s = node.read("mp2_track");
  8459.                     params = params.substs && params.substs[s];
  8460.                     if (s && params) {
  8461.                       node.create("mp2_substs", _.toJSON(params));
  8462.                       node = walk(params);
  8463.                       options.params("__ym", node ? "mp_trackid" : "mp_trackid_bad", s);
  8464.                     } else {
  8465.                       handleTweets();
  8466.                     }
  8467.                   } else {
  8468.                     handleTweets();
  8469.                   }
  8470.                   self.on(window, "load", options.replacePhones, options);
  8471.                 }
  8472.                 /** @type {boolean} */
  8473.                 options._inited = true;
  8474.                 if (cbAsync) {
  8475.                   cbAsync();
  8476.                 }
  8477.               }
  8478.             });
  8479.           };
  8480.           that.sync(initialize);
  8481.         }
  8482.         f(false);
  8483.         self.on(document, "click", fn);
  8484.         if (data) {
  8485.           if (data.enableAll) {
  8486.             f(true);
  8487.             init(true);
  8488.             loop();
  8489.           } else {
  8490.             if (data.clickmap) {
  8491.               init(data.clickmap);
  8492.             }
  8493.             if (data.trackLinks) {
  8494.               f(data.trackLinks);
  8495.             }
  8496.             if (data.accurateTrackBounce) {
  8497.               loop(data.accurateTrackBounce);
  8498.             }
  8499.           }
  8500.           if (data.triggerEvent) {
  8501.             _.async(function() {
  8502.               _this.dispatchCustomEvent("yacounter" + r + "inited");
  8503.             });
  8504.           }
  8505.         }
  8506.       }
  8507.       /**
  8508.        * @return {undefined}
  8509.        */
  8510.       function do_then_queue() {
  8511.         var postProcessor = new img({
  8512.           frameConnector : self,
  8513.           globalConfig : api,
  8514.           initCounter : create,
  8515.           disable : data ? data.yaDisableGDPR : false
  8516.         });
  8517.         postProcessor.handle.apply(postProcessor, arguments);
  8518.       }
  8519.       /**
  8520.        * @param {string} val
  8521.        * @return {undefined}
  8522.        */
  8523.       function f(val) {
  8524.         var snippet = {};
  8525.         switch(typeof val) {
  8526.           case "string":
  8527.             /** @type {boolean} */
  8528.             snippet.on = true;
  8529.             break;
  8530.           case "object":
  8531.             /** @type {boolean} */
  8532.             snippet.on = true;
  8533.             break;
  8534.           case "boolean":
  8535.             /** @type {string} */
  8536.             snippet.on = val;
  8537.             break;
  8538.           default:
  8539.             return;
  8540.         }
  8541.         options._trackLinks = snippet;
  8542.       }
  8543.       /**
  8544.        * @param {string} arg2
  8545.        * @return {undefined}
  8546.        */
  8547.       function fn(arg2) {
  8548.         if (options._trackLinks && options._trackLinks.on) {
  8549.           parse(arg2);
  8550.         }
  8551.       }
  8552.       /**
  8553.        * @param {string} id
  8554.        * @return {undefined}
  8555.        */
  8556.       function parse(id) {
  8557.         var data = check(id);
  8558.         var type;
  8559.         if (data) {
  8560.           /** @type {boolean} */
  8561.           id = false;
  8562.           /** @type {string} */
  8563.           var name = (type = "" + data.href) ? type.split(/\?/)[0] : "";
  8564.           /**
  8565.            * @param {string} args
  8566.            * @return {undefined}
  8567.            */
  8568.           var expand = function(args) {
  8569.             var i = getUrl(data);
  8570.             $.sendClickLink({
  8571.               url : type,
  8572.               title : type === i ? "" : i,
  8573.               modes : args
  8574.             });
  8575.           };
  8576.           if (reBlockName.test(name) || reBlockName.test(type) || filter(type, e) || filter(name, e)) {
  8577.             /** @type {boolean} */
  8578.             id = true;
  8579.           }
  8580.           var key = util.classNameExists(data, "ym-disable-tracklink");
  8581.           name = util.classNameExists(data, "ym-external-link");
  8582.           if (!key) {
  8583.             key = {
  8584.               ln : true,
  8585.               dl : id
  8586.             };
  8587.             if (name) {
  8588.               expand(key);
  8589.             } else {
  8590.               name = data.hostname || _.parseUrl(data.href).hostname || "";
  8591.               if (get(parse().hostname, name)) {
  8592.                 if (id) {
  8593.                   /** @type {boolean} */
  8594.                   key.ln = false;
  8595.                   expand(key);
  8596.                 } else {
  8597.                   if ((id = getUrl(data)) && id != type) {
  8598.                     res.set("il", _.trim(id, end));
  8599.                   }
  8600.                 }
  8601.               } else {
  8602.                 if (!(type && -1 != type.search(/^ *(data|javascript):/i))) {
  8603.                   /** @type {string} */
  8604.                   key.ut = up;
  8605.                   expand(key);
  8606.                 }
  8607.               }
  8608.             }
  8609.           }
  8610.         }
  8611.       }
  8612.       /**
  8613.        * @param {?} opts
  8614.        * @return {undefined}
  8615.        */
  8616.       function init(opts) {
  8617.         if ("undefined" === typeof opts) {
  8618.           /** @type {boolean} */
  8619.           opts = true;
  8620.         }
  8621.         if (true === opts) {
  8622.           opts = {};
  8623.         }
  8624.         if (options._clickmap) {
  8625.           options._clickmap.destroy();
  8626.         }
  8627.         if (opts) {
  8628.           options._clickmap = new KeepAlive({
  8629.             globalConfig : api,
  8630.             filter : opts.filter,
  8631.             ignoreTags : opts.ignoreTags,
  8632.             quota : opts.quota,
  8633.             isTrackHash : opts.isTrackHash,
  8634.             protocol : "https:",
  8635.             counterId : r,
  8636.             counterType : c,
  8637.             startTime : barStartTime
  8638.           });
  8639.         }
  8640.       }
  8641.       /**
  8642.        * @param {!Function} value
  8643.        * @param {number} e
  8644.        * @return {undefined}
  8645.        */
  8646.       function initialize(value, e) {
  8647.         /**
  8648.          * @return {undefined}
  8649.          */
  8650.         function sync() {
  8651.           if (!r) {
  8652.             if (key) {
  8653.               _.clearTimeout(key);
  8654.             }
  8655.             var c = s ? sinceLastPos : sinceLastPos + +new Date - begin;
  8656.             /** @type {number} */
  8657.             c = e - c;
  8658.             if (0 > c) {
  8659.               /** @type {number} */
  8660.               c = 0;
  8661.             }
  8662.             key = _.setTimeout(function() {
  8663.               /** @type {boolean} */
  8664.               r = true;
  8665.               cb(false);
  8666.               value();
  8667.             }, c, "trackUserTime");
  8668.           }
  8669.         }
  8670.         /**
  8671.          * @return {undefined}
  8672.          */
  8673.         function load() {
  8674.           if (!w) {
  8675.             /** @type {boolean} */
  8676.             h = true;
  8677.             /** @type {boolean} */
  8678.             s = false;
  8679.             /** @type {boolean} */
  8680.             w = true;
  8681.             sync();
  8682.           }
  8683.         }
  8684.         /**
  8685.          * @param {boolean} argCount
  8686.          * @return {undefined}
  8687.          */
  8688.         function cb(argCount) {
  8689.           var i;
  8690.           /** @type {number} */
  8691.           i = 0;
  8692.           for (; i < events.length; i = i + 3) {
  8693.             if (argCount) {
  8694.               self.on(events[i], events[i + 1], events[i + 2], {
  8695.                 name : "tabTrack"
  8696.               });
  8697.             } else {
  8698.               self.un(events[i], events[i + 1], events[i + 2]);
  8699.             }
  8700.           }
  8701.         }
  8702.         /** @type {boolean} */
  8703.         var h = false;
  8704.         /** @type {boolean} */
  8705.         var w = false;
  8706.         /** @type {boolean} */
  8707.         var s = true;
  8708.         /** @type {number} */
  8709.         var sinceLastPos = 0;
  8710.         /** @type {number} */
  8711.         var begin = +new Date;
  8712.         /** @type {null} */
  8713.         var key = null;
  8714.         /** @type {boolean} */
  8715.         var r = false;
  8716.         if ($scope.isIE()) {
  8717.           _.setTimeout(value, e, "trackUserTime");
  8718.         } else {
  8719.           /** @type {!Array} */
  8720.           var events = [window, "blur", function() {
  8721.             /** @type {boolean} */
  8722.             s = h = w = true;
  8723.             sinceLastPos = sinceLastPos + (+new Date - begin);
  8724.             /** @type {number} */
  8725.             begin = +new Date;
  8726.             sync();
  8727.           }, window, "focus", function() {
  8728.             if (!(h || w)) {
  8729.               /** @type {number} */
  8730.               sinceLastPos = 0;
  8731.             }
  8732.             /** @type {number} */
  8733.             begin = +new Date;
  8734.             /** @type {boolean} */
  8735.             h = w = true;
  8736.             /** @type {boolean} */
  8737.             s = false;
  8738.             sync();
  8739.           }, document, "click", load, document, "mousemove", load, document, "keydown", load, document, "scroll", load];
  8740.           cb(true);
  8741.           sync();
  8742.         }
  8743.       }
  8744.       /**
  8745.        * @param {number} error
  8746.        * @return {undefined}
  8747.        */
  8748.       function loop(error) {
  8749.         if ("number" !== typeof error) {
  8750.           /** @type {number} */
  8751.           error = 15E3;
  8752.         }
  8753.         if (!options._isAccurateTrackBounce) {
  8754.           /** @type {boolean} */
  8755.           options._isAccurateTrackBounce = true;
  8756.           var order = new Array({
  8757.             counterId : r
  8758.           });
  8759.           var length = order.get("lastHit");
  8760.           order.set("lastHit", context.getMs());
  8761.           if ((order = order.get("lastHit")) && (!length || length < order - 18E5) || !cb(document.referrer, parse().href) || .1 > Math.random()) {
  8762.             initialize(function() {
  8763.               options.notBounce();
  8764.             }, error);
  8765.           }
  8766.         }
  8767.       }
  8768.       /**
  8769.        * @param {!Function} callback
  8770.        * @return {undefined}
  8771.        */
  8772.       function defer(callback) {
  8773.         /**
  8774.          * @return {?}
  8775.          */
  8776.         var resolve = function() {
  8777.           var type = parse().hash.split("#")[1];
  8778.           if ("undefined" == typeof type) {
  8779.             return false;
  8780.           }
  8781.           var questionChar = type.indexOf("?");
  8782.           if (0 < questionChar) {
  8783.             type = type.substring(0, questionChar);
  8784.           }
  8785.           return type;
  8786.         };
  8787.         var initialLetter = resolve();
  8788.         (function fn() {
  8789.           var letterCandidate = resolve();
  8790.           if (letterCandidate !== initialLetter) {
  8791.             callback();
  8792.             initialLetter = letterCandidate;
  8793.           }
  8794.           T = _.setTimeout(fn, 200, "trackHash");
  8795.         })();
  8796.       }
  8797.       /**
  8798.        * @param {!Function} callback
  8799.        * @return {undefined}
  8800.        */
  8801.       function dispose(callback) {
  8802.         if (false === callback) {
  8803.           if (length) {
  8804.             if ("onhashchange" in window) {
  8805.               self.un(window, "hashchange", handle);
  8806.             } else {
  8807.               _.clearTimeout(T);
  8808.             }
  8809.             /** @type {boolean} */
  8810.             length = false;
  8811.           }
  8812.         } else {
  8813.           if (callback = handle, !length) {
  8814.             if ("onhashchange" in window) {
  8815.               self.on(window, "hashchange", callback);
  8816.             } else {
  8817.               defer(callback);
  8818.             }
  8819.             /** @type {boolean} */
  8820.             length = true;
  8821.           }
  8822.         }
  8823.         $.setTrackHash(length);
  8824.         /** @type {boolean} */
  8825.         options._trackHash = length;
  8826.       }
  8827.       /**
  8828.        * @return {undefined}
  8829.        */
  8830.       function handle() {
  8831.         var ns = {
  8832.           ut : hover,
  8833.           ad : 1 == c && window.Ya && window.Ya.Direct,
  8834.           wh : true,
  8835.           saveRef : true,
  8836.           pv : true
  8837.         };
  8838.         rProp = message.lastReferrer = undefined;
  8839.         $.sendAjaxHit({
  8840.           url : parse().href,
  8841.           title : util.getDocumentTitle(),
  8842.           referrer : rProp,
  8843.           modes : ns
  8844.         });
  8845.         undefined = parse().href;
  8846.       }
  8847.       /**
  8848.        * @param {string} value
  8849.        * @param {!Array} def
  8850.        * @param {!Object} args
  8851.        * @return {undefined}
  8852.        */
  8853.       function callback(value, def, args) {
  8854.         value = that.parseValidate(value, def);
  8855.         /** @type {!Array} */
  8856.         def = [];
  8857.         if (value) {
  8858.           def.push(value);
  8859.           args = args || {};
  8860.           if (_.isFunction(args.callback)) {
  8861.             def.push(args.callback);
  8862.             if (args.ctx) {
  8863.               def.push(args.ctx);
  8864.             }
  8865.           }
  8866.         }
  8867.         if (def.length) {
  8868.           options.params.apply(options, def);
  8869.         }
  8870.       }
  8871.       /** @type {string} */
  8872.       var hover = "";
  8873.       /** @type {string} */
  8874.       var rProp = "";
  8875.       var undefined = message.lastReferrer = result.href;
  8876.       /** @type {number} */
  8877.       var val = 0;
  8878.       var s;
  8879.       api.setSafe("counter", options);
  8880.       if (data) {
  8881.         require(function() {
  8882.           throw data.error;
  8883.         }, "include." + data.scope)();
  8884.       }
  8885.       if ("object" === typeof r) {
  8886.         /** @type {!Object} */
  8887.         var data = r;
  8888.         n = r.defer;
  8889.         hover = r.ut;
  8890.         c = r.type;
  8891.         t = r.params;
  8892.         var newUserAttributes = r.userParams;
  8893.         var obj = r.tns;
  8894.         var experiments = data.experiments;
  8895.         var jointKeys = data.nck;
  8896.         var url = r.url;
  8897.         var key = r.referrer;
  8898.         r = r.id;
  8899.       }
  8900.       if (!window["disableYaCounter" + r]) {
  8901.         /**
  8902.          * @param {string} code
  8903.          * @param {boolean} parameters
  8904.          * @return {?}
  8905.          */
  8906.         s.parse = function(code, parameters) {
  8907.           var params = {};
  8908.           var i;
  8909.           code = code && code.replace(/^\?/, "") || "";
  8910.           if (code.length) {
  8911.             var paramsSplit = code.split("&");
  8912.             /** @type {number} */
  8913.             i = 0;
  8914.             for (; i < paramsSplit.length; i++) {
  8915.               if (paramsSplit[i]) {
  8916.                 var v = paramsSplit[i].split("=");
  8917.                 if (v[0]) {
  8918.                   var i = _.safeDecodeURIComponent(v[0]);
  8919.                   v = _.safeDecodeURIComponent((v[1] || "").replace(/\+/g, "%20"));
  8920.                   if (parameters && i in params) {
  8921.                     if (_.isArray(params[i])) {
  8922.                       params[i].push(v);
  8923.                     } else {
  8924.                       /** @type {!Array} */
  8925.                       params[i] = [params[i], v];
  8926.                     }
  8927.                   } else {
  8928.                     params[i] = v;
  8929.                   }
  8930.                 }
  8931.               }
  8932.             }
  8933.           }
  8934.           return params;
  8935.         };
  8936.         /** @type {!Array} */
  8937.         var pairs = [];
  8938.         url = url ? url : result.href;
  8939.         key = key ? key : document.referrer;
  8940.         r = r || 0;
  8941.         if (!/^\d+$/.test(r)) {
  8942.           /** @type {number} */
  8943.           r = 0;
  8944.         }
  8945.         c = c || 0;
  8946.         /** @type {string} */
  8947.         var name = r + ":" + c;
  8948.         if (api.get("counters")[name]) {
  8949.           return api.get("counters")[name];
  8950.         }
  8951.         var i = api.get("hitId");
  8952.         var self = new ctor({
  8953.           counterId : r,
  8954.           hid : i
  8955.         });
  8956.         api.set("counterNum", api.get("counterNum") + 1);
  8957.         var Ja = api.get("counterNum");
  8958.         var $ = new Container({
  8959.           protocol : "https:",
  8960.           counterType : c,
  8961.           counterId : r,
  8962.           hitId : i,
  8963.           counter : options,
  8964.           globalConfig : api,
  8965.           counterNum : Ja
  8966.         });
  8967.         var legacyLoader = {
  8968.           init : function(k) {
  8969.             if (window.performance && "function" === typeof performance.getEntries && (k === undefined && (k = 1), !(Math.random() >= k))) {
  8970.               k = {
  8971.                 1882689622 : 1,
  8972.                 2318205080 : 1,
  8973.                 3115871109 : 1,
  8974.                 3604875100 : 1,
  8975.                 339366994 : 1,
  8976.                 2890452365 : 1,
  8977.                 849340123 : 1,
  8978.                 173872646 : 1,
  8979.                 2343947156 : 1,
  8980.                 655012937 : 1,
  8981.                 1996539654 : 1,
  8982.                 2065498185 : 1,
  8983.                 823651274 : 1,
  8984.                 12282461 : 1,
  8985.                 1555719328 : 1,
  8986.                 1417229093 : 1,
  8987.                 138396985 : 1
  8988.               };
  8989.               /** @type {!Array<PerformanceEntry>} */
  8990.               var typeSets = performance.getEntries();
  8991.               var json = {};
  8992.               var j;
  8993.               /** @type {number} */
  8994.               j = 0;
  8995.               for (; j < typeSets.length; j++) {
  8996.                 /** @type {!PerformanceEntry} */
  8997.                 var t = typeSets[j];
  8998.                 /** @type {string} */
  8999.                 var name = t.name.replace(/^https?:\/\//, "").split("?")[0];
  9000.                 var id = _.fnv32a(name);
  9001.                 if (k[id] && !json[name]) {
  9002.                   json[name] = {
  9003.                     dns : Math.round(t.domainLookupEnd - t.domainLookupStart),
  9004.                     tcp : Math.round(t.connectEnd - t.connectStart),
  9005.                     duration : Math.round(t.duration),
  9006.                     response : Math.round(t.responseEnd - t.requestStart),
  9007.                     pages : result.href
  9008.                   };
  9009.                 }
  9010.               }
  9011.               if (_.keys(json).length) {
  9012.                 (new Event).logParams({
  9013.                   timings8 : json
  9014.                 });
  9015.               }
  9016.             }
  9017.           }
  9018.         };
  9019.         /** @type {number} */
  9020.         val = 24226447 == r ? 1 : .002;
  9021.         options.replacePhones = merge(function() {
  9022.           var op;
  9023.           var val;
  9024.           try {
  9025.             if ((op = (new Error({
  9026.               counterId : r
  9027.             })).read("mp2_substs")) && (val = service.parse(op))) {
  9028.               walk(val, true);
  9029.             }
  9030.           } catch (I) {
  9031.           }
  9032.           return options;
  9033.         }, "counter.replacePhones");
  9034.         options.reachGoal = merge(function(b, timeout, throttle, tx) {
  9035.           if (2 <= arguments.length && "function" === typeof timeout) {
  9036.             /** @type {!Object} */
  9037.             tx = throttle;
  9038.             /** @type {string} */
  9039.             throttle = timeout;
  9040.             timeout = undefined;
  9041.           }
  9042.           me.log("Reach goal. Counter: " + r + ". Goal id: " + b + ". Params: ", timeout);
  9043.           $.sendGoal(b, {
  9044.             vParams : timeout,
  9045.             callback : throttle,
  9046.             ctx : tx
  9047.           });
  9048.           return options;
  9049.         }, "counter.reachGoal");
  9050.         options.trackLinks = merge(function(a) {
  9051.           f(a);
  9052.           return options;
  9053.         }, "counter.trackLinks");
  9054.         var res = new Array({
  9055.           counterId : r
  9056.         });
  9057.         options.hit = merge(function(data, item, id, event, callback, context) {
  9058.           if (data) {
  9059.             if (_.isObject(item)) {
  9060.               id = item.referer;
  9061.               event = item.params;
  9062.               callback = item.callback;
  9063.               context = item.ctx;
  9064.               item = item.title;
  9065.             }
  9066.             me.log("PageView. Counter " + r, ". URL: " + data, ". Referrer: " + id, ". Params: ", event);
  9067.             $.sendHit({
  9068.               url : data,
  9069.               title : item,
  9070.               referrer : id,
  9071.               modes : {
  9072.                 fu : update(data, id)
  9073.               },
  9074.               vParams : event,
  9075.               callback : callback,
  9076.               ctx : context
  9077.             });
  9078.           } else {
  9079.             _.warning("Empty hit url");
  9080.           }
  9081.           return options;
  9082.         }, "counter.hit");
  9083.         options.params = merge(function(b) {
  9084.           /** @type {number} */
  9085.           var l = arguments.length;
  9086.           /** @type {number} */
  9087.           var i = l;
  9088.           /** @type {!Array<?>} */
  9089.           var result = [].slice.call(arguments, 0);
  9090.           if (b) {
  9091.             if (1 < arguments.length) {
  9092.               if (_.isFunction(arguments[l - 1])) {
  9093.                 var h = arguments[l - 1];
  9094.                 /** @type {number} */
  9095.                 i = l - 1;
  9096.               } else {
  9097.                 if (_.isFunction(arguments[l - 2])) {
  9098.                   h = arguments[l - 2];
  9099.                   var k = arguments[l - 1];
  9100.                   /** @type {number} */
  9101.                   i = l - 2;
  9102.                 }
  9103.               }
  9104.               /** @type {!Array<?>} */
  9105.               result = [].slice.call(result, 0, i);
  9106.               if (1 < result.length) {
  9107.                 /** @type {!Array} */
  9108.                 result = [_.array2Props(result)];
  9109.               }
  9110.             }
  9111.             /** @type {boolean} */
  9112.             l = -1 !== _.arrayIndexOf(_.keys(result[0]), "__ymu");
  9113.             if (i = -1 !== _.arrayIndexOf(_.keys(result[0]), "__ym") && result[0].__ym.user_id) {
  9114.               me.log('Set user id "' + result[0].__ym.user_id + '"');
  9115.             } else {
  9116.               me.log((l ? "User p" : "P") + "arams. Counter " + r + ". Params: ", result[0]);
  9117.             }
  9118.             $.sendParams(result[0], h, k);
  9119.           } else {
  9120.             _.warning("Wrong params");
  9121.           }
  9122.           return options;
  9123.         }, "counter.params");
  9124.         self.addHandler("pluginInfo", function() {
  9125.           return data;
  9126.         }, this);
  9127.         self.addHandler("parentConnect", function(a, options) {
  9128.           $.paramsQueue.push({
  9129.             __ym : {
  9130.               parentIframe : {
  9131.                 counterId : options.counterId,
  9132.                 hid : options.hid
  9133.               }
  9134.             }
  9135.           });
  9136.         }, this);
  9137.         options.file = merge(function(logErrorUrl, options) {
  9138.           if (logErrorUrl) {
  9139.             options = options || {};
  9140.             $.sendFileUpload({
  9141.               url : logErrorUrl,
  9142.               title : options.title,
  9143.               vParams : options.params,
  9144.               callback : options.callback,
  9145.               ctx : options.ctx
  9146.             });
  9147.           } else {
  9148.             _.warning("Empty file url");
  9149.           }
  9150.           return options;
  9151.         }, "counter.file");
  9152.         options.extLink = merge(function(logErrorUrl, options) {
  9153.           if (logErrorUrl) {
  9154.             options = options || {};
  9155.             $.sendExtLink({
  9156.               url : logErrorUrl,
  9157.               title : options.title,
  9158.               vParams : options.params,
  9159.               callback : options.callback,
  9160.               ctx : options.ctx
  9161.             });
  9162.           } else {
  9163.             _.warning("Empty link");
  9164.           }
  9165.           return options;
  9166.         }, "counter.extLink");
  9167.         options.notBounce = merge(function(context) {
  9168.           /** @type {number} */
  9169.           var b = 0;
  9170.           context = context || {};
  9171.           if (line2StartX && line1StartX) {
  9172.             /** @type {number} */
  9173.             b = line1StartX - line2StartX;
  9174.           }
  9175.           $.sendNotBounce(b, {
  9176.             callback : context.callback,
  9177.             ctx : context.ctx
  9178.           });
  9179.           return options;
  9180.         }, "counter.notBounce");
  9181.         /** @type {!Array} */
  9182.         var e = [];
  9183.         options.addFileExtension = merge(function(s) {
  9184.           if (!s) {
  9185.             return _.warning("Empty extension"), options;
  9186.           }
  9187.           if ("string" === typeof s) {
  9188.             e.push(s);
  9189.           } else {
  9190.             e = e.concat(s);
  9191.           }
  9192.           return options;
  9193.         });
  9194.         /**
  9195.          * @param {?} mockOptions
  9196.          * @return {?}
  9197.          */
  9198.         options.clickmap = function(mockOptions) {
  9199.           init(mockOptions);
  9200.           return options;
  9201.         };
  9202.         options.accurateTrackBounce = merge(function(e) {
  9203.           loop(e);
  9204.           return options;
  9205.         });
  9206.         /** @type {null} */
  9207.         var T = null;
  9208.         /** @type {boolean} */
  9209.         var length = false;
  9210.         options.trackHash = merge(function(service) {
  9211.           dispose(service);
  9212.           return options;
  9213.         });
  9214.         var that = {
  9215.           requiredEcommerceFields : ["currency", "goods"],
  9216.           parseValidate : function(text, data) {
  9217.             var result = this.validate(text, data);
  9218.             var type;
  9219.             if (!result.isValid) {
  9220.               return console && console.log(result.message), false;
  9221.             }
  9222.             result = {};
  9223.             result[text] = {};
  9224.             if (data.currency) {
  9225.               result.currencyCode = data.currency;
  9226.             }
  9227.             if (data.goods) {
  9228.               result[text].products = data.goods;
  9229.             }
  9230.             for (type in data) {
  9231.               if (data.hasOwnProperty(type) && -1 === _.arrayIndexOf(this.requiredEcommerceFields, type)) {
  9232.                 if (!result[text].actionField) {
  9233.                   result[text].actionField = {};
  9234.                 }
  9235.                 result[text].actionField[type] = data[type];
  9236.               }
  9237.             }
  9238.             return {
  9239.               __ym : {
  9240.                 ecommerce : [result]
  9241.               }
  9242.             };
  9243.           },
  9244.           validate : function(type, data) {
  9245.             /** @type {boolean} */
  9246.             var isValid = false;
  9247.             /** @type {string} */
  9248.             var messagestring = "";
  9249.             if (_.isObject(data)) {
  9250.               switch(type) {
  9251.                 case "detail":
  9252.                 case "add":
  9253.                 case "remove":
  9254.                   if (_.isArray(data.goods) && data.goods.length) {
  9255.                     if (!(isValid = _.arrayEvery(data.goods, function(a) {
  9256.                       return _.isObject(a) && (_.isString(a.id) || _.isNumber(a.id) || _.isString(a.name) || _.isString(a.name));
  9257.                     }))) {
  9258.                       /** @type {string} */
  9259.                       messagestring = "All items in 'goods' should be objects and contain 'id' or 'name' field";
  9260.                     }
  9261.                   } else {
  9262.                     /** @type {string} */
  9263.                     messagestring = "Ecommerce data should contain 'goods' non-empty array";
  9264.                   }
  9265.                   break;
  9266.                 case "purchase":
  9267.                   if (_.isNumber(data.id) || _.isString(data.id)) {
  9268.                     /** @type {boolean} */
  9269.                     isValid = true;
  9270.                   } else {
  9271.                     /** @type {string} */
  9272.                     messagestring = "Purchase object should contain string or number 'id' field";
  9273.                   }
  9274.               }
  9275.             } else {
  9276.               /** @type {string} */
  9277.               messagestring = "Ecommerce data should be an object";
  9278.             }
  9279.             return {
  9280.               isValid : isValid,
  9281.               message : messagestring
  9282.             };
  9283.           }
  9284.         };
  9285.         options.ecommerceDetail = merge(function(x1, b) {
  9286.           callback("detail", x1, b);
  9287.           return options;
  9288.         }, "ecommerce.detail");
  9289.         options.ecommerceAdd = merge(function(x1, b) {
  9290.           callback("add", x1, b);
  9291.           return options;
  9292.         }, "ecommerce.add");
  9293.         options.ecommerceRemove = merge(function(x1, b) {
  9294.           callback("remove", x1, b);
  9295.           return options;
  9296.         }, "ecommerce.remove");
  9297.         options.ecommercePurchase = merge(function(x1, b) {
  9298.           callback("purchase", x1, b);
  9299.           return options;
  9300.         }, "ecommerce.purchase");
  9301.         options.userParams = merge(function(a, errorType, close) {
  9302.           if (_.isObject(a)) {
  9303.             options.params({
  9304.               __ymu : a
  9305.             }, errorType || function() {
  9306.             }, close);
  9307.           } else {
  9308.             _.warning("Wrong user params");
  9309.           }
  9310.           return options;
  9311.         }, "uparams");
  9312.         options.experiments = merge(function(a, extCallBack, tx) {
  9313.           $.sendExperiments({
  9314.             callback : extCallBack,
  9315.             ctx : tx,
  9316.             experiments : a
  9317.           });
  9318.           return options;
  9319.         }, "exps");
  9320.         options.id = options.setUserID = merge(function(id, errorType, close) {
  9321.           if (_.isString(id) || _.isNumber(id)) {
  9322.             options.params({
  9323.               __ym : {
  9324.                 user_id : id
  9325.               }
  9326.             }, errorType || function() {
  9327.             }, close);
  9328.           } else {
  9329.             _.warning("Incorrect user ID");
  9330.           }
  9331.           return options;
  9332.         }, "id");
  9333.         var validator = new Error;
  9334.         options.getClientID = merge(function() {
  9335.           return validator.read("uid");
  9336.         }, "guid");
  9337.         /**
  9338.          * @return {?}
  9339.          */
  9340.         options.enableAll = function() {
  9341.           f(true);
  9342.           init(true);
  9343.           loop();
  9344.           return options;
  9345.         };
  9346.         /**
  9347.          * @return {undefined}
  9348.          */
  9349.         options.uploadPage = function() {
  9350.         };
  9351.         options.destruct = merge(function() {
  9352.           /** @type {boolean} */
  9353.           options._isDestructing = true;
  9354.           self.un(document, "click", fn);
  9355.           self.un(window, "load", options.replacePhones, options);
  9356.           dispose(false);
  9357.           if (s) {
  9358.             s.stop();
  9359.           }
  9360.           api.set("stopRecoder", undefined);
  9361.           api.set("counter", undefined);
  9362.           init(false);
  9363.           try {
  9364.             delete window["yaCounter" + r];
  9365.             delete api.get("counters")[name];
  9366.             delete api.get("hitParam")[name];
  9367.           } catch (w) {
  9368.           }
  9369.         });
  9370.         /**
  9371.          * @return {?}
  9372.          */
  9373.         options.isDestructing = function() {
  9374.           return !!options._isDestructing;
  9375.         };
  9376.         atap.init($);
  9377.         /** @type {function(): ?} */
  9378.         options._performanceTiming = getPerformaceInfo;
  9379.         if (r) {
  9380.           if (new w({
  9381.             counter : options,
  9382.             counterId : r,
  9383.             globalConfig : api,
  9384.             frameConnector : self,
  9385.             prefsEcommerce : data && data.ecommerce,
  9386.             prefsUseDataLayer : data && data.useDataLayer
  9387.           }), "prerender" === document.webkitVisibilityState) {
  9388.             $.sendPrerenderHit({
  9389.               url : result.href,
  9390.               title : util.getDocumentTitle(),
  9391.               referrer : document.referrer
  9392.             });
  9393.             /**
  9394.              * @return {undefined}
  9395.              */
  9396.             var fn = function() {
  9397.               if ("prerender" !== document.webkitVisibilityState) {
  9398.                 self.un(document, "webkitvisibilitychange", fn);
  9399.                 do_then_queue(true);
  9400.               }
  9401.             };
  9402.             self.on(document, "webkitvisibilitychange", fn);
  9403.           } else {
  9404.             do_then_queue(false);
  9405.           }
  9406.         }
  9407.       }
  9408.     }, "init")();
  9409.   };
  9410.   new Embassy({
  9411.     globalConfig : api
  9412.   });
  9413.   /**
  9414.    * @return {?}
  9415.    */
  9416.   window.Ya.Metrika.counters = function() {
  9417.     /** @type {!Array} */
  9418.     var linkages = [];
  9419.     _.forEachKey(api.get("counters"), function(clusterShardData, actionParams) {
  9420.       var d = clusterShardData.split(":");
  9421.       linkages.push({
  9422.         id : +d[0],
  9423.         type : +d[1],
  9424.         accurateTrackBounce : actionParams._isAccurateTrackBounce,
  9425.         clickmap : actionParams._clickmap && actionParams._clickmap._start,
  9426.         oldCode : !!window.ya_cid,
  9427.         trackHash : !!actionParams._trackHash,
  9428.         trackLinks : actionParams._trackLinks && actionParams._trackLinks.on,
  9429.         webvisor : !!actionParams._webvisor
  9430.       });
  9431.     });
  9432.     return linkages;
  9433.   };
  9434.   api.setSafe("getCounters", function() {
  9435.     /** @type {!Array} */
  9436.     var linkages = [];
  9437.     _.forEachKey(api.get("counters"), function(clusterShardData, actionParams) {
  9438.       var d = clusterShardData.split(":");
  9439.       linkages.push({
  9440.         id : +d[0],
  9441.         type : +d[1],
  9442.         accurateTrackBounce : actionParams._isAccurateTrackBounce,
  9443.         clickmap : actionParams._clickmap && actionParams._clickmap._start,
  9444.         oldCode : !!window.ya_cid,
  9445.         trackHash : !!actionParams._trackHash,
  9446.         trackLinks : actionParams._trackLinks && actionParams._trackLinks.on,
  9447.         webvisor : !!actionParams._webvisor
  9448.       });
  9449.     });
  9450.     return linkages;
  9451.   });
  9452.   if (window.ya_cid && window.Ya.Metrika) {
  9453.     new window.Ya.Metrika(window.ya_cid, window.ya_params, window.ya_class);
  9454.   }
  9455.   if (window.ya_cid && !window.ya_hit) {
  9456.     /**
  9457.      * @param {?} a
  9458.      * @param {?} b
  9459.      * @return {undefined}
  9460.      */
  9461.     window.ya_hit = function(a, b) {
  9462.       if (window.Ya._metrika.counter) {
  9463.         window.Ya._metrika.counter.reachGoal(a, b);
  9464.       }
  9465.     };
  9466.   }
  9467.   (function() {
  9468.     /**
  9469.      * @param {string} module
  9470.      * @return {undefined}
  9471.      */
  9472.     function testAccessUnreadableDirectory(module) {
  9473.       try {
  9474.         delete window[module];
  9475.       } catch (t) {
  9476.         window[module] = undefined;
  9477.       }
  9478.     }
  9479.     var i = window.yandex_metrika_callback;
  9480.     var options = window.yandex_metrika_callbacks;
  9481.     var xhr;
  9482.     if ("function" == typeof i) {
  9483.       i();
  9484.     }
  9485.     if ("object" == typeof options) {
  9486.       /** @type {number} */
  9487.       i = 0;
  9488.       for (; i < options.length; i++) {
  9489.         if (xhr = options[i]) {
  9490.           /** @type {null} */
  9491.           options[i] = null;
  9492.           xhr();
  9493.         }
  9494.       }
  9495.     }
  9496.     testAccessUnreadableDirectory("yandex_metrika_callback");
  9497.     testAccessUnreadableDirectory("yandex_metrika_callbacks");
  9498.   })();
  9499.   /**
  9500.    * @param {!Object} partKeys
  9501.    * @return {undefined}
  9502.    */
  9503.   window.Ya.Metrika.informer = function(partKeys) {
  9504.     /** @type {boolean} */
  9505.     var b = !!window.Ya.Metrika._informer;
  9506.     /** @type {!Object} */
  9507.     Ya.Metrika._informer = partKeys;
  9508.     /** @type {string} */
  9509.     Ya.Metrika._informer.domain = "informer.yandex.ru";
  9510.     if (!b) {
  9511.       util.loadScript({
  9512.         src : "https://informer.yandex.ru/metrika/informer.js"
  9513.       });
  9514.     }
  9515.   };
  9516.   self.on(document, "click", require(function(e) {
  9517.     var target = _this.getTarget(e);
  9518.     if (target && "ym-advanced-informer" === target.className) {
  9519.       var lang = target.getAttribute("data-lang");
  9520.       var id = target.getAttribute("data-cid");
  9521.       window.Ya.Metrika.informer({
  9522.         i : target,
  9523.         id : +id,
  9524.         lang : lang
  9525.       });
  9526.       _this.prevent(e);
  9527.     }
  9528.   }, "adv-inf"), null, {
  9529.     passive : false
  9530.   });
  9531. })(this, this.document);
Add Comment
Please, Sign In to add comment