{"version":3,"file":"index.min.mjs","sources":["../../src/js/overlay.mjs","../../src/js/dropdown.mjs","../../src/js/dropdown-service.mjs","../../src/js/all-settled.mjs","../../src/js/api.mjs","../../src/js/set-selected-state.mjs","../../src/js/account.mjs","../../src/js/sticky-element.mjs","../../src/js/interactive.mjs","../../src/js/init.mjs"],"sourcesContent":["'use strict';\n\nconst defaults = {\n activeClass: 'TK-Nav-Overlay--Active'\n};\n\nexport default class Overlay {\n constructor(element, options) {\n // Edge does not support object spread...\n this.options = Object.assign({}, defaults, options);\n this.element = element;\n this.activeClass = this.options.activeClass;\n this.hidden = true;\n }\n\n show() {\n if (!this.hidden || !this.element) return;\n this.element.classList.add(this.activeClass);\n this.hidden = false;\n }\n\n hide() {\n if (this.hidden || !this.element) return;\n this.element.classList.remove(this.activeClass);\n this.hidden = true;\n }\n\n addEventListener(event, listener, capture = false) {\n this.element && this.element.addEventListener(event, listener, capture);\n }\n}\n","'use strict';\n\nconst ESCAPE = 27;\nconst SUPPORT_TRANSITIONS = ('transition' in document.documentElement.style);\n\nconst fn = (f) => (typeof f === 'function');\n\nconst defaults = {\n hover: false,\n click: false,\n activeClass: 'TK-Dropdown--Active',\n beforeOpenHook: () => {},\n beforeCloseHook: () => {}\n};\n\nclass Dropdown {\n constructor(element, options) {\n if (!element) {\n return;\n }\n\n this.element = element;\n this.options = Object.assign({}, defaults, options);\n\n this.closed = true;\n this.running = false;\n this.parent = this.options.parent || element.parentElement;\n this.button = this.options.button || this.parent.firstElementChild;\n this.beforeOpenHook = this.options.beforeOpenHook;\n this.beforeCloseHook = this.options.beforeCloseHook;\n\n this.init();\n }\n\n run() {\n if (!SUPPORT_TRANSITIONS) return;\n\n const { transition } = window.getComputedStyle(this.element, null);\n\n if (transition.split(' ')[0] === 'none') {\n this.running = false;\n return;\n }\n\n this.running = true;\n\n const transitionEndHandler = () => {\n this.running = false;\n this.element.removeEventListener('transitionend', transitionEndHandler, false);\n };\n\n this.element.addEventListener('transitionend', transitionEndHandler, false);\n }\n\n open() {\n if (!this.closed) return;\n\n if (fn(this.beforeOpenHook)) {\n this.beforeOpenHook();\n }\n\n this.run();\n this.element.classList.add(this.options.activeClass);\n this.closed = false;\n\n document.addEventListener('keydown', this.bind('closeOnEscape'), false);\n }\n\n close() {\n if (this.closed) return;\n\n if (fn(this.beforeCloseHook)) {\n this.beforeCloseHook();\n }\n\n this.run();\n this.element.classList.remove(this.options.activeClass);\n this.closed = true;\n\n document.removeEventListener('keydown', this.bind('closeOnEscape'), false);\n }\n\n closeOnEscape(event) {\n if (event.keyCode === ESCAPE) {\n this.close();\n }\n }\n\n toggle() {\n window.requestAnimationFrame(() => {\n this.closed ? this.open() : this.close();\n });\n }\n\n contains(node) {\n return this.element.contains(node);\n }\n\n associate(node) {\n let result = this.contains(node);\n\n if (node === this.button) {\n result = true;\n }\n\n return result;\n }\n\n /**\n * @param {String} method\n * @return {Function}\n */\n bind(method) {\n const bound = `${method}_`;\n\n if (!fn(this[bound])) {\n this[bound] = this[method].bind(this);\n }\n\n return this[bound];\n }\n\n on(eventType) {\n if (eventType === 'tk-click') {\n this.button.addEventListener('click', this.bind('toggle'), false);\n }\n\n if (eventType === 'tk-hover') {\n if (this.options.hover) {\n this.button.addEventListener('focus', this.bind('open'), false);\n this.parent.addEventListener('mouseenter', this.bind('open'), false);\n this.parent.addEventListener('mouseleave', this.bind('close'), false);\n }\n }\n\n if (eventType === 'tk-before-open-hook') {\n this.beforeOpenHook = this.options.beforeOpenHook;\n }\n\n if (eventType === 'tk-before-close-hook') {\n this.beforeCloseHook = this.options.beforeCloseHook;\n }\n }\n\n off(eventType) {\n if (eventType === 'tk-click') {\n this.button.removeEventListener('click', this.bind('toggle'), false);\n }\n\n if (eventType === 'tk-hover') {\n if (this.options.hover) {\n this.button.removeEventListener('focus', this.bind('open'), false);\n this.parent.removeEventListener('mouseenter', this.bind('open'), false);\n this.parent.removeEventListener('mouseleave', this.bind('close'), false);\n }\n }\n\n if (eventType === 'tk-before-open-hook') {\n this.beforeOpenHook = null;\n }\n\n if (eventType === 'tk-before-close-hook') {\n this.beforeCloseHook = null;\n }\n }\n\n deface() {\n if (!this.options.hover) return;\n\n const preventHandler = (event) => event.preventDefault();\n\n const on = () => {\n this.on('tk-click');\n this.button.removeEventListener('click', preventHandler, false);\n };\n\n const off = () => {\n this.off('tk-click');\n this.button.addEventListener('click', preventHandler, false);\n };\n\n const buttonHandler = () => {\n if (this.running) off();\n // window.setTimeout(on, 256);\n\n requestAnimationFrame(() => {\n off();\n on();\n });\n };\n\n this.button.addEventListener('mouseenter', buttonHandler, false);\n }\n\n init() {\n if (this.options.click) {\n this.on('tk-click');\n }\n if (this.options.hover) {\n this.on('tk-hover');\n this.deface();\n }\n }\n}\n\nexport default Dropdown;\n","/*\n * DropdownService holds a collection of\n * Dropdowns and operates on them as one\n * example ->\n * If you tell the service to close\n * it will close all associated dropdowns\n */\n\n'use strict';\n\nimport Dropdown from './dropdown.mjs';\n\nclass DropdownService {\n /**\n * @param {HTMLElement[]|Dropdown[]} elements\n */\n constructor(elements, options) {\n if (!Array.isArray(elements)) {\n return;\n }\n\n this.dropdowns = elements.map((element) => {\n /**\n * If element is already initialized dropdown just return it\n */\n if (element instanceof Dropdown) {\n return element;\n }\n return new Dropdown(element, options);\n });\n }\n\n close() {\n this.dropdowns.forEach((dropdown) => {\n dropdown.close();\n });\n }\n\n contains(node) {\n let result = false;\n\n this.dropdowns.forEach((dropdown) => {\n if (dropdown.contains(node)) {\n result = true;\n }\n });\n\n return result;\n }\n\n associate(node) {\n let result = false;\n\n this.dropdowns.forEach((dropdown) => {\n if (dropdown.associate(node)) {\n result = true;\n }\n });\n\n return result;\n }\n\n on(eventType) {\n this.dropdowns.forEach((dropdown) => {\n dropdown.on(eventType);\n });\n }\n\n off(eventType) {\n this.dropdowns.forEach((dropdown) => {\n dropdown.off(eventType);\n });\n }\n}\n\nexport default DropdownService;\n","/**\n * Utility function for Promise.allSettled\n *\n * @param {Array} promises - array of promises to check\n * @return {Promise} promise - result promise\n */\nexport function settled(promises = []) {\n if (Promise.allSettled) {\n return Promise.allSettled(promises);\n }\n\n // we don't care about errors here, but we must catch them\n return Promise.all(promises).catch(() => Promise.resolve());\n}\n","// import env from '../../data/environments.js';\n// import skus from '../../data/sku-categories.js';\n\nconst FETCH = !!window.fetch;\nconst PROMISE = !!window.Promise;\n\n/* eslint quote-props: [\"error\", \"consistent\"] */\nconst defaults = {\n method: 'GET',\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json'\n },\n credentials: 'include' // include cookies for cross-origin call\n};\n\nclass Api {\n constructor(hostname = Api.getHostname(), _defaults = defaults) {\n this.defaults = Object.assign({}, _defaults);\n\n this.url = Api.getApiUrl(hostname);\n this.hostname = hostname;\n this.isStore = hostname.includes('store.progress.com');\n\n this.online = navigator.onLine;\n\n this.available = !!(this.url && this.online && PROMISE && FETCH);\n\n this.rejection = new Error('Not allowed domain || offline || no browser support');\n }\n\n /**\n * @param {Response} res\n * @return {Promise} - a promise that resolves with the result of parsing the response body text as JSON\n */\n static json(res) {\n if (res.ok) {\n return res.json();\n }\n throw new Error(res.statusText);\n }\n\n /**\n * @return {String} current hostname\n */\n static getHostname() {\n return window.location.hostname.toLowerCase();\n }\n\n /**\n * @param {String} hostname\n * @return {String} API_URL\n */\n static getApiUrl(hostname = Api.getHostname()) {\n let API_URL = '';\n\n /* @DEVELOPMENT\n if (hostname === 'localhost') {\n return 'https://localhost:4042/api';\n }\n @DEVELOPMENT */\n\n const TLRK_DOMAINS = [\n 'www.telerik.com',\n 'docs.telerik.com',\n 'demos.telerik.com',\n ];\n\n const PRGS_DOMAINS = [\n 'www.progress.com',\n 'store.progress.com'\n ];\n\n if (TLRK_DOMAINS.includes(hostname)) {\n API_URL = 'https://www.telerik.com/account/api';\n }\n else if (PRGS_DOMAINS.includes(hostname)) {\n API_URL = 'https://store.progress.com/api';\n }\n else {\n const divisions = hostname.split('.');\n const subdomain = divisions[0];\n const name = divisions[1];\n const tld = divisions[2];\n\n const len = subdomain.length;\n const tlrk = subdomain.startsWith('www') && (len >= 3 && len <= 6) && name === 'telerik' && tld === 'com';\n const prgs = subdomain.startsWith('www') && (len >= 3 && len <= 6) && name === 'progress' && tld === 'com';\n const store = subdomain.startsWith('store', 3) && len === 8 && name === 'progress' && tld === 'com';\n\n if (tlrk) {\n API_URL = `https://${subdomain}.telerik.com/account/api`;\n }\n\n if (prgs) {\n const prefix = hostname.substring(3, 6);\n API_URL = `https://${prefix}store.progress.com/api`;\n }\n\n if (store) {\n const prefix = hostname.substring(0, 3);\n API_URL = `https://${prefix}store.progress.com/api`;\n }\n }\n\n return API_URL;\n }\n\n /**\n * @return {Promise} - env data object\n */\n initAsync() {\n if (!this.available) {\n return Promise.reject(this.rejection);\n }\n\n return this.getEnvironment().then((env) => {\n const currentHref = window.location.href;\n const doubleEncodedHref = encodeURIComponent(encodeURIComponent(currentHref));\n\n this.env = env;\n this.env.signoutUrl = `${env.telerikWebsiteUrl}${env.signoutBaseUrl}${doubleEncodedHref}`;\n\n return env;\n });\n }\n\n /**\n * @return {Promise} - env data object\n */\n getEnvironment() {\n if (!this.available) {\n return Promise.reject(this.rejection);\n }\n\n const endpoint = this.isStore ? `${this.url}/v1/environments/current` : `${this.url}/v2/environments/current`;\n\n return fetch(endpoint, this.defaults).then(Api.json);\n }\n\n /**\n * @return {Promise} - current user email\n */\n getCurrentUserEmail() {\n if (!this.available) {\n return Promise.reject(this.rejection);\n }\n\n const endpoint = `${this.url}/v1/users/current/email`;\n\n return fetch(endpoint, this.defaults).then(Api.json);\n }\n\n /**\n * try to get current user email\n * if response is empty string reject with error\n *\n * @return {Promise} - current user email - or rejects with error\n */\n tryGetCurrentUserEmail() {\n return this.getCurrentUserEmail().then((email) => {\n if (email) return email;\n return Promise.reject(new Error('User is not logged in'));\n });\n }\n\n /**\n * @param {String} - user email\n * @return {Promise} - user avatar url\n */\n getUserAvatarUrl(email) {\n if (!this.available) {\n return Promise.reject(this.rejection);\n }\n\n if (!email) {\n return Promise.reject(new Error('No email provided'));\n }\n\n const encoded = encodeURIComponent(email);\n const endpoint = `${this.url}/v1/users/${encoded}/avatarurl`;\n\n return fetch(endpoint, this.defaults).then(Api.json);\n }\n\n /**\n * @return {Promise} result - true/false\n */\n getLoggedInState() {\n if (!this.available) {\n return Promise.reject(this.rejection);\n }\n\n const endpoint = `${this.url}/v1/users/current/logged`;\n\n return fetch(endpoint, this.defaults).then(Api.json);\n }\n\n /**\n * @return {Promise} - basic profile\n */\n getBasicProfile() {\n if (!this.available) {\n return Promise.reject(this.rejection);\n }\n\n const endpoint = `${this.url}/v1/users/current/basicprofile`;\n\n return fetch(endpoint, this.defaults).then(Api.json);\n }\n\n /**\n * @param {String} - shopping cart session id\n * @return {Promise} - shopping cart items count\n */\n getShoppingCartItemsCount(shoppingCartSessionId) {\n if (!this.available) {\n return Promise.reject(this.rejection);\n }\n\n if (!shoppingCartSessionId) {\n return Promise.reject(new Error('Shopping cart session id is required'));\n }\n\n const endpoint = `${this.url}/v3/shoppingcarts/${shoppingCartSessionId}/items/count`;\n\n return fetch(endpoint, this.defaults).then(Api.json);\n }\n\n /**\n * @param {String} email - users email\n * @return {Promise} - result\n */\n getExpiringProductsCount(email) {\n if (!this.available) {\n return Promise.reject(this.rejection);\n }\n\n if (!email) {\n return Promise.reject(new Error('User email is required'));\n }\n\n const encoded = encodeURIComponent(email);\n const endpoint = `${this.url}/v2/purchaseoptions/${encoded}/renewalsandupgrades/stats`;\n\n return fetch(endpoint, this.defaults)\n .then(Api.json)\n .then((data) => Number(data.expiring));\n }\n\n /**\n * @return {Promise} - sku categories\n */\n getMySkuCategories() {\n if (!this.available) {\n return Promise.reject(this.rejection);\n }\n\n const endpoint = `${this.url}/v2/stockkeepingunits/mine/categories`;\n\n return fetch(endpoint, this.defaults).then(Api.json);\n }\n\n /**\n * @return {Promise} result - true/false\n */\n getVirtualClassRoomSupport() {\n if (!this.available) {\n return Promise.reject(this.rejection);\n }\n\n const endpoint = `${this.url}/v1/lms/hasaccess`;\n\n return fetch(endpoint, this.defaults).then(Api.json);\n }\n}\n\nexport default Api;\n","/**\n * data-match-exact-path\n * data-match-contains-search\n * data-match-starts-with-path\n * data-match-pattern\n */\n\nconst SELECTED_CLASS = 'TK-Item--Selected';\nconst DROPDOWN_SELECTOR = '.TK-Dropdown:not(.TK-Dash)';\nconst DROPDOWN_BUTTON_SELECTOR = '.TK-Menu-Item-Button, .TK-Aside-Menu-Button';\nconst TOP_LEVEL_SELECTED_LINKS = '.TK-Menu-Item-Link.TK-Item--Selected, .TK-Aside-Menu-Link.TK-Item--Selected';\nconst qsa = (selector, parent) => Array.from(parent.querySelectorAll(selector));\n\n/**\n * Set selected state\n * @param {HTMLElement} parent - parent element of the links\n */\nexport function setSelectedState(parent) {\n qsa(`.${SELECTED_CLASS}`, parent).forEach((item) => item.classList.remove(SELECTED_CLASS));\n\n const { href, pathname, search, hostname } = window.location;\n const links = qsa('a', parent);\n\n links.forEach((link) => {\n const matchExact = link.hasAttribute('data-match-exact-path');\n const matchSearch = link.hasAttribute('data-match-contains-search');\n const matchStartsWith = link.hasAttribute('data-match-starts-with-path');\n const matchPattern = link.hasAttribute('data-match-pattern');\n\n if (matchExact && matchSearch) {\n if (pathname === link.pathname && search.indexOf(link.search) >= 0) {\n link.classList.add(SELECTED_CLASS);\n }\n }\n else if (matchExact) {\n if (pathname === link.pathname) {\n link.classList.add(SELECTED_CLASS);\n }\n }\n else if (matchStartsWith) {\n if (href.startsWith(link.href)) {\n link.classList.add(SELECTED_CLASS);\n }\n }\n\n if (matchPattern) {\n const regex = new RegExp(link.getAttribute('data-pattern'));\n if (regex.test(hostname + pathname)) {\n link.classList.add(SELECTED_CLASS);\n }\n }\n });\n\n const selectedLinks = qsa(`.${SELECTED_CLASS}`, parent);\n const topLevelSelectedLinks = qsa(`${TOP_LEVEL_SELECTED_LINKS}`, parent);\n\n if (topLevelSelectedLinks.length > 1) {\n const firstExactMatchLink = topLevelSelectedLinks.find(link => link.hasAttribute('data-match-exact-path'));\n\n if (firstExactMatchLink) {\n topLevelSelectedLinks\n .filter(link => link !== firstExactMatchLink)\n .forEach(link => link.classList.remove(SELECTED_CLASS));\n }\n else {\n topLevelSelectedLinks.slice(1).forEach(link => link.classList.remove(SELECTED_CLASS));\n }\n }\n\n if (topLevelSelectedLinks.length === 0) {\n let buttonMatched = false;\n\n selectedLinks.forEach((link) => {\n if (!buttonMatched) {\n const dropdown = link.closest(DROPDOWN_SELECTOR);\n if (dropdown) {\n const button = dropdown.parentElement.querySelector(DROPDOWN_BUTTON_SELECTOR);\n button && button.classList.add(SELECTED_CLASS);\n buttonMatched = true;\n }\n }\n });\n }\n}\n","import Api from './api.mjs';\nimport { setSelectedState } from './set-selected-state.mjs';\n\nexport default class Account {\n constructor() {\n this.api = new Api();\n this.hiddenClassName = 'TK-dn';\n\n /* profile menu */\n this.logoutLink = document.querySelector('#js-tlrk-nav-log-out');\n this.avatarImage = document.querySelector('#js-tlrk-nav-avatar-image');\n this.authenticatedContainer = document.querySelector('#js-tlrk-nav-auth-container');\n this.notAuthenticatedContainer = document.querySelector('#js-tlrk-nav-not-auth-container');\n\n /* support menu */\n this.supportMenu = document.querySelector('#js-tlrk-nav-ya-support-menu');\n\n /* products container and products menu */\n this.productsMenuContainer = document.querySelector('#js-tlrk-nav-ya-products-menu');\n this.productsMenu = document.querySelector('#js-tlrk-nav-ya-products-menu .TK-Dropdown-List'); // First in double dropdown\n\n this.isYourAccount = !!(this.supportMenu && this.productsMenu);\n this.isClientSideAuth = !!(this.authenticatedContainer && this.notAuthenticatedContainer);\n\n /* binder */\n this.setSignoutUrl = this.setSignoutUrl.bind(this);\n }\n\n /**\n * Profile Menu\n * @param {String} email - if user email is given user is logged in\n */\n populateProfileMenu(email) {\n if (!email || !this.api.env || !this.isClientSideAuth) {\n return Promise.resolve(false);\n }\n\n const { signoutUrl } = this.api.env; // already double encoded\n\n return this.api.getUserAvatarUrl(email).then((avatarUrl) => {\n if (!avatarUrl) return;\n\n this.avatarImage && this.avatarImage.setAttribute('src', avatarUrl);\n this.logoutLink && this.logoutLink.setAttribute('href', signoutUrl);\n\n this.authenticatedContainer && this.authenticatedContainer.classList.remove(this.hiddenClassName);\n this.notAuthenticatedContainer && this.notAuthenticatedContainer.classList.add(this.hiddenClassName);\n });\n }\n\n /**\n * Support Menu\n * @param {String} email - if user email is given user is logged in\n */\n populateSupportMenu(email) {\n if (!email || !this.isYourAccount) {\n return Promise.resolve(false);\n }\n\n return this.api\n .getVirtualClassRoomSupport()\n .then((support) => {\n if (support) {\n const newItem = '
  • On-Demand Product Training
  • ';\n this.supportMenu.classList.add('TK-Dropdown--230');\n this.supportMenu.insertAdjacentHTML('beforeend', newItem);\n }\n });\n }\n\n /**\n * Products Menu\n * @param {String} email - if user email is given user is logged in\n */\n populateProductsMenu(email) {\n if (!email || !this.isYourAccount) {\n return Promise.resolve(false);\n }\n\n return this.api.getMySkuCategories().then((categories) => {\n let html = '';\n\n if (!categories.length) {\n html = `\n
  • \n \n There are no purchased products\n Buy Products\n Purchase Individual Products Or DevCraft Value Bundles\n \n
  • \n `.trim();\n }\n else {\n html = categories.map((category) => {\n let href;\n\n if (category.type === 'Main') href = `/account/your-products?skucid=${category.id}`;\n if (category.type === 'Extension') href = `/account/your-products/extensions?skucid=${category.id}`;\n\n return `
  • ${category.name}
  • `;\n }).join('');\n }\n\n if (categories.length > 18) {\n this.productsMenuContainer.classList.add('TK-Dropdown--Full-Split');\n }\n\n this.productsMenu.innerHTML = html;\n });\n }\n\n /**\n * Rerender logout link on ng-location-changed handler\n */\n setSignoutUrl() {\n if (!this.api.env || !this.logoutLink) {\n return;\n }\n\n const currentHref = window.location.href;\n const doubleEncodedHref = encodeURIComponent(encodeURIComponent(currentHref));\n const { telerikWebsiteUrl, signoutBaseUrl } = this.api.env;\n const signoutUrl = `${telerikWebsiteUrl}${signoutBaseUrl}${doubleEncodedHref}`;\n\n this.logoutLink.setAttribute('href', signoutUrl);\n }\n}\n\n/**\n * Dispatch account ready event\n *\n * @param {String} email - value containg user email\n * @param {Boolean} isYourAccount - value indicating that user is in your account website\n */\nfunction dispatchAccountReadyEvent(email = null, isYourAccount = false) {\n const event = new CustomEvent('tk-account-ready', {\n detail: {\n email,\n isYourAccount\n }\n });\n\n document.dispatchEvent(event);\n}\n\n/**\n *\n */\nconst DASH_ID = '#js-tlrk-nav-dash';\nconst DRAWER_ID = '#js-tlrk-nav-drawer';\n\n/* eslint consistent-return: 0 */\nexport function initAccount() {\n const account = new Account();\n\n if (!account.api.available) return dispatchAccountReadyEvent(null, account.isYourAccount);\n if (!account.isClientSideAuth) return dispatchAccountReadyEvent(null, account.isYourAccount);\n\n const dash = document.querySelector(DASH_ID);\n const drawer = document.querySelector(DRAWER_ID);\n\n const initPromise = account.api.initAsync();\n const userEmailPromise = initPromise.then(() => account.api.getCurrentUserEmail());\n\n const handleSelectedState = () => {\n if (dash && drawer) {\n setSelectedState(dash);\n setSelectedState(drawer);\n }\n };\n\n const promises = [\n userEmailPromise.then((email) => account.populateProfileMenu(email)),\n userEmailPromise.then((email) => account.populateSupportMenu(email)),\n userEmailPromise.then((email) => account.populateProductsMenu(email))\n ];\n\n // IE Edge does not support Promise.prototype.finally ...\n const ready = () => {\n return userEmailPromise.then((email) => dispatchAccountReadyEvent(email, account.isYourAccount));\n };\n\n Promise\n .all(promises)\n .then(() => {\n handleSelectedState();\n ready();\n })\n .catch(() => {\n handleSelectedState();\n ready();\n });\n\n document.addEventListener('ng-location-changed', handleSelectedState);\n document.addEventListener('ng-location-changed', account.setSignoutUrl);\n}\n","import { interactive } from './interactive.mjs';\n\n/**\n * Init sticky element for browsers\n * that does not support natively position sticky from css\n */\n\n/* eslint no-console: [\"error\", { allow: [\"warn\", \"error\"] }] */\n\nfunction loadStickyElementScript() {\n return new Promise((resolve, reject) => {\n const script = document.createElement('script');\n const url = 'https://d6vtbcy3ong79.cloudfront.net/sticky-element/2.0.14/index.js';\n\n script.src = url;\n script.async = true;\n\n script.addEventListener('load', resolve);\n script.addEventListener('error', reject);\n\n document.body.appendChild(script);\n });\n}\n\nfunction isPositionStickySupported() {\n const testNode = document.createElement('div');\n const prefixes = ['', '-webkit-', '-moz-', '-ms-'];\n\n return prefixes.some((prefix) => {\n try {\n testNode.style.position = `${prefix}sticky`;\n }\n catch (error) {\n /* eslint no-empty: [\"error\", { \"allowEmptyCatch\": true }] */\n }\n\n return testNode.style.position !== '';\n });\n}\n\n/**\n * @param {Object} options - sticky element init options\n */\nexport function loadAndInitStickyElementIfNeeded(options) {\n if (isPositionStickySupported()) {\n // Position sticky is supported, no need to load StickyElement js\n return;\n }\n\n const initSticky = (stickyOptions) => {\n const stickyElement = window.StickyElement.create(stickyOptions);\n\n document.addEventListener('tk-update-sticky', () => {\n stickyElement.reset();\n stickyElement.update();\n });\n\n // usage\n // document.dispatchEvent(new CustomEvent('tk-update-sticky'));\n\n return stickyElement;\n };\n\n interactive().then(() => {\n if (window.StickyElement) {\n initSticky(options);\n }\n else {\n loadStickyElementScript()\n .then(() => initSticky(options))\n .catch((error) => console.error(`StickyElement script did not load. ${error.message}`));\n }\n });\n}\n","'use strict';\n\n/**\n * DOM Ready alternative\n */\nexport const interactive = () => {\n return new Promise((resolve) => {\n if (document.readyState !== 'loading') {\n resolve();\n }\n else {\n document.addEventListener('readystatechange', () => {\n if (document.readyState === 'interactive') {\n resolve();\n }\n });\n }\n });\n};\n","/* eslint no-use-before-define: [\"error\", { \"variables\": false, \"functions\": false }] */\n\nimport Overlay from './overlay.mjs';\nimport Dropdown from './dropdown.mjs';\nimport DropdownService from './dropdown-service.mjs';\nimport { settled } from './all-settled.mjs';\nimport { initAccount } from './account.mjs';\nimport { setSelectedState } from './set-selected-state.mjs';\n// import { initShoppingCartCounters } from './counters.mjs';\nimport { loadAndInitStickyElementIfNeeded } from './sticky-element.mjs';\n\n// css link files\nconst METRIC_ID = '#js-tlrk-nav-metric';\nconst STYLES_ID = '#js-tlrk-nav-styles';\n\n// nav dom selectors\nconst NAV_ID = '#js-tlrk-nav';\nconst DASH_ID = '#js-tlrk-nav-dash';\nconst DRAWER_ID = '#js-tlrk-nav-drawer';\nconst DRAWER_BUTTON_ID = '#js-tlrk-nav-drawer-button';\nconst OVERLAY_ID = '#js-tlrk-nav-overlay';\n\n// mobile constants\nconst MOBILE_BREAKPOINT = 1240;\nconst TOUCH_DEVICE = !!('ontouchstart' in window || navigator.maxTouchPoints);\n\nconst preventDefault = (event) => event.preventDefault();\nconst isBelowBreakpoint = () => Math.max(document.documentElement.clientWidth, window.innerWidth || 0) <= MOBILE_BREAKPOINT;\nconst isAboveBreakpoint = () => !isBelowBreakpoint();\n\nconst nav = document.querySelector(NAV_ID);\n\nconst qs = (selector) => nav && nav.querySelector(selector);\nconst qsa = (selector) => nav && Array.from(nav.querySelectorAll(selector));\n\n/**\n * Init all dropdowns in navigation\n */\nfunction initDropdowns() {\n if (!nav) {\n return;\n }\n\n const links = qsa('a, button');\n const lists = qsa('.TK-Dropdown');\n const dash = qs(DASH_ID);\n const drawer = qs(DRAWER_ID);\n const drawerButton = qs(DRAWER_BUTTON_ID);\n const overlayElement = qs(OVERLAY_ID);\n\n /**\n * Init overlay element\n */\n const overlay = new Overlay(overlayElement);\n\n /**\n * All visible desktop dropdowns proxy\n */\n const allDropdownsProxy = new DropdownService(lists, {\n click: true,\n hover: true,\n beforeOpenHook: () => {\n drawer && drawerMenu.close();\n allDropdownsProxy.close();\n isBelowBreakpoint() && overlay.show();\n },\n beforeCloseHook: () => {\n isBelowBreakpoint() && overlay.hide();\n }\n });\n\n /**\n * All dropdowns in drawer menu proxy\n */\n const inDrawerDropdownsProxy = new DropdownService(allDropdownsProxy.dropdowns.filter((dropdown) => drawer && drawer.contains(dropdown.element)));\n\n /**\n * Drawer Menu\n */\n const drawerMenu = new Dropdown(drawer, {\n click: true,\n hover: false,\n button: drawerButton,\n activeClass: 'TK-Drawer--Active',\n\n beforeOpenHook: () => {\n allDropdownsProxy.close();\n overlay.show();\n /**\n * Prevent drawer from closing when expanding inner dropdowns\n */\n inDrawerDropdownsProxy.off('tk-hover');\n inDrawerDropdownsProxy.off('tk-before-open-hook');\n inDrawerDropdownsProxy.off('tk-before-close-hook');\n },\n\n beforeCloseHook: () => {\n overlay.hide();\n inDrawerDropdownsProxy.on('tk-hover');\n inDrawerDropdownsProxy.on('tk-before-open-hook');\n inDrawerDropdownsProxy.on('tk-before-close-hook');\n }\n });\n\n /**\n * Prevent default on all buttons\n */\n if (TOUCH_DEVICE) {\n allDropdownsProxy.dropdowns\n .map((dropdown) => dropdown.button)\n .forEach((button) => button.addEventListener('click', preventDefault, false));\n }\n\n /**\n * Find elements that could gain focus handler\n * Close dropdowns when some of these link is focused\n */\n links\n .filter((link) => link !== overlay.element)\n .filter((link) => link !== drawerMenu.button)\n .filter((link) => !allDropdownsProxy.associate(link))\n .forEach((link) => link.addEventListener('focus', closeDropdownsWithDelay, false));\n\n /**\n * Add event handler on overlay\n */\n overlay.addEventListener('click', () => {\n drawerMenu.close();\n allDropdownsProxy.close();\n });\n\n /**\n * For some weird reason focus event is blocking click event from firing\n */\n function closeDropdownsWithDelay(delay = 128) {\n if (TOUCH_DEVICE) {\n return;\n }\n setTimeout(() => allDropdownsProxy.close(), delay);\n }\n\n /**\n * Resize handler\n */\n function toggleHover() {\n isAboveBreakpoint() ? allDropdownsProxy.on('tk-hover') : allDropdownsProxy.off('tk-hover');\n }\n\n /**\n * Add resize handler\n * @todo debounce/throttle\n */\n toggleHover();\n window.addEventListener('resize', toggleHover, false);\n\n /**\n * Add orientation change handler\n */\n window.addEventListener('orientationchange', () => {\n drawerMenu.close();\n allDropdownsProxy.close();\n }, false);\n\n /**\n * close dropdown in account spa\n */\n document.addEventListener('ng-location-changed', closeDropdownsWithDelay, false);\n\n /**\n * Set selected state\n */\n if (dash && drawer) {\n setSelectedState(dash);\n setSelectedState(drawer);\n }\n}\n\n/**\n * Try to prevent font flashing\n * Remove navigation loading class when css files are loaded\n */\nfunction handleFonts() {\n let fired = false;\n const { fonts } = document; // modern fonts api\n const metric = document.querySelector(METRIC_ID);\n const styles = document.querySelector(STYLES_ID);\n const isLoaded = (link) => !link.classList.contains('is-loading');\n\n const onload = () => {\n if (fired) return;\n\n requestAnimationFrame(() => {\n requestAnimationFrame(() => {\n nav.classList.remove('TK-Nav--Loading');\n nav.classList.add('TK-Nav--Loaded');\n });\n });\n\n fired = true;\n };\n\n // all browsers\n // with fast internet connection we will hit this case\n if (isLoaded(metric) && isLoaded(styles)) {\n return onload();\n }\n\n // modern browsers\n if (fonts) {\n // fast connection\n if (fonts.status === 'loaded') {\n return onload();\n }\n\n // slower connection\n const declarations = [\n '15px Metric-Light',\n '15px Metric-Medium',\n '15px Metric-Regular',\n '15px Metric-Semibold'\n ];\n\n const syncChecks = declarations.map((declaration) => fonts.check(declaration)); // Array\n const asyncChecks = declarations.map((declaration) => fonts.load(declaration)); // Array\n\n if (syncChecks.every(Boolean)) {\n return onload();\n }\n\n // Promise - resolves when fonts are loaded of failed\n const ready = settled(asyncChecks);\n\n // race metric and other fonts loading\n return Promise.race ? Promise.race([ready, fonts.ready]).then(onload).catch(onload) : ready.then(onload);\n }\n\n // older browsers - IE11 and below\n const waitForCSS = (link) => new Promise((resolve, reject) => {\n if (isLoaded(link)) {\n resolve();\n }\n else {\n // these events may never fire\n // if fonts load during javascript parsing\n link.addEventListener('load', resolve);\n link.addEventListener('error', reject);\n\n /* eslint no-confusing-arrow: \"off\" */\n setTimeout(() => isLoaded(link) ? resolve() : reject(), 512);\n }\n });\n\n return settled([waitForCSS(metric), waitForCSS(styles)]).then(onload);\n}\n\n/**\n * Init skip to content\n */\nfunction initSkipToContent() {\n const skipLink = qs('#js-tlrk-skip-link');\n const skipElement = document.createElement('div');\n skipElement.classList.add('TK-Nav-Skipper');\n skipElement.tabIndex = 0;\n skipLink.addEventListener('click', (event) => {\n nav.after(skipElement);\n skipLink.blur();\n skipElement.focus();\n skipElement.remove();\n event.preventDefault();\n });\n}\n\n/**\n * Init whole navigation\n */\nfunction init() {\n if (window.TLRK_NAV_INITIALIZED) {\n return;\n }\n\n initAccount();\n initDropdowns();\n // NOTE Temporary disable counters and always point shopping cart link to shopping cart website\n // FIXME Integrate with new account API REST service to replace the OSC_SESSION cookie behaviour when ready\n // initShoppingCartCounters();\n\n // remove loading class\n requestAnimationFrame(handleFonts);\n\n loadAndInitStickyElementIfNeeded({\n top: 0,\n fixClass: 'TK-Bar--Sticky',\n selector: '#js-tlrk-nav .TK-Bar',\n breakpoint: MOBILE_BREAKPOINT\n });\n\n initSkipToContent();\n window.TLRK_NAV_INITIALIZED = true;\n}\n\n/**\n * Exports\n */\nexport default init;\n"],"names":["defaults","activeClass","Overlay","constructor","element","options","this","Object","assign","hidden","show","classList","add","hide","remove","addEventListener","event","listener","capture","SUPPORT_TRANSITIONS","document","documentElement","style","fn","f","hover","click","beforeOpenHook","beforeCloseHook","Dropdown","closed","running","parent","parentElement","button","firstElementChild","init","run","transition","window","getComputedStyle","split","transitionEndHandler","removeEventListener","open","bind","close","closeOnEscape","keyCode","toggle","requestAnimationFrame","contains","node","associate","result","method","bound","on","eventType","off","deface","preventHandler","preventDefault","DropdownService","elements","Array","isArray","dropdowns","map","forEach","dropdown","settled","promises","Promise","allSettled","all","catch","resolve","FETCH","fetch","PROMISE","headers","Accept","credentials","Api","hostname","getHostname","_defaults","url","getApiUrl","isStore","includes","online","navigator","onLine","available","rejection","Error","json","res","ok","statusText","location","toLowerCase","API_URL","divisions","subdomain","name","tld","len","length","tlrk","startsWith","prgs","store","substring","initAsync","getEnvironment","then","env","currentHref","href","doubleEncodedHref","encodeURIComponent","signoutUrl","telerikWebsiteUrl","signoutBaseUrl","reject","endpoint","getCurrentUserEmail","tryGetCurrentUserEmail","email","getUserAvatarUrl","encoded","getLoggedInState","getBasicProfile","getShoppingCartItemsCount","shoppingCartSessionId","getExpiringProductsCount","data","Number","expiring","getMySkuCategories","getVirtualClassRoomSupport","SELECTED_CLASS","qsa","selector","from","querySelectorAll","setSelectedState","item","pathname","search","link","matchExact","hasAttribute","matchSearch","matchStartsWith","matchPattern","indexOf","RegExp","getAttribute","test","selectedLinks","topLevelSelectedLinks","firstExactMatchLink","find","filter","slice","buttonMatched","closest","querySelector","Account","api","hiddenClassName","logoutLink","avatarImage","authenticatedContainer","notAuthenticatedContainer","supportMenu","productsMenuContainer","productsMenu","isYourAccount","isClientSideAuth","setSignoutUrl","populateProfileMenu","avatarUrl","setAttribute","populateSupportMenu","support","newItem","insertAdjacentHTML","populateProductsMenu","categories","html","category","type","id","join","trim","innerHTML","dispatchAccountReadyEvent","CustomEvent","detail","dispatchEvent","loadAndInitStickyElementIfNeeded","testNode","createElement","some","prefix","position","error","isPositionStickySupported","initSticky","stickyOptions","stickyElement","StickyElement","create","reset","update","readyState","script","src","async","body","appendChild","console","message","TOUCH_DEVICE","maxTouchPoints","isBelowBreakpoint","Math","max","clientWidth","innerWidth","nav","qs","initDropdowns","links","lists","dash","drawer","drawerButton","overlayElement","overlay","allDropdownsProxy","drawerMenu","inDrawerDropdownsProxy","closeDropdownsWithDelay","delay","setTimeout","toggleHover","handleFonts","fired","fonts","metric","styles","isLoaded","onload","status","declarations","syncChecks","declaration","check","asyncChecks","load","every","Boolean","ready","race","waitForCSS","TLRK_NAV_INITIALIZED","account","userEmailPromise","handleSelectedState","initAccount","top","fixClass","breakpoint","skipLink","skipElement","tabIndex","after","blur","focus","initSkipToContent"],"mappings":"yBAEA,MAAMA,EAAW,CACfC,YAAa,0BAGA,MAAMC,EACnB,WAAAC,CAAYC,EAASC,GAEnBC,KAAKD,QAAUE,OAAOC,OAAO,CAAE,EAAER,EAAUK,GAC3CC,KAAKF,QAAUA,EACfE,KAAKL,YAAcK,KAAKD,QAAQJ,YAChCK,KAAKG,QAAS,CAClB,CAEE,IAAAC,GACOJ,KAAKG,QAAWH,KAAKF,UAC1BE,KAAKF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