{"version":3,"sources":["../../../../dev/j/v2/pages/index.js"],"names":["securityInViewport","waypoints","$worldSecurity","isWorldSecurityInViewport","$window","off","addClass","counterAnimation","bAnimate","timeout","setTimeout","$","each","updateTimer","currentNum","countUp","$this","text","toFixed","numDecPlaces","sTrail","incr","this","numText","replace","fstChar","match","substr","index","numVal","indexOf","toString","split","length","parseFloat","clearTimeout","counting","counterAnimationTriggered","avm","require","avastGlobals","detect","browser","window","on","web","language","locale","os","isWindows","isChrome","buttons","document","querySelectorAll","i","button","downloadID","getAttribute","setAttribute"],"mappings":"CAAA,WACC,YAaA,SAASA,KACJC,EAAUC,EAAgB,OACzBC,EACHC,EAAQC,IAAI,SAAUL,IAEtBG,GAA4B,EAC5BD,EAAeI,SAAS,aAY1B,QAASC,KACR,GAAIC,IAAW,EAEXC,EAAUC,WAAW,WACxBC,EAAE,YAAYC,KAAK,WAqBjB,QAASC,GAAYC,GAChBA,GAAcC,GAAWP,GAC5BQ,EAAMC,KAAKH,EAAWI,QAAQC,GAAgBC,GAC9CN,GAAcO,EACdX,WAAWG,EAAa,IAAKC,IACnBA,EAAaC,GACvBC,EAAMC,KAAKF,EAAUK,GAzBxB,GACIA,GAAS,GACTJ,EAAQL,EAAEW,MACVC,EAAUP,EAAMC,MAEpBM,GAAUA,EAAQC,QAAQ,IAAK,IAC/B,IAAIC,GAAUF,EAAQG,MAAM,SAM5B,IALe,MAAXD,IACHL,EAASG,EAAQI,OAAOF,EAAQG,QAIJ,MAAzBR,EAAOM,MAAM,SAAkB,CAClC,GAAIG,GAASN,EAAQC,QAAQ,UAAW,IACpCL,EAAeU,EAAOC,QAAQ,MAAQ,EAAID,EAAOE,WAAWC,MAAM,KAAK,GAAGC,OAAS,EAEnFlB,EAAUmB,WAAWL,GACrBR,EAAON,EAAU,EAYjBA,GAAU,GACbF,EAAY,OAGbL,IAAW,IAGb2B,aAAa1B,IACX,KAKJ,QAAS2B,KACJnC,EAAUC,EAAgB,KAAoC,IAA9BmC,IACnCA,GAA4B,EAC5B9B,KAjFH,GAAII,GAAI2B,IAAIC,QAAQ,QAEnBtC,GADUuC,aAAaC,OAAOC,QAClBJ,IAAIC,QAAQ,wBACxBnC,EAAUO,EAAEgC,QACZzC,EAAiBS,EAAE,sBACnBR,GAA4B,EAC5BkC,GAA4B,CAK7BjC,GAAQwC,GAAG,SAAU5C,GAkBc,OAA9BwC,aAAaK,IAAIC,UAgDrB1C,EAAQwC,GAAG,SAAUR,MAevB,WACC,YACA,IAAIM,GAAUF,aAAaC,OAAOC,OAGnC,KAAgC,UAA5BF,aAAaK,IAAIE,QAAkD,UAA5BP,aAAaK,IAAIE,QAAkD,UAA5BP,aAAaK,IAAIE,UAGhGP,aAAaC,OAAOO,GAAGC,YAAeP,EAAQQ,UAAaV,aAAaC,OAAOO,GAAGC,WAAcP,EAAe,SAIjH,IAAK,GAFDS,GAAUC,SAASC,iBAAiB,mDAE/BC,EAAI,EAAGA,EAAIH,EAAQlB,OAAQqB,IAAK,CACxC,GAAIC,GAASJ,EAAQG,GACpBE,EAAaD,EAAOE,aAAa,qBAElCF,GAAOG,aAAa,OAAQH,EAAOE,aAAa,QAAQjC,QAAQgC,EAAYA,EAAa,mBACzFD,EAAOG,aAAa,wBAAyBF,EAAa,kBAC1DD,EAAOG,aAAa,qBAAsBF,EAAa","file":"index.js","sourcesContent":["(function() {\n\t'use strict';\n\tvar $ = avm.require('cash'),\n\t\tbrowser = avastGlobals.detect.browser,\n\t\twaypoints = avm.require('avast.web.waypoints'),\n\t\t$window = $(window),\n\t\t$worldSecurity = $('.js-world-security'),\n\t\tisWorldSecurityInViewport = false,\n\t\tcounterAnimationTriggered = false;\n\n\t/**\n\t* securityInViewport - Animate security on scroll\n\t*/\n\t$window.on('scroll', securityInViewport);\n\tfunction securityInViewport() {\n\t\tif (waypoints($worldSecurity, 200)) {\n\t\t\tif (isWorldSecurityInViewport) {\n\t\t\t\t$window.off('scroll', securityInViewport);\n\t\t\t} else {\n\t\t\t\tisWorldSecurityInViewport = true;\n\t\t\t\t$worldSecurity.addClass('animate');\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Should be a fix for the previous counter animation (causing issues for asisan languages + RTL languages that needed specific fix texts)\n\t *\n\t * counterAnimation - Animate number of ....\n\t * Assumption is that the number may contain unit (such as B -billion or M -million - or even written out = such as 'Mld.' etc.) - and it is placed right of the number - such as XXB or XX Mld.\n\t */\n\t if (avastGlobals.web.language === 'en') {\n\t\tfunction counterAnimation() {\n\t\t\tvar bAnimate = true;\t// global flag - if at least one counter is not \"animable\" -> do not animate anything\n\n\t\t\tvar timeout = setTimeout(function() {\n\t\t\t\t$('.js-info').each(function() {\n\n\t\t\t\t\tvar timeAnim = 3;\t// overall time of animation in sec, the tick is always set for 0,1 sec\n\t\t\t\t\tvar sTrail = '';\t// contains trailing chars behind number\n\t\t\t\t\tvar $this = $(this);\n\t\t\t\t\tvar numText = $this.text();\n\n\t\t\t\t\tnumText = numText.replace(',', '.');\n\t\t\t\t\tvar fstChar = numText.match(/[^\\d.]/);\n\t\t\t\t\tif (fstChar != null) {\n\t\t\t\t\t\tsTrail = numText.substr(fstChar.index);\n\t\t\t\t\t}\n\n\t\t\t\t\t// asian langs have digits mixed w/ symbols -> do not animate!\n\t\t\t\t\tif (sTrail.match(/[\\d]/g) == null) {\n\t\t\t\t\t\tvar numVal = numText.replace(/[^\\d.]/g, '');\n\t\t\t\t\t\tvar numDecPlaces = numVal.indexOf('.') > -1 ? numVal.toString().split('.')[1].length : 0;\n\n\t\t\t\t\t\tvar countUp = parseFloat(numVal);\n\t\t\t\t\t\tvar incr = countUp / (10 * timeAnim);\n\n\t\t\t\t\t\tfunction updateTimer(currentNum) {\n\t\t\t\t\t\t\tif (currentNum <= countUp && bAnimate) {\n\t\t\t\t\t\t\t\t$this.text(currentNum.toFixed(numDecPlaces) + sTrail);\n\t\t\t\t\t\t\t\tcurrentNum += incr;\n\t\t\t\t\t\t\t\tsetTimeout(updateTimer, 100, currentNum);\n\t\t\t\t\t\t\t} else if (currentNum > countUp) {\n\t\t\t\t\t\t\t\t$this.text(countUp + sTrail);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (countUp > 0) {\n\t\t\t\t\t\t\tupdateTimer(0);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tbAnimate = false;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tclearTimeout(timeout);\n\t\t\t}, 500);\n\t\t}\n\n\t\t// run animation when appears in viewport\n\t\t$window.on('scroll', counting);\n\t\tfunction counting() {\n\t\t\tif (waypoints($worldSecurity, 0) && counterAnimationTriggered === false) {\n\t\t\t\tcounterAnimationTriggered = true;\n\t\t\t\tcounterAnimation();\n\t\t\t}\n\t\t}\n\t}\n})();\n\n// GLOWEB-6037\n/*\nCode for CONTROL version for Akamai AB test GLOWEB-5887\n*/\n\n(function() {\n\t'use strict';\n\tvar browser = avastGlobals.detect.browser;\n\n\nif (avastGlobals.web.locale === 'it-it' || avastGlobals.web.locale === 'pt-br' || avastGlobals.web.locale === 'es-es') {\n\n// apply only for Windows paltform\nif(avastGlobals.detect.os.isWindows && (!browser.isChrome) || avastGlobals.detect.os.isWindows && (browser.isOpera)) {\n\n\tvar buttons = document.querySelectorAll('[data-platform=\"pc\"][data-role=\"download-link\"]');\n\n\tfor (var i = 0; i < buttons.length; i++) {\n\t\tvar button = buttons[i],\n\t\t\tdownloadID = button.getAttribute('data-download-name');\n\n\t\tbutton.setAttribute('href', button.getAttribute('href').replace(downloadID, downloadID + '-GLOWEB-5887-0'));\n\t\tbutton.setAttribute('data-bi-download-name', downloadID + '-GLOWEB-5887-0');\n\t\tbutton.setAttribute('data-download-name', downloadID + '-GLOWEB-5887-0');\n\n\t}\n}\n}\n\n})();\n// /GLOWEB-6037\n"]}