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CT,GACDpD,EAAE,cAAcoI,QAAQ,CACpBC,UAAWtG,GACZ,IAEX,IAEI7B,EAAU+J,aACVjH,EAAsBa,GAAG,SAAS,SAAUqG,GACxC,GAAIhK,EAAUiK,GAAGrH,GAAW,CACxB,IACIsH,EADUpK,EAAEkK,EAAMrC,eACJmC,SAElBE,EAAMnC,iBACNmC,EAAMG,kBAEDD,EAAI/I,SAAS0B,GAKdE,EAAiBqB,YAAYvB,IAJ7BE,EAAiBqB,YAAYvB,GAC7BqH,EAAIlG,SAASnB,GAKrB,CACJ,IAGAE,EAAiBqH,YAAY,CACzBC,KAAM,SAAUL,GACRhK,EAAUiK,GAAGrH,KACbG,EAAiBqB,YAAYvB,GAC7ByH,QAAQtG,SAASnB,GAEzB,EACA0H,IAAK,SAAUP,GACPhK,EAAUiK,GAAGrH,IACT9C,EAAEkK,EAAMrC,eAAexG,SAAS0B,IAChCyH,QAAQtG,SAASnB,EAG7B,EACA2H,QAAS,MAIb/J,GAA0BA,EAAuBqB,QACjDrB,EAAuBgK,OA2M/B,CAleIC,CAAcjK,EAClB,CAmeA,IAAIkK,GAAW,EACf7K,GAAE,WAMEA,EAAE,mBAAmB8K,IAAI,mBAAmB,SAAUZ,GAC7CW,IACDA,GAAW,EACXnK,IAER,IAEAJ,EAAgBwK,IAAI,SAAS,SAAUZ,GAC9BW,IACDA,GAAW,EACXX,EAAMnC,iBACNrH,EAA6BV,EAAE+G,OAEvC,IAEA/G,EAAE8E,QAAQgG,IAAI,UAAU,SAAUZ,GACzBW,IACDA,GAAW,EACXnK,IAER,IAG8B,IAA1BV,EAAE8E,QAAQuD,cACLwC,IACDA,GAAW,EACXnK,KAGZ","sources":["webpack://ui-toolkit/./sass/blocks/in-page-nav.js"],"sourcesContent":["var $ = require('jquery');\r\nrequire('jquery-hoverintent');\r\nvar Modernizr = require('../../vendors/modernizr.min');\r\nvar _throttle = require('lodash/throttle');\r\nvar LazyLoad = require(\"./lazyload\");\r\nvar WS = require('../../scripts/ws.js');\r\n\r\nvar $inPageNavLinks = $('.ws-in-page-nav a');\r\nlet Bootstrap = null;\r\nlet Stickyfill = null;\r\nlet lazyLoadExecuted = false;\r\n\r\nfunction lazyPreloadThenInitInPageNav($linkToClickOnceLoaded) {\r\n // some lazy-loaded elements cause page height to change (such as knockout tabs) which can throw off the scroll target\r\n // calculation, so to prevent that we want to preemptively load these elements when the in-page nav is initialized\r\n LazyLoad.unveilAll($(\".ws-nav-tabs-knockout-table-identifier.lazyload\"));\r\n initInPageNav($linkToClickOnceLoaded);\r\n}\r\n\r\nfunction initInPageNav($linkToClickOnceLoaded) {\r\n var $body = $('body');\r\n var hasSitecoreRibbon = $body.hasClass('pagemode-edit') || $body.hasClass('pagemode-preview');\r\n var pageHeader = document.querySelector('.ws-nav');\r\n var inPageNavSelector = '.ws-in-page-nav';\r\n var inPageNav = document.querySelector('body:not(.pagemode-edit) ' + inPageNavSelector);\r\n var $inPageNav = $(inPageNav);\r\n var minifiedHeader = document.querySelector('.ws-body--minified-header .ws-minified-header');\r\n var minifiedHeaderProgress = 0;\r\n var minifiedHeaderBodyMargin = 0;\r\n var $minifiedHeaderWrapper = $('.ws-minified-header-wrapper');\r\n var $minifiedHeader = $(minifiedHeader);\r\n var minifiedHeaderOffset = $minifiedHeader.length ? $minifiedHeader.offset().top : 0;\r\n var $minifiedHeaderProgressIndicator = $('.ws-minified-header__progress-indicator');\r\n var minifiedHeaderProgressIndicatorHeight;\r\n var $minifiedHeaderProgressTarget = $('[data-progress-target]');\r\n var minifiedHeaderProgressTargetHeight;\r\n var $minifiedHeaderSubNav = $('.ws-minified-header__sub-nav');\r\n var $minifiedHeaderWidthConstraint = $minifiedHeader.find('.col-md-8.offset-md-2');\r\n var minifiedHeaderSubNavHeight = $minifiedHeaderSubNav.height() || 0;\r\n var minifiedHeaderSubNavTop = null;\r\n var initialMinifiedHeaderSubNavTop = null;\r\n var $stickyNavLinks = $('.ws-in-page-nav__link');\r\n var $mobileAccordions = $(\".ws-content-block__category-header\");\r\n var tabletMq = '(min-width: 768px)';\r\n var inPageNavLinkSelectedClass = 'ws-in-page-nav--selected';\r\n var $touchInPageListItems = $('.ws-in-page-nav__list-item');\r\n var $inPageListItems = $('.ws-in-page-nav__list-item > li');\r\n var $minifiedDisplayItems = $('.ws-minified-header__item--display_minified');\r\n var $minifiedPseudoFocusDisplayItems = $('.ws-pseudo-focus__link--minified-header-target');\r\n var isCurrentlySticky = false;\r\n var stickySupport = Modernizr.csspositionsticky;\r\n\r\n // A hidden, minified version of the header added to the page to calculate the height of the header when minified\r\n var $minifiedHeaderPlaceholder;\r\n\r\n // A hidden, unminified version of the header added to the page to occupy the same space as the actual header when unminified\r\n // This allows the actual header to be made \"position:absolute\", taking it out of the layout, so that when it transitions to \"position:fixed\", it does not cause a layout shift\r\n var $unminifiedHeaderPlaceholder;\r\n\r\n var minifiedHeaderHeight = 0,\r\n minifiedHeaderPadding = 0,\r\n fixedHeaderHeight = 0,\r\n pageHeaderOffset = 0,\r\n totalOffset = 0,\r\n scCrossPieceHeight = 0;\r\n\r\n // Add smooth scrolling to all sections on desktop tabs, this needs to be near the start of init to ensure it's attached before the user clicks \r\n $inPageNavLinks.on('click', onInPageNavLinkClick);\r\n\r\n if (minifiedHeader) {\r\n // only include the logo on dark theme minified header\r\n if ($body.hasClass('ws-body--minified-header_dark')) {\r\n var $logo = $('.ws-nav__logo-icon-wrapper:not(.ws-nav__logo-icon-wrapper--print) > .ws-nav__logo-icon');\r\n if ($logo.length) {\r\n var $clonedLogo = $logo.clone();\r\n $clonedLogo.addClass('ws-nav__logo-icon--sticky-page-intro');\r\n $minifiedHeader.find('.ws-minified-header__content').append($clonedLogo);\r\n }\r\n }\r\n\r\n if (!$minifiedHeaderProgressIndicator.length && $('.ws-body--minified-header').data('ws-minified-header-show-progress')) {\r\n $minifiedHeaderProgressIndicator = $('
');\r\n $minifiedHeader.append($minifiedHeaderProgressIndicator);\r\n }\r\n\r\n // The minified header placeholder is added to the page in sticky mode to calculate the height of the minified header in sticky mode\r\n $minifiedHeaderPlaceholder = $minifiedHeader.clone().removeClass('ws-minified-header').addClass('ws-minified-header-placeholder sticky');\r\n cleanHeaderPlaceholder($minifiedHeaderPlaceholder, 'minified'); //! cleanup the minified placeholder markup to prevent conflicts/issues\r\n\r\n $minifiedHeaderPlaceholder.insertAfter($minifiedHeader);\r\n minifiedHeaderPadding = parseInt($minifiedHeaderPlaceholder.css('padding-top'), 10) + parseInt($minifiedHeaderPlaceholder.css('padding-bottom'), 10);\r\n \r\n // Another placeholder of the header, unminified, is added to the page, and the visible header is made \"position:absolute\" to take it out of the document flow\r\n // This prevents layout shift from occurring as the header minifies\r\n $unminifiedHeaderPlaceholder = $minifiedHeader.clone().removeClass('ws-minified-header').addClass('ws-minified-header-placeholder ws-minified-header-placeholder--unminified');\r\n cleanHeaderPlaceholder($unminifiedHeaderPlaceholder, 'unminified'); //! cleanup the unminified placeholder markup to prevent conflicts/issues\r\n \r\n $unminifiedHeaderPlaceholder.insertAfter($minifiedHeader);\r\n $minifiedHeader.addClass(\"ws-minified-header--has-placeholder\");\r\n }\r\n\r\n if (minifiedHeader || inPageNav) {\r\n onResize();\r\n onScroll();\r\n\r\n // throttle scrolling and resize events to improve performance\r\n // add the scroll-thottle class to any page that has scroll lagginess issues, to use a longer throttle interval\r\n const scrollThrottleInterval = $(\".scroll-throttle\").length ? 50 : 20;\r\n document.addEventListener('scroll', _throttle(onScroll, scrollThrottleInterval));\r\n window.addEventListener('resize', _throttle(onResize, 50));\r\n\r\n if (Bootstrap) {\r\n const scrollSpy = new Bootstrap.ScrollSpy($('main'), {\r\n target: '#navbar',\r\n threshold: [0, 1],\r\n rootMargin: \"-45% 0px -50% 0px\"\r\n });\r\n }\r\n else {\r\n Bootstrap = require('bootstrap');\r\n const scrollSpy = new Bootstrap.ScrollSpy($('main'), {\r\n target: '#navbar',\r\n threshold: [0, 1],\r\n rootMargin: \"-45% 0px -50% 0px\"\r\n });\r\n }\r\n }\r\n\r\n if (!$minifiedHeaderProgressTarget.length) {\r\n $minifiedHeaderProgressTarget = $('main');\r\n }\r\n\r\n if (!stickySupport) {\r\n if (Stickyfill) {\r\n Stickyfill.add($mobileAccordions);\r\n } else {\r\n import(/* webpackChunkName: \"stickyfilljs\" */ \"stickyfilljs\").then(({ default: stickyfill }) => {\r\n Stickyfill = stickyfill;\r\n Stickyfill.add($mobileAccordions);\r\n });\r\n }\r\n }\r\n\r\n /* This block works around an issue in Chrome where it scrolls to the top of the page when you click in a form element that is inside a sticky section. */\r\n var shareSelectorScrollX;\r\n var shareSelectorScrollY;\r\n\r\n $(document).on('mousedown', '.ws-fund-detail-page-intro__share-selector', function (e) {\r\n if (!$(this).is(':focus')) {\r\n shareSelectorScrollX = window.pageXOffset;\r\n shareSelectorScrollY = window.pageYOffset;\r\n }\r\n });\r\n\r\n $(document).on('focus', '.ws-fund-detail-page-intro__share-selector', function (e) {\r\n if (window.pageYOffset !== shareSelectorScrollY) {\r\n window.scrollTo(shareSelectorScrollX, shareSelectorScrollY);\r\n }\r\n });\r\n /* End Chrome workaround */\r\n\r\n $inPageNavLinks.on('keydown', function (e) {\r\n var $focusedItem = $(e.currentTarget);\r\n var closestLi = $focusedItem.closest('li');\r\n switch (e.which) {\r\n case 37:\r\n //left arrow\r\n e.preventDefault();\r\n closestLi.prev().find('a.ws-in-page-nav__link').focus();\r\n break;\r\n case 39:\r\n //right arrow\r\n e.preventDefault();\r\n closestLi.next().find('a.ws-in-page-nav__link').focus();\r\n break;\r\n case 13:\r\n //enter\r\n onInPageNavLinkClick(e);\r\n\r\n var href = $focusedItem.attr('href');\r\n var hrefId = href.substring(1, href.length + 1);\r\n var anchor = document.getElementById(hrefId);\r\n var $anchorTag = $(anchor);\r\n $anchorTag.next().find('h2.ws-content__item.ws-heading.ws-heading--underlined.ws-heading--collapsible').attr(\"tabindex\", \"0\").focus().removeAttr(\"tabindex\");\r\n break;\r\n default:\r\n break;\r\n }\r\n });\r\n\r\n $stickyNavLinks.on('keydown', function (e) {\r\n var $focusedItem = $(e.currentTarget);\r\n switch (e.which) {\r\n case 37:\r\n //left arrow\r\n e.preventDefault();\r\n $focusedItem.closest('li').prev().find('a.ws-in-page-nav__link').focus();\r\n break;\r\n case 39:\r\n //right arrow\r\n e.preventDefault();\r\n $focusedItem.closest('li').next().find('a.ws-in-page-nav__link').focus();\r\n break;\r\n case 13:\r\n //enter\r\n var href = $focusedItem.attr('href');\r\n var hrefId = href.substring(1, href.length + 1);\r\n var anchor = document.getElementById(hrefId);\r\n var $anchorTag = $(anchor);\r\n $anchorTag.next().find('h2.ws-content__item.ws-heading.ws-heading--underlined.ws-heading--collapsible').focus();\r\n break;\r\n default:\r\n break;\r\n }\r\n });\r\n\r\n if ($body.hasClass('pagemode-edit')) {\r\n // in Experience Editor mode, we want to disable arrow key navigation so it doesn't interfere with editing\r\n $stickyNavLinks.off('keydown');\r\n }\r\n\r\n $mobileAccordions.on('click', function () {\r\n $(this).toggleClass(\"open\");\r\n if (!$(this).hasClass(\"open\")) {\r\n var $header = $(this);\r\n var $prev = $header.prev();\r\n $prev = $prev.length > 0 ? $prev : $header.parent();\r\n var headerTop = $prev.offset().top - pageHeaderOffset;\r\n\r\n // if the accordion we are closing will now be out of the viewport, scroll up to it\r\n if (headerTop < $(document).scrollTop()) {\r\n $('body, html').animate({\r\n scrollTop: headerTop\r\n }, 100);\r\n }\r\n }\r\n });\r\n\r\n $minifiedDisplayItems.on('focusin', function () {\r\n // if we've tabbed to a item in the minified header that is only shown while minified, we want to scroll enough to minify the header, if it hasn't already been\r\n if (!isCurrentlySticky) {\r\n $('body, html').animate({\r\n scrollTop: minifiedHeaderOffset\r\n }, 100);\r\n }\r\n });\r\n\r\n $minifiedPseudoFocusDisplayItems.on('focusin', function () {\r\n // if we've tabbed to a item in the minified header that is only shown while minified, we want to scroll enough to minify the header, if it hasn't already been\r\n if (!isCurrentlySticky) {\r\n $('body, html').animate({\r\n scrollTop: minifiedHeaderOffset\r\n }, 100);\r\n }\r\n });\r\n\r\n if (Modernizr.browsertouch) {\r\n $touchInPageListItems.on('click', function (event) {\r\n if (Modernizr.mq(tabletMq)) {\r\n var $target = $(event.currentTarget),\r\n $li = $target.parent();\r\n\r\n event.preventDefault();\r\n event.stopPropagation();\r\n\r\n if (!$li.hasClass(inPageNavLinkSelectedClass)) {\r\n $inPageListItems.removeClass(inPageNavLinkSelectedClass);\r\n $li.addClass(inPageNavLinkSelectedClass);\r\n }\r\n else {\r\n $inPageListItems.removeClass(inPageNavLinkSelectedClass);\r\n }\r\n }\r\n });\r\n }\r\n else {\r\n $inPageListItems.hoverIntent({\r\n over: function (event) {\r\n if (Modernizr.mq(tabletMq)) {\r\n $inPageListItems.removeClass(inPageNavLinkSelectedClass);\r\n $target.addClass(inPageNavLinkSelectedClass);\r\n }\r\n },\r\n out: function (event) {\r\n if (Modernizr.mq(tabletMq)) {\r\n if ($(event.currentTarget).hasClass(inPageNavLinkSelectedClass)) {\r\n $target.addClass(inPageNavLinkSelectedClass);\r\n }\r\n }\r\n },\r\n timeout: 500\r\n });\r\n }\r\n\r\n if ($linkToClickOnceLoaded && $linkToClickOnceLoaded.length) {\r\n $linkToClickOnceLoaded.click();\r\n }\r\n\r\n function cleanHeaderPlaceholder($headerPlaceholder, placeholderIdSuffix) {\r\n if (WS.isExperienceEditor()) {\r\n // remove sitecore \"chromes\" from the placeholder to prevent conflicts\r\n $headerPlaceholder.find(\".scLooseFrameZone, code[type='text/sitecore'][kind='open']\").remove();\r\n $headerPlaceholder.find(\".scWebEditInput, .scEnabledChrome\").removeClass(\"scWebEditInput\").removeClass(\"scEnabledChrome\")\r\n .removeAttr(\"id\").removeAttr(\"sc-part-of\").removeAttr(\"scfieldtype\");\r\n }\r\n\r\n // we don't want the placeholder to show up in heading lists for screen readers; this shouldn't change styling since it's all based on classes\r\n $headerPlaceholder.find('h1,h2,h3,h4,h5,h6').each((index, element) => WS.replaceTag($(element), 'span'));\r\n\r\n // to avoid duplicate id's on the page, change any elements with an id defined\r\n $headerPlaceholder.find('[id]').each((index, element) => element.id += `-placeholder-${placeholderIdSuffix}`);\r\n $headerPlaceholder.find('[for]').each((index, element) => element.setAttribute('for', element.getAttribute('for') + `-placeholder-${placeholderIdSuffix}`));\r\n }\r\n\r\n function recalculatePositions() {\r\n pageHeaderOffset = calculatePageHeaderOffset();\r\n minifiedHeaderHeight = ($minifiedHeaderPlaceholder && $minifiedHeaderPlaceholder.length) ? ($minifiedHeaderPlaceholder.height() + minifiedHeaderPadding + scCrossPieceHeight) - 1 : 0;\r\n fixedHeaderHeight = minifiedHeaderHeight || calculatePageHeaderOffset();\r\n totalOffset = calculateTotalHeaderOffset();\r\n minifiedHeaderProgressIndicatorHeight = $minifiedHeaderProgressIndicator.outerHeight() || 0;\r\n minifiedHeaderProgressTargetHeight = $minifiedHeaderProgressTarget.outerHeight() || 0;\r\n minifiedHeaderBodyMargin = minifiedHeaderHeight - 5 - (isCurrentlySticky ? scCrossPieceHeight : 0);\r\n }\r\n\r\n function calculatePageHeaderOffset() {\r\n return pageHeader ? pageHeader.offsetTop + pageHeader.offsetHeight : 0;\r\n }\r\n\r\n function calculateTotalHeaderOffset() {\r\n return fixedHeaderHeight + minifiedHeaderSubNavHeight;\r\n }\r\n\r\n function adjustForEERibbon(forceAdjust) {\r\n if (hasSitecoreRibbon) {\r\n var $scCrossPiece = $('#scCrossPiece');\r\n if ($scCrossPiece.length) {\r\n var outerHeight = $scCrossPiece.outerHeight();\r\n\r\n if (forceAdjust || scCrossPieceHeight !== outerHeight) {\r\n scCrossPieceHeight = outerHeight;\r\n const offset = isCurrentlySticky ? `${scCrossPieceHeight}px` : '';\r\n $minifiedHeader.css('top', offset);\r\n\r\n recalculatePositions();\r\n setNavClasses();\r\n }\r\n }\r\n }\r\n }\r\n\r\n function onResize() {\r\n adjustForEERibbon();\r\n recalculatePositions();\r\n setNavClasses();\r\n }\r\n\r\n function onScroll() {\r\n var wasStickyBeforeScroll = isCurrentlySticky;\r\n\r\n if (window.pageYOffset >= minifiedHeaderOffset - scCrossPieceHeight - 5) {\r\n if (!isCurrentlySticky) {\r\n isCurrentlySticky = true;\r\n $minifiedHeaderWrapper.addClass('sticky');\r\n $minifiedHeader.addClass('sticky');\r\n }\r\n\r\n // Remove narrow width constraint on Thought Leadership articles so it extends entire page width\r\n if ($minifiedHeaderWidthConstraint.length) {\r\n $minifiedHeaderWidthConstraint.removeClass('col-md-8 offset-md-2');\r\n }\r\n\r\n updateProgressIndicator();\r\n\r\n if ($minifiedHeaderSubNav.length) {\r\n if (initialMinifiedHeaderSubNavTop === null) {\r\n initialMinifiedHeaderSubNavTop = $minifiedHeaderSubNav.offset().top;\r\n }\r\n\r\n if (window.pageYOffset >= initialMinifiedHeaderSubNavTop - fixedHeaderHeight - 1) {\r\n $minifiedHeaderSubNav.addClass('sticky');\r\n\r\n if (!stickySupport) {\r\n $minifiedHeaderSubNav.addClass('ws-minified-header__sub-nav--pseudo-sticky');\r\n }\r\n\r\n $mobileAccordions.each(function (i, item) {\r\n var $this = $(this);\r\n var thisTop = $this.offset().top;\r\n\r\n var offsetTop = thisTop - fixedHeaderHeight;\r\n var offsetBottom = offsetTop + $this.height();\r\n\r\n if (window.pageYOffset >= thisTop - fixedHeaderHeight - 1 && window.pageYOffset < offsetBottom) {\r\n $this.addClass('sticky');\r\n } else {\r\n $this.removeClass('sticky');\r\n }\r\n });\r\n } else {\r\n $minifiedHeaderSubNav.removeClass('sticky');\r\n\r\n if (!stickySupport) {\r\n $minifiedHeaderSubNav.removeClass('ws-minified-header__sub-nav--pseudo-sticky');\r\n }\r\n }\r\n }\r\n\r\n setNavClasses();\r\n } else {\r\n if (isCurrentlySticky) {\r\n isCurrentlySticky = false;\r\n $minifiedHeaderWrapper.removeClass('sticky');\r\n $minifiedHeader.removeClass('sticky');\r\n $minifiedHeaderSubNav.removeClass('sticky');\r\n }\r\n\r\n // Restore narrow width constraint on article headers\r\n if ($minifiedHeaderWidthConstraint.length) {\r\n $minifiedHeaderWidthConstraint.addClass('col-md-8 offset-md-2');\r\n }\r\n\r\n if (!stickySupport) {\r\n $minifiedHeaderSubNav.removeClass('ws-minified-header__sub-nav--pseudo-sticky');\r\n }\r\n }\r\n\r\n // force an adjustment if stickiness changed, otherwise, it will only adjust if the ribbon size changes\r\n adjustForEERibbon(wasStickyBeforeScroll !== isCurrentlySticky);\r\n }\r\n\r\n function setNavClasses() {\r\n var headerHeightPx = fixedHeaderHeight + 'px';\r\n\r\n if (minifiedHeaderSubNavTop !== fixedHeaderHeight) {\r\n // adjust the subnav position e.g. when window is resized, causing text in the header to wrap, changing the minified header height\r\n minifiedHeaderSubNavTop = fixedHeaderHeight;\r\n $minifiedHeaderSubNav.css({ 'top': headerHeightPx });\r\n }\r\n\r\n updateProgressIndicator();\r\n }\r\n\r\n function updateProgressIndicator() {\r\n if ($minifiedHeaderProgressTarget.length) {\r\n var adjustedOffset = Math.max(0, window.pageYOffset + minifiedHeaderBodyMargin + minifiedHeaderProgressIndicatorHeight - $minifiedHeaderProgressTarget.offset().top);\r\n var progressTarget = minifiedHeaderProgressTargetHeight - window.innerHeight * 2 / 3; // progress is \"complete\" when the end of the article is in the top two-thirds of the viewport\r\n var progressPct = 0.1 + adjustedOffset / Math.max(1, progressTarget) * 100;\r\n\r\n // for performance reasons, we don't want to change the css every single scroll event by a miniscule amount, so only do it if it changes by 0.1% or more\r\n if (Math.floor(progressPct * 10) !== Math.floor(minifiedHeaderProgress * 10)) {\r\n minifiedHeaderProgress = Math.min(100, Math.max(0, progressPct));\r\n $minifiedHeaderProgressIndicator.css(\"width\", minifiedHeaderProgress + \"%\");\r\n }\r\n }\r\n }\r\n\r\n // Function that handles the click event on in-page navigation links\r\n function onInPageNavLinkClick(e) {\r\n const link = e.currentTarget;\r\n\r\n if (link.hash === \"\") {\r\n return;\r\n }\r\n\r\n e.preventDefault();\r\n\r\n const $targetElement = $(link.hash);\r\n const $allContentBlocks = $('.ws-content-block');\r\n\r\n $(inPageNav).addClass('ws-in-page-nav--animating');\r\n\r\n // Load lazy-loaded children for each content block only once\r\n if (!lazyLoadExecuted) {\r\n $allContentBlocks.each(function () {\r\n LazyLoad.unveilAllChildren($(this));\r\n });\r\n\r\n lazyLoadExecuted = true;\r\n }\r\n\r\n // Calculate target scroll position based on the target element\r\n const target = calculateScrollTargetPosition($targetElement);\r\n\r\n // Animate scrolling to the target position\r\n $('html, body').animate({ scrollTop: target }, 100);\r\n\r\n $(inPageNav).removeClass('ws-in-page-nav--animating');\r\n }\r\n\r\n function calculateScrollTargetPosition($targetElement) {\r\n let target = $targetElement.offset().top - totalOffset + 2;\r\n\r\n if (!isCurrentlySticky) {\r\n target += minifiedHeaderBodyMargin - minifiedHeaderSubNavHeight;\r\n }\r\n\r\n return target;\r\n }\r\n}\r\n\r\nvar executed = false;\r\n$(function () {\r\n //! 1) Begin initialization of in-page nav on:\r\n //! A) first mouseover or focus of an IN PAGE NAV\r\n //! B) first click of any link within IN PAGE NAV\r\n //! C) first window scroll\r\n\r\n $(\".ws-in-page-nav\").one(\"mouseover focus\", function (event) {\r\n if (!executed) {\r\n executed = true;\r\n lazyPreloadThenInitInPageNav();\r\n }\r\n });\r\n\r\n $inPageNavLinks.one(\"click\", function (event) {\r\n if (!executed) {\r\n executed = true;\r\n event.preventDefault();\r\n lazyPreloadThenInitInPageNav($(this));\r\n }\r\n });\r\n\r\n $(window).one(\"scroll\", function (event) {\r\n if (!executed) {\r\n executed = true;\r\n lazyPreloadThenInitInPageNav();\r\n }\r\n });\r\n\r\n //if page is refreshed and the sticky header should already be active run the script.\r\n if ($(window).scrollTop() !== 0) {\r\n if (!executed) {\r\n executed = true;\r\n lazyPreloadThenInitInPageNav();\r\n }\r\n }\r\n});\r\n\r\n"],"names":["$","require","Modernizr","_throttle","LazyLoad","WS","$inPageNavLinks","Bootstrap","Stickyfill","lazyLoadExecuted","lazyPreloadThenInitInPageNav","$linkToClickOnceLoaded","unveilAll","minifiedHeaderProgressIndicatorHeight","minifiedHeaderProgressTargetHeight","$minifiedHeaderPlaceholder","$unminifiedHeaderPlaceholder","shareSelectorScrollX","shareSelectorScrollY","$body","hasSitecoreRibbon","hasClass","pageHeader","document","querySelector","inPageNav","minifiedHeader","minifiedHeaderProgress","minifiedHeaderBodyMargin","$minifiedHeaderWrapper","$minifiedHeader","minifiedHeaderOffset","length","offset","top","$minifiedHeaderProgressIndicator","$minifiedHeaderProgressTarget","$minifiedHeaderSubNav","$minifiedHeaderWidthConstraint","find","minifiedHeaderSubNavHeight","height","minifiedHeaderSubNavTop","initialMinifiedHeaderSubNavTop","$stickyNavLinks","$mobileAccordions","tabletMq","inPageNavLinkSelectedClass","$touchInPageListItems","$inPageListItems","$minifiedDisplayItems","$minifiedPseudoFocusDisplayItems","isCurrentlySticky","stickySupport","csspositionsticky","minifiedHeaderHeight","minifiedHeaderPadding","fixedHeaderHeight","pageHeaderOffset","totalOffset","scCrossPieceHeight","on","onInPageNavLinkClick","$logo","$clonedLogo","clone","addClass","append","data","cleanHeaderPlaceholder","removeClass","insertAfter","parseInt","css","onResize","onScroll","scrollThrottleInterval","addEventListener","window","ScrollSpy","target","threshold","rootMargin","$headerPlaceholder","placeholderIdSuffix","isExperienceEditor","remove","removeAttr","each","index","element","replaceTag","id","concat","setAttribute","getAttribute","recalculatePositions","calculatePageHeaderOffset","outerHeight","offsetTop","offsetHeight","adjustForEERibbon","forceAdjust","$scCrossPiece","setNavClasses","wasStickyBeforeScroll","pageYOffset","updateProgressIndicator","i","item","$this","this","thisTop","offsetBottom","headerHeightPx","adjustedOffset","Math","max","progressTarget","innerHeight","progressPct","floor","min","e","link","currentTarget","hash","preventDefault","$targetElement","$allContentBlocks","unveilAllChildren","calculateScrollTargetPosition","animate","scrollTop","add","then","_ref","stickyfill","default","is","pageXOffset","scrollTo","$focusedItem","closestLi","closest","which","prev","focus","next","href","attr","hrefId","substring","anchor","getElementById","off","toggleClass","$header","$prev","headerTop","parent","browsertouch","event","mq","$li","stopPropagation","hoverIntent","over","$target","out","timeout","click","initInPageNav","executed","one"],"sourceRoot":""}