{"version":3,"file":"default/js/dna.js","sources":["webpack:///webpack/bootstrap","webpack:///./cartridges/app_ua_core/cartridge/client/default/js/dna.js"],"sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./cartridges/app_ua_core/cartridge/client/default/js/dna.js\");\n","'use strict';\n\n$(document).ready(function () {\n var $cache = {\n dnaPrevious: '',\n dnaNext: '',\n stickyNavTop: '',\n stickyDateTop: '',\n kp1994: '',\n date1996: '',\n date2002: '',\n date2011: '',\n mobAdj: '',\n navOffset: 35\n };\n\n /**\n * to clear the results\n * @param {number} fl - scrolled to this position\n * */\n function setDNAdata(fl) {\n var dt = 5;\n if (window.matchMedia('(min-width: 768px)').matches) {\n // desktop\n $cache.stickyNavTop = Math.round(($('.dna-kp').offset().top + $('.dna-kp').height()) - 55);\n $cache.mobAdj = -6;\n } else {\n // mobile\n $cache.stickyNavTop = Math.round(($('.dna-kp').offset().top + $('.dna-kp').height()) - 35);\n $cache.mobAdj = -27;\n dt += 20;\n }\n $cache.stickyDateTop = Math.round($('.dna-kp').offset().top + $('.dna-kp').height() + $('.dna-first-date').offset().top);\n // sets the top values for the decade navigation:\n $cache.kp1994 = Math.round($('.dna-kp').offset().top - 152);\n $cache.date1996 = Math.round($('.dna-1996').offset().top - 152);\n $cache.date2002 = Math.round($('.dna-2002').offset().top - 152);\n $cache.date2011 = Math.round($('.dna-2011').offset().top - 152);\n if ($('.dna-2018').length > 0) {\n $cache.date2018 = Math.round($('.dna-2018').offset().top - 152);\n }\n if ($('.dna-future').length > 0) {\n $cache.dateFuture = Math.round($('.dna-future').offset().top - 152);\n }\n $cache.dnaNext = $cache.stickyDateTop;\n\n // sets distance-to-top value to the data attribute for each year\n $('section, .dna-subsection').each(function () {\n var $this = $(this);\n $this.attr('data-top', Math.round(($this.offset().top - 152) + dt));\n });\n\n // sets distance-to-top value to data attribute\n $('.LiveclickerVideoDiv-dna').each(function () {\n var $this = $(this);\n $this.attr('data-top', Math.round($this.offset().top) - 1200);\n });\n\n /**\n * scroll top\n * @param {number} scrollTop - scrolled to this position\n * */\n function grayOut(scrollTop) {\n if (scrollTop <= $cache.date2002) {\n $('.next').removeClass('grayOut');\n $('.prev').addClass('grayOut');\n } else if (scrollTop >= $cache.dateFuture || scrollTop >= $cache.date2018) {\n // $('.dna-nav-buts').addClass('navfut');\n $('.next').addClass('grayOut');\n $('.prev').removeClass('grayOut');\n } else {\n $('.prev').removeClass('grayOut');\n $('.next').removeClass('grayOut');\n // $('.dna-nav-buts').removeClass('navfut');\n }\n }\n\n /**\n * sticky nav for the bottom section\n * */\n function stickyNav() {\n var scrollTop = $(window).scrollTop();\n var $navDiv = $('.dna-nav .navs');\n if (scrollTop + $cache.navOffset > $cache.stickyNavTop) {\n $('.dna-nav').addClass('dna-menu-sticky');\n $('.dna-kp').css('marginBottom', 53);\n } else {\n $('.dna-nav').removeClass('dna-menu-sticky');\n $('.dna-kp').css('marginBottom', 0);\n }\n\n if (scrollTop + $cache.navOffset > $cache.stickyDateTop) {\n $('.dna-first-date').addClass('date-sticky');\n } else {\n $('.dna-first-date').removeClass('date-sticky');\n }\n\n if (scrollTop > $cache.date1996) {\n $navDiv.removeClass('dna-hot-decade');\n $navDiv.eq(0).addClass('dna-hot-decade');\n }\n\n if (scrollTop > $cache.date2002) {\n $navDiv.removeClass('dna-hot-decade');\n $navDiv.eq(1).addClass('dna-hot-decade');\n }\n\n if (scrollTop > $cache.date2011 - 5) {\n $navDiv.removeClass('dna-hot-decade');\n $navDiv.eq(2).addClass('dna-hot-decade');\n }\n\n if (scrollTop > $cache.dateFuture) {\n $navDiv.removeClass('dna-hot-decade');\n $navDiv.eq(3).addClass('dna-hot-decade');\n }\n\n if (scrollTop > $cache.date1996) {\n $('.dna-nav-buts').css('display', 'block');\n } else {\n $('.dna-nav-buts').css('display', 'none');\n }\n\n if (scrollTop > $cache.date2018 || scrollTop > $cache.dateFuture) {\n var dnaBtnsCorectPos2018 = 175;\n var dnaBtnsCorectPos = 170;\n var top;\n if (window.matchMedia('(max-width: 767px)').matches) {\n dnaBtnsCorectPos2018 = 220;\n dnaBtnsCorectPos = 220;\n } else if (window.matchMedia('(max-width: 1024px)').matches) {\n dnaBtnsCorectPos2018 = 245;\n }\n\n if ($cache.date2018 > 0) {\n top = $cache.date2018 + dnaBtnsCorectPos2018 + 'px';\n } else {\n top = $cache.dateFuture + dnaBtnsCorectPos + 'px';\n }\n\n $('.dna-nav-buts').css({\n 'position': 'absolute',// eslint-disable-line\n 'top': top// eslint-disable-line\n });\n\n $('.dna-date').addClass('dna-date--stop_scroll date-sticky--last');\n $('.dna-nav-buts').removeClass('dna-nav-buts--position_scrolling');\n } else {\n $('.dna-nav-buts').addClass('dna-nav-buts--position_scrolling');\n $('.dna-date').removeClass('dna-date--stop_scroll date-sticky--last');\n }\n\n $('.DNA section, .dna-subsection').each(function (i) {\n var $this = $(this);\n if (scrollTop + $cache.navOffset > $this.attr('data-top')) {\n $this.find('.dna-date').addClass('date-sticky');\n $this.prev().find('.dna-first-date, .dna-date').css('display', 'none');\n $cache.dnaPrevious = Number($('.DNA section, .dna-subsection').eq(i - 1).attr('data-top')) - $cache.mobAdj;\n $cache.dnaNext = Number($('.DNA section, .dna-subsection').eq(i + 1).attr('data-top')) - $cache.mobAdj;\n } else {\n $this.find('.dna-date').removeClass('date-sticky');\n $this.prev().find('.dna-first-date, .dna-date').css('display', 'block');\n }\n });\n\n grayOut(scrollTop);\n }\n\n $(window).scroll(function () {\n stickyNav();\n });\n\n /**\n * jumps to the date section defined in the query string\n * */\n function goParam() {\n if (window.location.search) {\n var x = 0;\n if (window.matchMedia('(max-width: 767px)').matches) {\n x = 20;\n }\n // var scrollTop = $(window).scrollTop();\n var scrollTarget = window.location.search.toString().replace(/\\?/, '');\n $('section').each(function () {\n var $this = $(this);\n if ($this.find('.dna-date').html() === scrollTarget) {\n var added = Number($this.attr('data-top')) + Number(x);\n $('html, body').animate({\n scrollTop: added\n }, 500);\n }\n });\n }\n }\n\n /**\n * Load DNA video\n * @param {number} me - scrolled to this position\n * */\n /* function loadDNAvideo(me) {\n if (me.attr('data-loaded') !== 'true') {\n lc.settings = { account_id: 387 };\n var playerInstance;\n var idArr;\n var wid;\n var pid;\n var wwidth;\n wwidth = $(window).width();\n playerInstance = me.attr('id');\n idArr = me.attr('data-video').split(',');\n wid = idArr[0];\n pid = idArr[1];\n lc({ widget_id: wid }).isReady(function () {\n lc(this).getByIndex(0).getPlayer({ player_id: pid, 'width': wwidth, 'height': $(window).width() / 1.776 }).appendPlayerTo({ 'id': playerInstance });\n });\n\n me.attr('data-loaded', 'true');\n me.parent().siblings('.dna-overlay').attr('id', 'overlay' + idArr[0]);\n }\n } */\n\n // detects the date in the query string\n if (fl === true && window.location.search) {\n setTimeout(function () {\n goParam();\n }, 500);\n }\n\n stickyNav();\n\n if (window.matchMedia('(max-width: 767px)').matches) {\n $('.dna-overlay').removeAttr('style');\n }\n\n /* $('.LiveclickerVideoDiv-dna').each(function () {\n var $this = $(this);\n loadDNAvideo($this);\n }); */\n }\n\n /**\n * detect video play\n * */\n /* function detectVideoPlay() {\n if (window.matchMedia('(min-width: 767px)').matches) {\n try {\n players = getLCPlayers();\n for (var i = 0; i < players.length; i++) {\n var player = players[i];\n var $vid;\n var settings = player.getSettings();\n\n if ($('#overlay' + player.iframeDiv).length > 0) {\n $vid = $('#overlay' + player.iframeDiv.toString().replace(/video_/, ''));\n } else if ($('#overlay' + settings.widgetId).length > 0) {\n $vid = $('#overlay' + settings.widgetId);\n } else {\n $vid = $('#overlay' + settings.id);\n }\n\n if ($('video').length > 0 && $('video').css('margin-top') !== '40px' && navigator.userAgent.indexOf('android') === -1) {\n $('video').css('margin-top', '40px');\n }\n\n if (player.getSettings().playerState === 'PLAYING') {\n if ($vid.attr('data-vis') === '1') {\n $vid.attr('data-vis', '0');\n $vid.animate({\n opacity: 0,\n top: '+=1.5%'\n }, 200);\n }\n } else {\n if ($vid.attr('data-vis') === '0') { // eslint-disable-line\n $vid.attr('data-vis', '1');\n $vid.animate({\n opacity: 1,\n top: '-=1.5%'\n }, 200);\n }\n }\n }\n } catch (e) {\n console.log(e);\n }\n }\n } */\n\n /**\n * stop all the videos\n * */\n /* function stopAllVideos() {\n var players = getLCPlayers();\n for (var i = 0; i < players.length; i++) {\n var player = players[i];\n player.sendEvent('pause');\n }\n } */\n\n $(document).on('click touchstart', '.dna-nav-buts .next, .dna-nav-buts .prev', function () {\n var $this = $(this);\n // var toTop = $(window).scrollTop();\n var scrollTo;\n if ($this.hasClass('next') && $this.hasClass('grayOut') === false) {\n scrollTo = $cache.dnaNext;\n } else if ($this.hasClass('prev') && $this.hasClass('grayOut') === false) {\n scrollTo = $cache.dnaPrevious;\n }\n\n $('html, body').animate({\n scrollTop: scrollTo\n }, 500);\n\n // stopAllVideos();\n });\n\n $(document).on('click touchstart', '.dna-nav .navs', function () {\n var $this = $(this);\n $('.dna-' + $this.attr('data-decade')).find('.dna-date').css('marginLeft', 150).css('opacity', 0);\n $('html, body').animate({\n scrollTop: $('.dna-' + $this.attr('data-decade')).offset().top - 130 - $cache.mobAdj\n }, 500, function () {\n $('.dna-' + $this.attr('data-decade')).find('.dna-date').animate({\n marginLeft: 0,\n opacity: 1\n }, 300);\n });\n\n // stopAllVideos();\n\n $('.dna-nav .navs').removeClass('dna-hot-decade');\n $this.addClass('dna-hot-decade');\n });\n\n /**\n * loading players\n * @param {number} player - scrolled to this position\n var players = new Array();\n function onLCPlayerLoaded(player) {\n players.push(player);\n }\n\n setTimeout(function () {\n var intrv = window.setInterval(function () {\n detectVideoPlay();\n }, 500);\n }, 1000); * */\n\n $(document).on('click touch', '.scroll-icon, .dna-1 .t4', function () {\n $('html, body').animate({\n scrollTop: $(this).offset().top - 35\n }, 500);\n });\n\n /**\n * debounce method\n * @param {number} func - call back function\n * @param {number} timeout - timeout value\n * @returns {number} - a JSON object with all values\n * */\n function debouncer(func, timeout) {\n var timeoutID, timeout = timeout || 200; // eslint-disable-line\n return function () {\n var scope = this;\n var args = arguments;\n clearTimeout(timeoutID);\n timeoutID = setTimeout(function () {\n func.apply(scope, Array.prototype.slice.call(args));\n }, timeout);\n };\n }\n\n $(window).resize(debouncer(function () {\n setDNAdata();\n }));\n\n setTimeout(function () {\n setDNAdata(true);\n }, 1000);\n\n /* var DNATimer = window.setInterval(function () {\n setDNAdata();\n }, 5000); */\n});\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AClFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AAAA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;A","sourceRoot":""}