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,IAAO,IACL,IAAM,IAE9B,WAARC,EAAE,IAES,OADVF,EAAMC,EAAGqZ,MAAM,wBACQ,CAAC3oB,KAAKqP,EAAI,GAAG3O,QAAQ,MAAO,SAAS6qB,QAAQlc,EAAI,KAE5EE,EAAIA,EAAE,GAAI,CAACA,EAAE,GAAIA,EAAE,IAAK,CAAC6b,UAAUK,QAASL,UAAUM,WAAY,MACzB,OAArCrc,EAAMC,EAAGqZ,MAAM,qBACfpZ,EAAEuG,OAAO,EAAG,EAAGzG,EAAI,IAChB,CAACrP,KAAKuP,EAAE,GAAIgc,QAAQhc,EAAE,MAQjClR,EAAG7B,UAAW6O,OAAM,WAChBvL,QAAQhB,IAAI,sBAAsBssB,UAAUC,aAAarrB,KAAMorB,UAAUC,aAAaE,WAL5B,IAM/BH,UAAUM,WANpBpJ,OAAO,8BAM2D,MAA/B8I,UAAUC,aAAarrB,MAAgBorB,UAAUC,aAAaE,QAAU,OACxHltB,EAAE,4BAA4BstB,MAAM,OAE5C,IAEAnvB,SAASkT,OAAS","sources":["webpack://tcm-digital/./docroot/libraries/truncata/truncata.js","webpack://tcm-digital/webpack/bootstrap","webpack://tcm-digital/webpack/runtime/compat get default export","webpack://tcm-digital/webpack/runtime/define property getters","webpack://tcm-digital/webpack/runtime/hasOwnProperty shorthand","webpack://tcm-digital/./docroot/themes/custom/bacall/js/global/tracking-metrics.js","webpack://tcm-digital/./docroot/themes/custom/bacall/js/global/modal.js","webpack://tcm-digital/./docroot/themes/custom/bacall/js/components/Schema.js","webpack://tcm-digital/./docroot/themes/custom/bacall/js/global/trending-block.js","webpack://tcm-digital/./docroot/themes/custom/bacall/js/global/search-overlay.js","webpack://tcm-digital/./docroot/themes/custom/bacall/js/global/modal-carousel.js","webpack://tcm-digital/./docroot/themes/custom/bacall/js/components/search-page.js","webpack://tcm-digital/./docroot/themes/custom/bacall/js/components/film-detail.js","webpack://tcm-digital/./docroot/themes/custom/bacall/js/bacall.js","webpack://tcm-digital/./docroot/themes/custom/bacall/js/components/index-page.js","webpack://tcm-digital/./docroot/themes/custom/bacall/js/global/sticky-nav.js","webpack://tcm-digital/./docroot/themes/custom/bacall/js/global/responsive-sub-nav.js","webpack://tcm-digital/./docroot/themes/custom/bacall/js/components/schedule-daily.js","webpack://tcm-digital/./docroot/themes/custom/bacall/js/components/schedule-monthly.js","webpack://tcm-digital/./docroot/themes/custom/bacall/js/components/video-player.js","webpack://tcm-digital/./docroot/themes/custom/bacall/js/components/trending-page.js","webpack://tcm-digital/./docroot/themes/custom/bacall/js/global/side-nav.js","webpack://tcm-digital/./docroot/themes/custom/bacall/js/components/hosts.js","webpack://tcm-digital/./docroot/themes/custom/bacall/js/components/this-month.js","webpack://tcm-digital/./docroot/themes/custom/bacall/js/global/footer-ribbon.js","webpack://tcm-digital/./docroot/themes/custom/bacall/js/global/polyfill.js","webpack://tcm-digital/./docroot/themes/custom/bacall/js/components/video-page.js"],"sourcesContent":["/**\n truncata - truncata is a javascript plugin that truncates \n @version v2.1.1\n Vanilla JavaScript (no external dependencies)\n Multi Browser support and cross device (IE11/Edge, Android, IOS, ...)\n Responsiveness (diff screen sizes and devices)\n Accesability (page zoom)\n Different fonts and css styles\n @author Carlos Vega \n @license MIT\n**/\n(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n typeof define === 'function' && define.amd ? define(factory) :\n (global = global || self, global.truncata = factory());\n } (this, ( function () {\n 'use strict';\n\n var defaults = {\n lines: 2,\n percentage: 80,\n decoration: '...',\n throttlingDelay: 250,\n dataAttributeName: 'truncata'\n };\n\n var extend = function () {\n\t\tvar merged = {};\n\t\tArray.prototype.forEach.call(arguments, function (obj) {\n\t\t\tfor (var key in obj) {\n\t\t\t\tif (!obj.hasOwnProperty(key)) return;\n\t\t\t\tmerged[key] = obj[key];\n\t\t\t}\n\t\t});\n\t\treturn merged;\n\t};\n\n var Constructor = function (target, options) {\n \n var API = {}, els, ctx, settings;\n\n var setup = function () {\n if (typeof target === 'undefined') throw Error('target is required');\n els = typeof target === 'string' ? document.querySelectorAll(target) : target;\n if (!els) return;\n if (!('length' in els)) els = [els];\n if (ctx === undefined){\n var canvas = document.createElement('canvas');\n document.createDocumentFragment().appendChild(canvas);\n ctx = canvas.getContext(\"2d\");\n }\n };\n\n var truncateElements = function () {\n for (var i = 0; i < els.length; i += 1) {\n var elm = els[i];\n var content = '';\n if (elm.dataset[settings.dataAttributeName] === undefined) {\n elm.setAttribute('data-'+settings.dataAttributeName, elm.innerHTML);\n content = elm.innerHTML;\n } else {\n content = elm.dataset[settings.dataAttributeName];\n }\n if(content.length <=0) continue;\n elm.innerHTML = truncateElementContent(elm, content);\n }\n };\n\n var truncateElementContent = function (elm, content) {\n var width = elm.getBoundingClientRect().width;\n if (width === 0) return null;\n var style = window.getComputedStyle(elm);\n var font = [style['font-weight'], style['font-style'], style['font-size'], style['font-family']].join(' ');\n ctx.font = font;\n var max_parragh_width = ((settings.lines-1)*width)+(settings.percentage * width)/100;\n if (max_parragh_width >= ctx.measureText(content).width) return content;\n var accumulatedSize = 0;\n var founded = false;\n var buffer = content.split(' ').reduce( function (acc, cur, i, arr) {\n var size = (ctx.measureText(cur+' ').width+accumulatedSize);\n if (accumulatedSize>=max_parragh_width) {\n return acc;\n }\n if (!founded) {\n if(size 0) {\n throttled = true;\n setTimeout(function() {\n truncateElements();\n throttled = false;\n }, settings.throttlingDelay);\n } else if (!settings.throttlingDelay || settings.throttlingDelay==0) {\n truncateElements();\n }\n };\n\n API.destroy = function () {\n window.removeEventListener('resize', resizeHandler, false);\n if (els && els.length !== undefined) {\n for (var i = 0; i < els.length; i += 1) {\n var elm = els[i];\n if (elm.dataset[settings.dataAttributeName] !== undefined) {\n elm.innerHTML = elm.dataset[settings.dataAttributeName];\n elm.removeAttribute('data-'+settings.dataAttributeName);\n }\n }\n }\n\n els = undefined;\n ctx = undefined;\n return true;\n };\n\n var init = function () {\n settings = extend(defaults, options || {});\n setup();\n truncateElements();\n window.addEventListener('resize', resizeHandler, false);\n };\n\n init();\n\t\treturn API;\n };\n\n return Constructor;\n })));","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","\nexport default class TrackingMetrics {\n\n static initialize() {\n\n document.addEventListener('DOMContentLoaded', loadTrackingMetrics, false);\n document.addEventListener('DOMContentLoaded', appendIcidToMenus, false);\n\n\n // Log Wrapping and display logs only if in debug mode\n // https://eslint.org/docs/rules/no-console\n var url = window.location.href;\n var debug_parameter = 'debug';\n var DEBUG = (url.indexOf(debug_parameter) == -1) ? false : true; // Enable logging\n\n // * Prevent errors on console methods when no console present.\n // * Use log() and warn();\n\n window.log = function () {\n if (DEBUG && window.console) {\n console.log.apply(console, arguments);\n }\n }\n\n window.warn = function () {\n if (DEBUG && window.console) {\n console.warn.apply(console, arguments);\n }\n }\n\n /**\n *\n */\n function loadTrackingMetrics() {\n // Top Menu Item\n $(\"#block-tcmmainnavigation .menu-item\").children(\"a\").on(\"click\", function() {\n var trackMetricsObj = {\n type: \"top-menu-click\",\n data: {\n url: $(this).attr(\"href\")\n }\n };\n\n try {\n log('[TCM_METRICS] - [top-menu-click]',trackMetricsObj);\n window.trackMetrics(trackMetricsObj);\n } catch (e) {\n warn('[TCM_ANALYTICS] - [top-menu-click]',e);\n }\n });\n\n // Footer Social Links\n $(\".footer-social-link\").on(\"click\", function() {\n var trackMetricsObj = {\n type: \"social-click\",\n data: {\n socialType: $(this).data(\"id\")\n }\n };\n\n try {\n log('[TCM_METRICS] - [social-click]',trackMetricsObj);\n window.trackMetrics(trackMetricsObj);\n } catch (e) {\n warn('[TCM_ANALYTICS] - [social-click]',e);\n }\n });\n\n /**\n * [Video Page] - Related Video Click Interaction\n */\n $(\".video-page__related-video__block\").on(\"click\", function() {\n var trackMetricsObj = {\n type: \"click-interaction\",\n data: \"video-clip\"\n };\n document.addEventListener('beforeunload', trackClickInteraction(trackMetricsObj), false);\n });\n }\n\n /**\n * Appends ?icid= tracking info to various site sections\n */\n function appendIcidToMenus() {\n // Main navigation\n $(\"#block-tcmmainnavigation .menu-item\").each(function(i) {\n let linkObj = $(this).find('a').first();\n TrackingMetrics.addTrackingToLink(linkObj, \"mainnav\", i);\n });\n\n // Secondary navigation\n $(\".tcm-main-navigation__desktop__bottom-level .menu-item\").each(function(i) {\n let linkObj = $(this).find('a').first();\n TrackingMetrics.addTrackingToLink(linkObj, \"espnav\", i);\n });\n\n // Footer menu links\n $(\".tcm-footer .menu-item\").find(\"a\").each(function(i) {\n TrackingMetrics.addTrackingToLink($(this), \"footer\", i);\n });\n\n // Footer social links\n $(\".footer__social-links__wrap .footer-social-link\").each(function(i) {\n TrackingMetrics.addTrackingToLink($(this), \"footer-social\", i);\n });\n\n // Newsletter sign up\n TrackingMetrics.addTrackingToLink($(\".sign-up-link\"), \"footer-newsletter\");\n }\n\n /**\n * [ Video Page] - Track click interaction on thumbnail clicks\n */\n function trackClickInteraction(metricsObj) {\n try {\n log('[TCM_METRICS] - [click-interaction]', metricsObj);\n window.trackMetrics(metricsObj);\n } catch (e) {\n warn('[TCM_METRICS] - [click-interaction]',e);\n }\n }\n }\n\n\n /**\n * Adds icid tracking param\n * @param linkObj\n * @param name\n * @param position\n */\n static addTrackingToLink(linkObj, name, position, text)\n {\n if (linkObj === undefined) {\n return;\n }\n\n let linkHref = linkObj.attr(\"href\");\n\n if (linkHref === undefined || linkHref.indexOf(\"icid=\") >= 0) {\n return; // link already has tracking\n }\n\n let linkText = text;\n if (linkText === undefined) {\n linkText = linkObj.attr(\"data-title\");\n\n if (linkText === undefined) {\n linkText = linkObj.attr(\"data-id\");\n }\n\n if (linkText === undefined) {\n linkText = linkObj.text();\n }\n }\n\n linkText = TrackingMetrics.formatText(linkText);\n\n let linkPos = (position === undefined) ? \"\" : position + 1;\n let linkParam = \"icid=\" + name + linkPos + \"-\" + linkText;\n\n linkHref = linkHref + ((linkHref.indexOf(\"?\") >= 0) ? \"&\" : \"?\") + linkParam;\n linkObj.attr(\"href\", linkHref);\n }\n\n /**\n * Append tracking metrics to bottom menu\n * Needs it's own method since menu is tore down and rebuilt in responsive-sub-nav\n */\n static bottomMenu() {\n $(\".tcm-main-navigation__desktop__bottom-level .menu-item:not(.flyout) a\").on(\"click\", function() {\n var trackMetricsObj = {\n type: \"secondary-menu-click\",\n data: {\n url: $(this).attr(\"href\")\n }\n }\n\n try {\n log('[TCM_METRICS] - [secondary-menu-click]', trackMetricsObj);\n window.trackMetrics(trackMetricsObj);\n } catch (e) {\n warn('[TCM_ANALYTICS] - [secondary-menu-click]: ' + $(this).text().trim(),e);\n }\n });\n }\n\n /**\n * Format text to append to tracking url\n * @param text\n * @returns {*}\n */\n static formatText(text)\n {\n if (text === undefined) {\n return \"\";\n }\n\n text = text.toLowerCase().replace(/[^a-zA-Z\\d\\s]/gi, \"\");\n text = text.replace(/ /g, \"-\");\n return text;\n }\n}\n","/**\n * Initializes TCM Modals\n */\nexport default class Modal {\n\n /**\n * Runs when an instance of the class is created\n * @param data\n * @param options\n */\n constructor(data, options) {\n // Initialize modal with structure markup\n // main--carousel was main--archive\n this.modal_template = \n `
\n
\n
\n
\n \n
\n
\n
\n \n
\n
\n
\n
`;\n\n // If options is not passed in, create defaults\n options = options || {onOpen: null, onClose: null};\n\n // Add custom events if they exist\n if (options.onOpen !== null)\n this.custom_open_callback = options.onOpen.bind(this);\n\n if (options.onClose !== null)\n this.custom_close_callback = options.onClose.bind(this);\n\n // Initialize other defaults and default event listeners\n this.modal_selector = '#modal-overlay';\n this.modal_open_class = 'modal-open';\n this.modal_close_selector = '.modal-overlay__close-button';\n this.modal_sidebar_close_selector = '.modal-overlay__content__sidebar__close-button';\n this.modal_player_close_selector = '.watch__player__return';\n this.data = data;\n this.is_open = false;\n\n this._setupEventListeners();\n }\n\n /**\n * Opens the modal called before Tiles.js\n */\n open() { \n // check if there is an already present modal on the page and close it if so\n if ($(`body > ${this.modal_selector}`).length) {\n this.close();\n }\n\n // append the modal to the body and pass in template\n $('body').addClass(this.modal_open_class).append(this.modal_template);\n \n // if player modal type, inject player into modal and hide default close button\n if ( this.data.type === 'player' ) {\n \n $('.modal-overlay__content__main').append(this.data.template);\n\n $(this.modal_close_selector).hide();\n }\n // if sidebar modal type, inject sidebar and toggleable content\n else if ( this.data.type === 'sidebar' ) {\n \n $('.modal-overlay__content__sidebar').append(this.data.sidebarTemplate);\n $('.modal-overlay__content__main').append(this.data.toggleTemplate);\n // add close button to sidebar\n $('.modal-overlay__content__main').append('');\n\n $(this.modal_close_selector).hide();\n } else if ( this.data.type === 'text' ) {\n \n $('.modal-overlay__content__main--text').append(this.data.fullText);\n }else if (this.data.overlay_type === 'slider'){\n $('.modal-overlay__content__main').prepend('');\n }\n\n this.is_open = true;\n // console.log(this.data);\n\n // Call additional custom onOpen callback if it exists\n if ( typeof this.custom_open_callback === \"function\") {\n this.custom_open_callback(this.data);\n }\n };\n\n /**\n * Closes the modal\n */\n close() {\n\n // remove modal\n $(this.modal_selector).detach();\n $('body').removeClass(this.modal_open_class);\n this.is_open = false;\n\n // Call additional custom onClose callback if it exists\n if (this.custom_close_callback !== undefined) {\n this.custom_close_callback(this.data);\n } \n }\n\n /**\n * Returns TRUE if the current instance of the modal is open.\n */\n getIsOpen() {\n return this.is_open;\n }\n\n /**\n * Sets up event listeners for modal\n * @private\n */\n _setupEventListeners(){\n $(document).on('click', this.modal_close_selector + ', ' + this.modal_player_close_selector + ', ' + this.modal_sidebar_close_selector, (e) => {\n this.close();\n \n });\n }\n}\n","export const createVideoObjectSchema = data => {\n const { publishedDate, titleConsumer, imageUrl, description, contentUrl } = data;\n return {\n '@context': 'https://schema.org',\n '@type': 'VideoObject',\n name: titleConsumer,\n uploadDate: publishedDate,\n url: `${window.location.origin}${contentUrl}`,\n contentUrl: `${window.location.origin}${contentUrl}`,\n description: description,\n thumbnailUrl: imageUrl ||\n 'https://prod-images.tcm.com/img/schedule-page/placeholder-vod-film.jpg',\n };\n};\n\nexport const createArticleSchema = data => {\n const { publishedDate, modifiedDate, author, titleConsumer, imageUrl, description, contentUrl, consumerTitleOG } = data;\n return {\n '@context': 'https://schema.org',\n '@type': 'Article',\n headline: titleConsumer || consumerTitleOG,\n datePublished: publishedDate,\n dateModified: modifiedDate,\n url: `${window.location.origin}${contentUrl}`,\n description: description,\n author: {\n '@type': 'Person',\n name: author || 'Turner Classic Movies',\n },\n image: imageUrl ||\n 'https://prod-images.tcm.com/img/schedule-page/placeholder-vod-film.jpg',\n publisher: {\n '@type': 'Organization',\n name: 'Turner Classic Movies',\n alternateName: 'TCM',\n logo: {\n '@type': 'ImageObject',\n url: 'https://prod-images.tcm.com/img/global/logo-TCM-share-1200x630.jpg',\n },\n },\n mainEntityOfPage: {\n '@type': 'WebPage',\n '@id': `${window.location.origin}${contentUrl}`,\n },\n };\n};\n\nexport const createBroadcastEventSchema = (data) => {\n const { Storyline, durationISO8601, profileImage, Name, SortDate, StartDate, EndDate, CreatedDate } = data;\n const scriptText = {\n '@context': 'https://schema.org',\n '@type': 'VideoObject',\n description: Storyline,\n duration: durationISO8601 || '',\n name: 'Watch TCM Live',\n thumbnailUrl: profileImage ||\n 'https://prod-images.tcm.com/img/schedule-page/placeholder-vod-film.jpg',\n uploadDate: CreatedDate || SortDate,\n publication: {\n '@type': 'BroadcastEvent',\n name: Name,\n isLiveBroadcast: true,\n startDate: StartDate,\n endDate: EndDate,\n },\n };\n appendSchema(scriptText);\n};\n\nexport const createItemListSchema = (data, type = 'VideoObject') => {\n const scriptText = {\n '@context': 'https://schema.org/',\n '@type': 'ItemList',\n itemListElement: [],\n };\n if (type === 'VideoObject') {\n data.forEach((item, i) => {\n const { Storyline, durationISO8601, profileImage, Name, SortDate, CreatedDate, TitleId } = item;\n const itemFormatted = {\n '@context': 'https://schema.org',\n '@type': 'VideoObject',\n position: i + 1,\n name: Name,\n url: `${window.location.origin}/tcmdb/title/${TitleId}/${encodeURIComponent(\n Name)}/`,\n description: Storyline,\n thumbnailUrl: profileImage ||\n 'https://prod-images.tcm.com/img/schedule-page/placeholder-vod-film.jpg',\n uploadDate: CreatedDate || SortDate,\n duration: durationISO8601 || '',\n };\n scriptText.itemListElement.push(itemFormatted);\n });\n }\n else if (type === 'mixed') {\n data.forEach((item, i) => {\n const itemFormatted = item.contentType === 'video' ?\n createVideoObjectSchema(item) : createArticleSchema(item);\n itemFormatted.position = i + 1;\n scriptText.itemListElement.push(itemFormatted);\n });\n }\n appendSchema(scriptText);\n};\n\nexport const appendSchema = structuredData => {\n const type = structuredData['@type'];\n const scriptEl = document.getElementById('schema' + type);\n if (scriptEl) {\n let contentJSON = JSON.parse(scriptEl.textContent);\n let itemListArray = JSON.parse(scriptEl.textContent)['itemListElement'];\n contentJSON['itemListElement'] = itemListArray.concat(structuredData['itemListElement']);\n scriptEl.textContent = JSON.stringify(contentJSON);\n } else {\n const script = document.createElement('script');\n script.setAttribute('id', 'schema' + type);\n script.setAttribute('type', 'application/ld+json');\n script.textContent = JSON.stringify(structuredData);\n document.head.appendChild(script);\n }\n};\n","import TrackingMetrics from \"./tracking-metrics\";\nimport { createItemListSchema } from '../components/Schema';\n\nexport default class trendingBlock {\n\n static initialize(UrlPathname, apiURL) {\n\n // fire only on homepage\n if(UrlPathname == '/' || UrlPathname == '/video-player' || UrlPathname == '/tcmdb' || UrlPathname == '/video'){\n\n // film-detail and particpant pages only display 3 tiles in trending desktop but shows 4 in tablet view, video-player and index show 4\n let colType = '4';\n\n if(UrlPathname == '/tcmdb'){\n colType = 'tcmdb';\n }\n\n // loads content for Trending on TCM on index page.\n $.ajax({\n url: `${apiURL}/tcmws/trending`,\n type: \"GET\",\n success: function(data) {\n let processedTitle = '';\n const titleLength = 85;\n let indexTrending = 0;\n createItemListSchema(data.slice(0,4), 'mixed');\n $.each(data, function(index, item) {\n if (item.itemStatus.toLocaleLowerCase() === 'published') {\n // Only show 4 items\n if(indexTrending < 4){\n // check title length and truncate if necessary\n if (item.titleConsumer.length > 85) {\n processedTitle = item.titleConsumer.substring(0, titleLength) + '...';\n } else {\n processedTitle = item.titleConsumer;\n }\n\n let titleCleaned = item.titleConsumer.toString().replace(/[^a-zA-Z\\d\\s]/gi, '');\n titleCleaned = $.trim(titleCleaned);\n\n $(function() {\n if(item.contentType == 'article'){\n $(\"#trending-on-tcm\").append(`\n \n \n
\n \"${titleCleaned}\"/\n
\n ${item.titleConsumer}\n
\n
\n `);\n }else{\n $(\"#trending-on-tcm\").append(`\n \n \n
\n \"${titleCleaned}\"\n
\n
\n ${item.titleConsumer}\n
\n
\n `);\n }\n });\n indexTrending++;\n }\n }\n });\n\n $(\".tcm-trending-wrapper\").each(function(i) {\n $(this).on(\"click\", function() {\n let linkText = $(this).find('a').first().attr(\"data-title\");\n let linkTextFormated = TrackingMetrics.formatText(linkText);\n try {\n window.trackMetrics({\n type: 'click-interaction',\n data: {\n url: \"trending-on-tcm\" + i + \"-\" + linkTextFormated,\n interaction: \"trending-on-tcm\",\n interactionevent: 1\n }\n });\n } catch (e) {\n console.log(\"Unable to track trending-on-tcm\" + i + \"-\" + linkTextFormated);\n }\n });\n });\n\n },\n error: function(error) {\n console.log(`error connecting to Trending API ${apiURL}/tcmws/trending/\\n${error}\\non page: trending-block.js`);\n }\n });\n }\n }\n}\n","\nexport default class SearchFlyout {\n /**\n * Controlls the Universal Search on Global Nav\n * the following is absolute garbage.\n */\n static initialize(deviceWidth, apiURL, passedEvent) {\n let currentOrientation = '';\n let device = '';\n let deviceWas = ''\n let universalSearchIconMoblie = document.querySelector('.tcm-main-navigation__mobile__search');\n let universalSearchBar = document.querySelector('.search__header');\n let universalSearchBarClear = Array.from(document.querySelectorAll('.search__input__clear'));\n // Input Clear Btn - there are 2 on page named the same\n let universalSearchBarClearDesktop = universalSearchBarClear[0];\n let universalSearchBarClearMobile = universalSearchBarClear[1];\n\n let jqUniversalSearchInput;\n let positionOptions; // the position of suggestions relative to appendElement\n let appendElement; // element to append the suggestions to\n const suggestionsMobileTarget = '#search__billboard--mobile';\n const suggestionDefaultTarget = '.tcm-main-navigation__desktop__bottom-level ';\n\n currentOrientation = (window.innerWidth > window.innerHeight) ? 'landscape' : 'portrait';\n\n //@TODO: replace this logic with device/OS detection utility when that is made\n //if ( (deviceWidth < 550 && window.matchMedia('(orientation: portrait)').matches) || (deviceWidth >= 550 && deviceWidth < 1280 && window.matchMedia('(orientation: landscape)').matches)) {\n if ( (deviceWidth <= 550 ) ) {\n // if mobile portrait or landscape\n console.log('mobile detction')\n device = 'mobile';\n jqUniversalSearchInput = $('#suggest');\n positionOptions = { my : 'left top', at: 'left bottom', of: suggestionsMobileTarget };\n appendElement = $(suggestionsMobileTarget);\n //} else if ( deviceWidth > 550 && deviceWidth < 1280 && window.matchMedia('(orientation: portrait)').matches) {\n } else if ( deviceWidth > 550 && deviceWidth < 1280 ) {\n // tablet portrait\n console.log('tablet detction')\n device = 'tablet';\n jqUniversalSearchInput = $('#suggest');\n positionOptions = { my : 'left top', at: 'left bottom', of: suggestionsMobileTarget };\n appendElement = $(suggestionsMobileTarget);\n } else {\n // tablet landscape and desktop\n console.log('desktop detction')\n device = 'desktop';\n jqUniversalSearchInput = $('.tcm-main-navigation__desktop__search ');\n positionOptions = { my : 'right top-76', at: 'right bottom', of: suggestionDefaultTarget };\n appendElement = $(suggestionDefaultTarget);\n }\n\n // Delete inputBox value on-load but not on orientation change\n //console.log('Test - passedEvent: ', passedEvent);\n let contentForOrientationChange = $('.ui-autocomplete .ui-menu-item ') || null;\n if (passedEvent === null) {\n jqUniversalSearchInput.val('');\n } else if (passedEvent.type === 'orientationchange') {\n\n // copy value from old input field to new input field\n //if (device === 'desktop' && currentOrientation === 'landscape') {\n if (device === 'desktop' && deviceWas !== 'desktop') {\n\n // if landscape tablet or desktop, copy value from mobile search bar then hide mobile bar...\n $('.tcm-main-navigation__desktop__search').val( $('#search__billboard--mobile .search-page__input').val() ).focus();\n\n if (jqUniversalSearchInput.val() !== '') {\n jqUniversalSearchInput.focus();\n jqUniversalSearchInput.select();\n jqUniversalSearchInput.addClass('active')\n }\n $('#search__billboard--mobile #suggest').autocomplete( \"destroy\" );\n\n //} else if (device ==='tablet' && currentOrientation === 'portrait') {\n } else if (device ==='tablet' && deviceWas !== 'tablet') {\n\n // if tablet portrait, copy value from desktop search then clear desktop search\n $('#search__billboard--mobile .search-page__input').val( $('.tcm-main-navigation__desktop__search').val() )\n jqUniversalSearchInput.focus();\n jqUniversalSearchInput.select();\n jqUniversalSearchInput.addClass('active')\n $('.tcm-main-navigation__desktop__search').autocomplete( \"destroy\" );\n }\n runAutoComplete(passedEvent, contentForOrientationChange);\n }\n\n // Mobile Search Flyout\n universalSearchIconMoblie.addEventListener('click', function(){\n this.classList.toggle('active'); // Toggle active class on Icon\n universalSearchBar.classList.toggle('active'); // activate SearchBox\n // Toggle class on Search Icon Click\n if(this.classList.contains('active')){\n jqUniversalSearchInput.focus();\n }\n });\n\n // Mobile Clear Search-Bar\n universalSearchBarClearMobile.addEventListener('click',function(e){\n jqUniversalSearchInput.val('').focus();\n $('.tcm-main-navigation__desktop__search').val('')\n jqUniversalSearchInput.autocomplete( \"destroy\" );\n appendElement.autocomplete( \"destroy\" );\n this.classList.add('hidden');\n })\n\n // Destkop clear btn\n universalSearchBarClearDesktop.addEventListener('click',function(e){\n jqUniversalSearchInput.focus().val('');\n $('#suggest').val('')\n jqUniversalSearchInput.autocomplete( \"destroy\" );\n appendElement.autocomplete( \"destroy\" );\n this.classList.remove('active');\n })\n\n jqUniversalSearchInput.on('keyup', runAutoComplete);\n\n function runAutoComplete (e) {\n\n // if User Presses enter rather than clicking an auto respond link\n if (e.type === 'keyup') {\n // Do nothing if input box is empty\n if(e.which == 13 && jqUniversalSearchInput.val() !== '') {\n // filter out special chars.\n let searchValue = escape(jqUniversalSearchInput.val());\n //let searchValue = jqUniversalSearchInput.val().replace(/[^\\w\\s]/gi, '');\n //let searchValue = jqUniversalSearchInput.val().replace(/[^a-zA-Z0-9& ]/gi, '')\n window.location = `/search?${encodeURI(searchValue)}`;\n // If user backspaces and input is empty\n }else if(e.which == 8 && $(this).val() == ''){\n jqUniversalSearchInput.autocomplete( \"destroy\" );\n }\n }\n $('item').keyup();\n // When searchbox is not empty, show clearbtn\n if(jqUniversalSearchInput.val() !== ''){\n\n // if desktop clearbtn is sibling\n if( deviceWidth < 1280 ){\n universalSearchBarClearDesktop.classList.add('hidden');\n universalSearchBarClearDesktop.classList.remove('active');\n universalSearchBarClearMobile.classList.add('active');\n universalSearchBarClearMobile.classList.remove('hidden');\n\n $('#search__header--mobile').addClass('active');\n }else{\n universalSearchBarClearDesktop.classList.add('active');\n universalSearchBarClearDesktop.classList.remove('hidden');\n universalSearchBarClearMobile.classList.add('hidden');\n universalSearchBarClearMobile.classList.remove('active');\n\n $('#search__header--mobile').removeClass('active');\n }\n }\n\n jqUniversalSearchInput.autocomplete({\n appendTo: appendElement,\n html: true,\n delay: 300,\n source: function(request, response) {\n const elasticsearchEndpoint = drupalSettings.site_env !== 'production' ?\n `https://search-tcm-nonprod-elasticsearch-i7fnbv62fk5ekmn34nnag4q5mu.us-east-1.es.amazonaws.com/terms-${drupalSettings.site_env}/_search` :\n 'https://search-tcm-prod-elasticsearch-oj6yosznpxc4hen7comtcvyyne.us-east-1.es.amazonaws.com/terms/_search/';\n const data = JSON.stringify(\n {\n 'sort': [\n { 'counter': 'desc' },\n '_score',\n ],\n \"query\": {\n \"match_phrase_prefix\": {\n \"term\": request.term,\n }\n },\n 'size': 6,\n },\n );\n const xhr = new XMLHttpRequest();\n xhr.withCredentials = false;\n xhr.onreadystatechange = function() {\n if (this.readyState === 4) {\n const res = JSON.parse(this.response);\n response($.map(res.hits.hits, function(item) {\n const termRegex = new RegExp(request.term, 'gi');\n const displayString = item._source.term.replace(termRegex,\n function(substr) {\n return '' + substr + '';\n });\n $('.search-return__api-null').remove();\n return {\n label: displayString,\n value: item._source.term,\n null: false,\n };\n }));\n }\n };\n xhr.open('POST', elasticsearchEndpoint);\n xhr.setRequestHeader('Content-Type', 'application/json');\n xhr.send(data);\n },\n position: positionOptions,\n });\n\n // for orientation change around 1279.\n // Search return content is mirrored from Mobile div to Destkop div.\n if(e.handleObj.type == \"orientationchange\"){\n if(device == 'tablet'){\n console.log('tablet ')\n $('.ui-autocomplete').css({ 'width': '1000px', 'top': '60px', 'left': '0px'})\n $('.ui-autocomplete').empty()\n for(var i = 0; i < contentForOrientationChange.length; i++){\n $('.ui-autocomplete').append('
  • '+contentForOrientationChange[i].innerHTML+'
  • ')\n }\n }\n if(device == 'desktop'){\n console.log('desktop ')\n $('.ui-autocomplete').css({ 'width': '1000px', 'top': '60px', 'left': '0px'})\n $('.ui-autocomplete').empty()\n for(var i = 0; i < contentForOrientationChange.length; i++){\n $('.ui-autocomplete').append('
  • '+contentForOrientationChange[i].innerHTML+'
  • ')\n }\n }\n }\n }\n\n\n // takes an array thats returned and turns it into html links\n (function( $ ) {\n\n var proto = $.ui.autocomplete.prototype,\n initSource = proto._initSource;\n\n function filter( array, term ) {\n var matcher = new RegExp( $.ui.autocomplete.escapeRegex(term), \"i\" );\n return $.grep( array, function(value) {\n return matcher.test( $( \"
    \" ).html( value.label || value.value || value ).text() );\n });\n }\n\n $.extend( proto, {\n _initSource: function() {\n console\n if ( this.options.html && $.isArray(this.options.source) ) {\n this.source = function( request, response ) {\n response( filter( this.options.source, request.term ) );\n };\n } else {\n initSource.call( this );\n }\n },\n _renderItem: function( ul, item) {\n return $( \"
  • \" )\n .data( \"item.autocomplete\", item )\n .append( $( `${item.value}` )[ this.options.html ? \"html\" : \"text\" ]( item.label ) )\n .appendTo( ul );\n }\n });\n })( jQuery );\n deviceWas = device\n }\n}\n","import Modal from './modal';\n\n\nexport default class ModalCarousel {\n /**\n * Attach common page events and initialize tile components\n * called before MODAL.JS\n */\n static initialize() {\n\n $(document).ready(function() {\n\t\t// did have class '.modal-video-play'\n $('.tcm-modal').on('click', function () {\n\n\n // use ID to grab data here... pretend inputData is retreived data for now...\n const inputData = {\n overlay_type: this.getAttribute('data-overlay-type'),\n overlay_img: this.getAttribute('data-overlay-img-array'),\n overlay_copy: this.getAttribute('data-overlay-img-copy'),\n overlay_title: this.getAttribute('data-overlay-title'),\n overlay_subtitle: this.getAttribute('data-overlay-subtitle')\n };\n\n modalCreation(inputData);\n\n function modalCreation(vodData){\n // Build modal player sub template\n vodData.modal_player_template = '\\\n
    \\\n
    \\\n
    DONE
    \\\n
    \\\n
    \\\n
    \\\n
    \\\n
    \\\n
    \\\n
    \\\n
    \\\n
    \\\n
    \\\n
    \\\n

    ' + inputData.title + '

    \\\n
    \\\n

    '+inputData.des+'

    \\\n
    ';\n\n //console.log('this.modal_player_template = ' + vodData.modal_player_template);\n\n inputData.template = vodData.modal_player_template;\n\n // @todo - This is not required, this is just to demonstrate additional callbacks that can be used if needed on modal events\n const custom_options_that_are_not_required = {\n\n onClose: function(inputData) {\n window.console.log('Is the modal open?', this.getIsOpen());\n window.console.log('Additional on close event', inputData);\n\n // The \"this\" variable is actually the instance of the modal class itself so you can do stuff like:\n // destroy player on modal close so you don't have mulitiple player instances floating around\n //window.player = undefined;\n // header offset has odd bg, correct with removeClass\n $('.modal-overlay__header-offset').removeClass('visually-hidden');\n },\n // called after Modal.js\n onOpen: function(inputData) {\n if(inputData.overlay_type == 'slider'){\n //initiate slick slider\n populateOverlayCarousel( inputData)\n }else if(inputData.overlay_type == 'video'){\n alert('initiate Video player')\n }else{\n alert('Not slider')\n }\n window.console.log('Is the modal open?', this.getIsOpen());\n window.console.log('Additional on open event', inputData);\n\n\n\n\n // demonstrating attempt to append volume button to different container; don't forget to remove this\n /*setTimeout(function(){\n $('.tui-volume').detach().appendTo('.watch__player-text__wrap');\n }, 3000);*/\n // header offset has odd bg, correct with addclass\n $('.modal-overlay__header-offset').addClass('visually-hidden');\n }\n\n };\n\n const modal = new Modal(inputData, custom_options_that_are_not_required);\n\n\n // You can also call like this if you don't need the additional callbacks\n // const modal = new WatchModal(test);\n\n modal.open(inputData);\n\n }\n\t\t});\n\n\t\tfunction populateOverlayCarousel( inputData){\n\t\t\tlet carouselImageArray = inputData.overlay_img.split(\", \");\n let carouselImageCopyArray = inputData.overlay_copy.split(\",|||\");\n let carouselImageCopyArrayEscaped = carouselImageCopyArray.map(item => item.replace(/@#/g, '\"') )\n\n\t\t\t$('.modal-overlay__content__main').prepend(`
    ${inputData.overlay_subtitle}
    `);\n\t\t\t$('.modal-overlay__content__main').prepend(`
    ${inputData.overlay_title}
    `);\n\t\t\t// removes last of array that is empty ... yeah sloppy, should have been done in twig\n\n\t\t\tlet count = 0;\n\t\t\tcarouselImageArray.forEach(img => {\n\t\t\t\t$('.modal-overlay__content__main--carousel').append(`
    \"${carouselImageCopyArrayEscaped[count]
    ${carouselImageCopyArrayEscaped[count] ? carouselImageCopyArrayEscaped[count] : \" \"}
    `);\n\t\t\t\tcount ++;\n\t\t\t});\n\n\t\t\t$('.modal-overlay__content__main--carousel').slick({\n lazyLoad: 'ondemand',\n\t\t\t\tdots: true,\n\t\t\t\tcustomPaging: function (slider, i) {\n\t\t\t\tvar thumb = $(slider.$slides[i]).data();\n\t\t\t\tif(i < 9){ // adds a preceding ZERO to slider count if below 9\n\t\t\t\t\treturn '0' + (i + 1) + '';\n\t\t\t\t}else{ // removes preceding ZERO to slider count if above 9\n\t\t\t\t\treturn '' + (i + 1) + '';\n\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tnextArrow: '',\n\t\t\t\tprevArrow: '',\n\t\t\t\tinfinite: false\n\t\t\t\t//dotsClass: 'overlay-carousel-dots'\n\t\t\t\t//appendDots:\n\t\t\t});\n\t\t}\n });\n }\n}\n","import truncata from \"../../../../../libraries/truncata/truncata\";\nexport default class SearchPage {\n\n static initialize(UrlPathname, apiURL) {\n // Log Wrapping and display logs only if in debug mode\n // https://eslint.org/docs/rules/no-console\n var url = window.location.href;\n var debug_parameter = 'debug';\n var DEBUG = (url.indexOf(debug_parameter) == -1) ? false : true; // Enable logging\n var truncate;\n\n // * Prevent errors on console methods when no console present.\n // * Use log() and warn();\n\n window.log = function () {\n if (DEBUG && window.console) {\n console.log.apply(console, arguments);\n }\n }\n\n window.warn = function () {\n if (DEBUG && window.console) {\n console.warn.apply(console, arguments);\n }\n }\n\n //Truncates paragraphs to two lines of text\n function truncateDescriptions() {\n truncate !== undefined && truncate.destroy && truncate.destroy()\n setTimeout(function(){ truncate = truncata('.search-return__title-des'); });\n }\n\n // Controlls the /search page only\n if (UrlPathname == '/search'){\n // Grab search param from url and strip dumb chars\n let queryString = decodeURIComponent(unescape(window.location.search.substr(1).split('&')[0])).replace(/[/]/gi,\"QQQ\").replace(/\"/gi,\"QWQ\").replace(/[<>]/g, ' ');\n document.addEventListener('DOMContentLoaded', loadSearchFunctionality, false);\n\n function loadSearchFunctionality(){\n var searchValue = document.getElementById('suggest').value\n let searchReturnWrap = $('.search-return');\n let titleLength;\n let peopleLength;\n let dataLength;\n let resultOrResults = 'results';\n let loader = document.querySelector(\".loader\");\n let fullSearchCountWrap = $('.search-return__results__count__header')\n let fullSearchCount = fullSearchCountWrap.find('#search-result-count')\n\n // Show/Hide functionality on Divs\n $('.search-return__results__filter__btn , .read-more-link').on('click', function(){\n // Get Selected 'section' of page\n const sectionClicked = $(this).attr('data-settings-section');\n\n // Was 'view all' clicked ?\n const sideNavClicked = this.innerText.toLowerCase() == 'view all' ? true : false\n\n // Clear Nav Btn active states\n $('.search-return__results__filter__btn').removeClass('active');\n\n // if 'view all' btn links are clicked change active state on nav\n if(sideNavClicked){\n // grab the data-attr for the 'view all' thats clicked\n const readMoreData = $(this)[0].dataset.settingsSection;\n const navlist = $('.search-return__results__filter__wrap');\n navlist.children('li').each(function(){\n if( $(this).data('settings-section') == readMoreData ) {\n $(this).addClass('active');\n updateCount( $(this) )\n\n };\n });\n } else{\n $(this).addClass('active');\n updateCount( $(this) )\n\n }\n function updateCount( element ){\n if( element.context.innerText == 'TITLES'){\n fullSearchCount.html(titleLength);\n }else if( element.context.innerText == 'PEOPLE'){\n fullSearchCount.html(peopleLength);\n }else if( element.context.innerText == 'ALL'){\n fullSearchCount.html(dataLength);\n }\n }\n\n // set Nav Btn as active\n $(this).addClass('active');\n\n // Remove active class from Sections\n $('.search-return__section').removeClass('active');\n\n if ($(this).data('settings-section') === 'titles-full') {\n resultOrResults = titleLength === 1 ? 'result' : 'results';\n $('#search-result-count').html(titleLength + ' ' + resultOrResults);\n }\n else if ($(this).data('settings-section') === 'people-full') {\n resultOrResults = peopleLength === 1 ? 'result' : 'results';\n $('#search-result-count').html(peopleLength + ' ' + resultOrResults);\n }\n else if ($(this).data('settings-section') === 'all') {\n resultOrResults = peopleLength + titleLength === 1 ? 'result' : 'results';\n $('#search-result-count').html((titleLength + peopleLength) + ' ' + resultOrResults);\n }\n\n // Add active class to clicked sections\n //$('.search-return__toggle-content').addClass('active');\n\n // Add active class to clicked sections\n $('.search-return__section-'+sectionClicked).addClass('active');\n\n truncateDescriptions();\n\n //console.log('what was clicked? '+sectionClicked+'\\nshould be false '+ sideNavClicked)\n // show/hide 'view all' links in topbar.\n if ( $(this).attr('data-settings-section') == 'all'){\n $('.search-return__section').removeClass('active');\n if(titleLength > 0 ){\n $('.search-return__section-titles').addClass('active');\n }\n if(peopleLength > 0 ){\n $('.search-return__section-people').addClass('active');\n }\n $('.read-more-link').removeClass('hidden')\n }else{\n $('.search-return__toggle-content').find('.read-more-link').addClass('hidden')\n }\n });\n\n // Controls Tabs in Multimedia div Only\n $('.multimedia-tabs-btn').on('click', function(){\n $(this).parent().children().removeClass('active')\n $(this).addClass('active')\n // get filter attribute\n const sectionfilter = $(this).attr('data-media-type').toLowerCase();\n // get all multimedia divs on page\n const mediaList = $('.search-return__results__tiles-video');\n // loop and filter over multimedia divs.\n mediaList.each(function(){\n if( sectionfilter == 'all'){\n $(this).removeClass('hidden')\n }else if(sectionfilter !== $(this).attr('data-media-type')){\n $(this).addClass('hidden')\n }else{ $(this).removeClass('hidden') }\n });\n });\n\n // Search Return on Page Load with queryString taken from URL\n $(document).ready(function (e) {\n\n let emptySearchReturn = $('.search-return__empty');\n let emptySearchReturnTerm = emptySearchReturn.find('.search-return__empty__contnet__term')\n let fullSerchTerm = fullSearchCountWrap.find('#search-result-term')\n let buttonsWrap = $('.search-return__results__filter__wrap')\n let fullSearchReturn = $('.search-return__toggle-content')\n let fullSearchReturnTitles = fullSearchReturn.find('#title-return');\n let fullSearchReturnPeople = fullSearchReturn.find('#people-return');\n let fullSearchReturnTitlesAll = fullSearchReturn.find('#title-return-full');\n let fullSearchReturnPeopleAll = fullSearchReturn.find('#people-return-full');\n\n if(queryString != ''){\n if (e.which == 13 ) {\n // if user pressed enter\n //searchValue = searchValue.a.replace(/[^a-z0-9]/gi,'');\n window.location = `/search?${searchValue}`;\n }\n // JSONP Request\n $.ajax({\n method: 'GET',\n dataType: 'json',\n jsonpCallback: 'jsonCallback',\n url: apiURL+ `/tcmws/SearchAPI/${queryString}`,\n success: function(data){\n log('[TCM] - successful api hit at new ' + apiURL+ '/tcmws/searchAPI/'+ queryString +'\\n'+data);\n },\n error: function(e){\n document.title = `${e.statusText} ${e.status}`;\n $('#content').replaceWith(`\n
    \n
    \n

    Oh no!

    \n
    \n
    An unexpected error seems to have occurred and we’re temporarily unable to load this page. Please try again later.
    \n
    \n
    \n `);\n warn('[TCM] fail api hit at new ' + apiURL+ '/tcmws/searchAPI/'+ queryString, e);\n }\n }).done(function (data) {\n titleLength = data.tcm.titles.length;\n peopleLength = data.tcm.participants.length;\n // let keytermsLength = data.tcm.keyTerms.length;\n dataLength = titleLength + peopleLength;\n queryString = queryString.replace(/QQQ/gi,\"/\").replace(/QWQ/gi,'\"');\n\n if (typeof turner_metadata !== 'undefined' && turner_metadata) {\n window.turner_metadata['#_search_results'] = dataLength;\n window.turner_metadata['internal_search_terms'] = queryString;\n log('[TCM_ANALYTICS] - Search', turner_metadata);\n try {\n window.trackMetrics({\n type: 'search-results',\n data: turner_metadata,\n });\n log('[TCM_ANALYTICS] - trackMetrics success');\n } catch (e) {\n warn('[TCM_ANALYTICS] - trackMetrics error', e);\n }\n } else {\n warn('[TCM_ANALYTICS] - turner_metadata is undefined');\n }\n // Empty previous search returns on page\n fullSearchReturnTitles.html(\"\");\n fullSearchReturnPeople.html(\"\");\n loader.classList.add(\"hidden\");\n // If search return NULL show empty returnDiv.\n if (dataLength == 0) {\n emptySearchReturn.show();\n emptySearchReturnTerm.html('\"' + queryString + '\"');\n fullSearchCountWrap.hide();\n buttonsWrap.hide();\n fullSearchReturn.hide()\n // Else begin building page.\n } else {\n resultOrResults = dataLength === 1 ? 'result' : 'results';\n emptySearchReturn.hide();\n buttonsWrap.show();\n fullSearchReturn.show()\n fullSearchCount.html(dataLength + ' ' + resultOrResults);\n fullSerchTerm.html('\"' + queryString + '\"');\n searchValue = document.getElementById('suggest')\n searchValue.value = queryString;\n\n // If Title return is Zero hide Top navigation & view all\n if(titleLength == 0 ){\n fullSearchReturn.find('.search-return__section-titles').removeClass('active')\n buttonsWrap.find('.titles-full').hide()\n $('.titles.read-more-link').hide()\n $('.search-return__header__hr__titles').css('margin-top','13px');\n // If under 5 returns, hide 'view-all' and 'Titles' in top nav\n }else{\n $.each(data.tcm.titles, function (index, item) {\n\n const description = item.synopsis || '';\n let akaName = '';\n if (item.AkaName) {\n if(item.AkaName !== null) { akaName = item.AkaName.split(\",\").length > 3 ? item.AkaName.split(\",\",3)+'...' : item.AkaName.split(\",\",3) }\n if(item.AkaName == null) { akaName = item.AkaName }\n }\n // Check if less than 5 results\n if(index < 5){\n if(item.AkaName){\n fullSearchReturnTitles.append(`

    ${item.name} (${item.releaseYear})

    a.k.a. ${akaName}
    ${description}
    `);\n }else{\n fullSearchReturnTitles.append(`

    ${item.name} (${item.releaseYear})

    ${description}
    `);\n }\n }\n\n\n // Save to ALL variable since over 5 results\n if(item.AkaName){\n fullSearchReturnTitlesAll.append(`

    ${item.name} (${ item.releaseYear})

    a.k.a. ${akaName}
    ${description}
    `);\n }else{\n fullSearchReturnTitlesAll.append(`

    ${item.name} (${item.releaseYear})

    ${description}
    `);\n }\n })\n\n\n if(titleLength < 5){\n $('.titles.read-more-link').hide()\n $('.search-return__header__hr__titles').css('margin-top','13px');\n }\n // Analytics\n $(\".search-return__title-wrap\").on(\"click\", function() {\n var metricsObj = {\n type: \"search-results-title-click\",\n data : {\n url: $(this).attr(\"href\"),\n name: $(this).children(\".search-return__title-header\")[0].innerHTML\n }\n };\n\n try {\n window.trackMetrics(metricsObj);\n log('[TCM_ANALYTICS] - trackMetrics success', metricsObj);\n } catch (e) {\n warn('[TCM_ANALYTICS] - trackMetrics error', e);\n }\n });\n }\n\n // If Participants return is Zero hide\n if (peopleLength == 0){\n fullSearchReturn.find('.search-return__section-people').removeClass('active')\n buttonsWrap.find('.people-full').hide()\n $('.participants.read-more-link').hide()\n $('.search-return__header__hr__participants').css('margin-top','13px');\n // If under 8 returns, hide 'view-all' and 'People' in top nav\n } else {\n $.each(data.tcm.participants, function (index, item) {\n if(index <= 7){\n fullSearchReturnPeople.append(`

    ${item.name}

    ${item.primaryRole}
    `);\n }\n fullSearchReturnPeopleAll.append(`

    ${item.name}

    ${item.primaryRole}
    `);\n })\n if(peopleLength < 8){\n $('.participants.read-more-link').hide()\n $('.search-return__header__hr__participants').css('margin-top','13px');\n }\n\n // Analytics\n $(\".search-return__person-wrap\").on(\"click\", function() {\n var metricsObj = {\n type: \"search-results-participant-click\",\n data : {\n url: $(this).attr(\"href\"),\n name: $(this).children(\".search-return__person-header\")[0].innerHTML\n }\n };\n\n try {\n window.trackMetrics(metricsObj);\n log('[TCM_ANALYTICS] - trackMetrics success', metricsObj);\n } catch (e) {\n warn('[TCM_ANALYTICS] - trackMetrics error', e);\n }\n });\n }\n }\n truncateDescriptions();\n\n searchReturnWrap.show();\n // Create pagination for Titles\n }).done(function(){\n // Only if # of titles exceeds 10\n if(titleLength > 10){\n var items = $(\"#title-return-full .search-return__title-wrap\");\n var numItems = titleLength;\n var perPage = 10;\n\n items.slice(perPage).hide();\n\n $('#title-pagination').pagination({\n items: numItems,\n itemsOnPage: perPage,\n prevText: \"Prev\",\n nextText: \"Next\",\n\n onPageClick: function (pageNumber) {\n var showFrom = perPage * (pageNumber - 1);\n var showTo = showFrom + perPage;\n items.hide().slice(showFrom, showTo).show();\n $(\"html, body\").animate({ scrollTop: 0 }, \"slow\");\n truncateDescriptions();\n }\n });\n }\n // Create pagination for People\n }).done(function(){\n // Only if # of titles exceeds 28\n if(peopleLength > 28){\n var items = $(\"#people-return-full .search-return__person-wrap\");\n var numItems = peopleLength;\n var perPage = 16;\n\n items.slice(perPage).hide();\n\n $('#people-pagination').pagination({\n items: numItems,\n itemsOnPage: perPage,\n prevText: \"Prev\",\n nextText: \"Next\",\n onPageClick: function (pageNumber) {\n var showFrom = perPage * (pageNumber - 1);\n var showTo = showFrom + perPage;\n items.hide().slice(showFrom, showTo).show();\n $(\"html, body\").animate({ scrollTop: 0 }, \"slow\");\n }\n });\n }\n })\n }\n else{\n loader.classList.add(\"hidden\");\n emptySearchReturn.show();\n emptySearchReturnTerm.html('\"' + queryString + '\"');\n fullSearchCountWrap.hide();\n buttonsWrap.hide();\n fullSearchReturn.hide()\n searchReturnWrap.show();\n }\n })\n }\n }\n }\n}\n\n","import truncata from '../../../../../libraries/truncata/truncata';\n\nexport default class FilmDetail {\n\tstatic truncateOverviewDescription;\n\tstatic truncateArticlesTitles;\n\tstatic truncateArticlesBodies;\n\tstatic truncatePhotosVideoTitles;\n\tstatic truncatePhotosVideoBodies;\n\n\tstatic initialize(UrlPathname) {\n\t \tif (UrlPathname === '/tcmdb') {\n\t\t\t$( document ).ready(function() {\n\t\t\t\t// Display page content baseded on hash in url.\n\t\t\t\tif (window.location.hash) {\n\t\t\t\t\tvar section = window.location.hash.substring(1);\n\t\t\t\t\tif(section.includes('?')){ // filter out query sting if found\n\t\t\t\t\t\tsection = section.substring(0,section.indexOf('?'))\n\t\t\t\t\t}\n\t\t\t\t\twindow.FilmDetail.activateSection(section);\n\t\t\t\t}else if (window.location.pathname.includes(\"tcmdb\")) {\n\t\t\t\t\twindow.FilmDetail.activateSection(\"overview\");\n\t\t\t\t}\n\n\t\t\t\twindow.onhashchange = function(event) {\n\t\t\t\t\tvar section = window.location.hash.substring(1);\n\t\t\t\t\tif (section.includes(\"?articleId=\")) {\n\t\t\t\t\t\tvar articleId = section.split('?articleId=')[1];\n\t\t\t\t\t\tarticleClicked(articleId);\n\t\t\t\t\t\t$('.film-detail__toggle-content__section').removeClass('active');\n\t\t\t\t\t}\n\n\t\t\t\t\t$('#modal-overlay').hide();\n\t\t\t\t\t$('body').removeClass('modal-open');\n\t\t\t\t\twindow.FilmDetail.activateSection(section);\n\t\t\t\t}\n\n\t\t\t\t$(\".reviewBox\").click(function() {\n\t\t\t\t\turl = $(this).find(\"h4\").attr(\"href\");\n\t\t\t\t\twindow.open(url,'_self');\n\t\t\t\t\treturn false;\n\t\t\t\t});\n\n\t\t\t\t// film detail side bar functionality / onclick section selection\n\t\t\t\t$('.film-detail__sidebar__list__item, .read-more-link' ).on('click', function(){\n\t\t\t\t\t//check if readmore button or side nav was clicked\n\t\t\t\t\tconst sideNavClicked = $(this).hasClass('read-more-link') ? false : true;\n\n\t\t\t\t\t// get selected 'page'\n\t\t\t\t\tconst sectionClicked = $(this).attr('data-settings-section');\n\n\t\t\t\t\t//clear sidebar menu active states\n\t\t\t\t\t$('.film-detail__sidebar__list__item').removeClass('active');\n\t\t\t\t\t// set sidebar menu item as active\n\n\t\t\t\t\t// if read more links are clicked\n\t\t\t\t\tif (!sideNavClicked){\n\t\t\t\t\t\t// grab the data-attr for the Read more thats clicked\n\t\t\t\t\t\tconst readMoreData = $(this)[0].dataset.settingsSection;\n\t\t\t\t\t\tconst navlist = $('.film-detail__sidebar__list');\n\t\t\t\t\t\tnavlist.children('li').each(function(){\n\t\t\t\t\t\t\tif ( $(this).data('settings-section') == readMoreData ) {\n\t\t\t\t\t\t\t\t\t$(this).addClass('active');\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t});\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$(this).addClass('active');\n\t\t\t\t\t}\n\t\t\t\t\twindow.FilmDetail.activateSection(sectionClicked);\n\t\t\t\t\twindow.scrollTo(0,0);\n\t\t\t\t});\n\t\t\t})\n \t}\n\t}\n\n\tstatic metrics(section) {\n\n\t\tlet linkTextFormated = TrackingMetrics.formatText(section);\n\t\ttry {\n\t\t\twindow.trackMetrics({\n\t\t\t\ttype: \"click-interaction\",\n\t\t\t\tdata: {\n\t\t\t\t\tinteractionlocation: \"side-menu-clicked\",\n\t\t\t\t\tinteraction: linkTextFormated,\n\t\t\t\t\tinteractionevent: 1,\n\t\t\t\t},\n\t\t\t});\n\t\t} catch (e) {\n\t\t\tconsole.log(\n\t\t\t\t\"Unable to track side-menu-clicked: \" + linkTextFormated\n\t\t\t);\n\t\t}\n\t};\n\n static removeTruncateIfExist(element) {\n element !== undefined && element.destroy && element.destroy() && (element = undefined);\n return element;\n }\n\n\tstatic activateSection(section) {\n\t\t// Sidebar menu\n\n\t\t$('.film-detail__sidebar__list__item').removeClass('active');\n\t\tthis.truncateOverviewDescription = this.removeTruncateIfExist(this.truncateOverviewDescription);\n\t\tthis.truncateArticlesTitles = this.removeTruncateIfExist(this.truncateArticlesTitles);\n\t\tthis.truncateArticlesBodies = this.removeTruncateIfExist(this.truncateArticlesBodies);\n\t\tthis.truncatePhotosVideoTitles = this.removeTruncateIfExist(this.truncatePhotosVideoTitles);\n\t\tthis.truncatePhotosVideoBodies = this.removeTruncateIfExist(this.truncatePhotosVideoBodies);\n\t\tvar _that = this;\n\n\t\tif(section.includes('overview')) {\n\t\t\tsetTimeout(function(){\n\t\t\t\t_that.truncateOverviewDescription = truncata('.film-detail__content-block__synsopsis', {lines:3, percentage:93});\n\t\t\t});\n\t\t}\n\n\t\tif(section.includes('articles-reviews')) {\n\t\t\t//articleSection();\n\t\t\tsetTimeout(function(){\n\t\t\t\t_that.truncateArticlesTitles = truncata('.articles-hero__title, .articles-child__title', {lines: 2, percentage: 93});\n\t\t\t\t_that.truncateArticlesBodies = truncata('.articles-hero__description, .articles-child__body', {lines: 3, percentage: 75});\n\t\t\t});\n\t\t}\n\n \tif(section.includes('photos-video')) {\n\t\t\tsetTimeout(function(){\n\t\t\t\t_that.truncatePhotosVideoTitles = truncata('.video-collections__title, .photo-collections__title', {lines: 2, percentage: 93});\n\t\t\t\t_that.truncatePhotosVideoBodies = truncata('.video-collections__description, .photo-collections__description', {lines: 3, percentage: 75});\n\t\t\t});\n\t\t}\n\n\t\t// If Article was clicked\n\t\tif(section.includes(\"?articleId=\")){\n\t\t\tvar articleId = section.split('?articleId=')[1];\n\t\t\t$(\".film-detail__toggle-content__section--articles-reviews\").addClass(\"active\");\n\t\t\t$(\".film-detail__sidebar__list__item\").removeClass(\"active\");\n\t\t\t$('[data-settings-section=articles-reviews]').addClass('active');\n\t\t\t$(\".page-articles-reviews-articles\").hide();\n\t\t\t$(\".articles-child\").hide();\n\t\t\t$(\".articles-hero\").hide();\n\t\t\t$(\"#article\"+articleId).show();\n\t\t\twindow.location.hash = \"#articles-reviews?articleId=\"+articleId;\n\t\t}else if(section.includes(\"?icid=footer12-do-not-sell-my-info\")){\n\n\t\t}else{\n\t\t\tif(section.includes('?')){ // filter out query sting if found\n\t\t\t\tsection = section.substring(0,section.indexOf('?'))\n\t\t\t}\n \t// do not sell footer has to be updated with #hash\n\t\t\tlet footerLink = document.querySelector('.ot-sdk-show-settings.footerLinks')\n\t\t\tfooterLink.setAttribute('href', window.location + '?icid=footer12-do-not-sell-my-info');;\n\t\t\t$(`.film-detail__sidebar__list__item[data-settings-section=\"${section}\"]`).addClass('active');\n\t\t\t// Section handeling\n\t\t\t$('.film-detail__toggle-content__section').removeClass('active');\n\t\t\t$('.film-detail__toggle-content').addClass('active');\n\t\t\t$('.film-detail__toggle-content__section--' + section).addClass('active');\n\t\t\twindow.location.hash = section;\n\t\t\twindow.scrollTo(0,0);\n\t\t}\n\t\tthis.metrics(section);\n\t}\n}\n","// Initialize jQuery alias\nwindow.$ = window.jQuery;\n\n// Identify page using URL schema, to be replaced by native Drupal functionaly\nlet UrlPathname = window.location.pathname.split('/');\nUrlPathname = '/'+ UrlPathname[1];\n\nlet apiURL = drupalSettings.api_base || 'https://tcmws.tcm.com';\n\nimport TrackingMetrics from './global/tracking-metrics';\nimport IndexDetail from './components/index-page';\nimport StickyNav from './global/sticky-nav';\nimport trendingBlock from './global/trending-block';\nimport ResponsiveSubNav from './global/responsive-sub-nav';\nimport SearchFlyout from './global/search-overlay';\nimport ModalCarousel from './global/modal-carousel';\nimport ScheduleDaily from './components/schedule-daily';\nimport ScheduleMonthly from './components/schedule-monthly';\nimport SearchPage from './components/search-page';\nimport FilmDetail from './components/film-detail';\nimport VideoPlayer from './components/video-player';\nimport TrendingPage from './components/trending-page';\nimport FooterRibbon from './global/footer-ribbon';\nimport Polyfills from './global/polyfill';\nimport VideoPage from './components/video-page';\nimport sideNav from './global/side-nav';\nimport hosts from './components/hosts';\nimport thisMonth from './components/this-month';\n\nwindow.TrackingMetrics = TrackingMetrics;\nTrackingMetrics.initialize();\n\nwindow.FilmDetail = FilmDetail;\nFilmDetail.initialize(UrlPathname);\n\nIndexDetail.initialize(UrlPathname, apiURL);\nStickyNav.initialize(UrlPathname);\ntrendingBlock.initialize(UrlPathname, apiURL);\nResponsiveSubNav.initialize();\nScheduleDaily.initialize(UrlPathname, apiURL);\nScheduleMonthly.initialize(UrlPathname, apiURL);\nSearchPage.initialize(UrlPathname, apiURL);\nVideoPlayer.initialize(UrlPathname);\nTrendingPage.initialize(UrlPathname, apiURL);\nsideNav.initialize(UrlPathname, apiURL);\nhosts.initialize(UrlPathname, apiURL);\nthisMonth.initialize(UrlPathname, apiURL);\nFooterRibbon.initialize();\nPolyfills.initialize();\nVideoPage.initialize(UrlPathname);\n\n\nlet deviceWidth, deviceHeight, responsiveChangeCanidate;\n\n// race condition - wait till page is built then attach modal evnt listener\n// also attach search flyout\n// garbage fix, needs refactor\nsetTimeout(function() {\n // Poor Mans device detection\n\n deviceWidth = $(window).width()\n deviceHeight = $(window).height()\n\n // The desktop mobile breakpoint is 1280 .. if device.width and device.height are on either side of that.\n //\n if( (deviceWidth >= 1280 && deviceHeight <= 1279) || ( deviceHeight >= 1280 && deviceWidth <= 1279 ) ){\n responsiveChangeCanidate = true\n }else{\n responsiveChangeCanidate = false\n }\n\n ModalCarousel.initialize();\n SearchFlyout.initialize(deviceWidth, apiURL, null);\n //console.log('----------------\\nCan it change?\\n' + deviceWidth + '\\n'+ deviceHeight + '\\n'+ responsiveChangeCanidate)\n\n\n} , 1000);\n\n\n\n// Orientation Change - if orientation changes, and device.width & device.height are reset search elements\n$(window).on('orientationchange', function(passedEvent) {\n if(responsiveChangeCanidate){\n setTimeout(function() {\n SearchFlyout.initialize($(window).width(), apiURL, passedEvent );\n } , 600);\n }\n});\n\n// Browser Check - allows to check browser name and version\nnavigator.browserSpecs = ( function(){\n var ua = navigator.userAgent, tem,\n M = ua.match(/(opera|chrome|safari|firefox|msie|trident(?=\\/))\\/?\\s*(\\d+)/i) || [];\n if(/trident/i.test(M[1])){\n tem = /\\brv[ :]+(\\d+)/g.exec(ua) || [];\n return {name:'IE',version:(tem[1] || '')};\n }\n if(M[1]=== 'Chrome'){\n tem = ua.match(/\\b(OPR|Edge)\\/(\\d+)/);\n if(tem != null) return {name:tem[1].replace('OPR', 'Opera'),version:tem[2]};\n }\n M = M[2]? [M[1], M[2]]: [navigator.appName, navigator.appVersion, '-?'];\n if((tem = ua.match(/version\\/(\\d+)/i))!= null)\n M.splice(1, 1, tem[1]);\n return {name:M[0], version:M[1]};\n})();\n\nfunction isUnsupportedWindowsOs(appVersion) {\n return appVersion.search(/Windows NT +(6.0|6.1|6.2)/) !== -1 ? true : false;\n}\n\n// this function is called only after DOM has loaded, to ensure modal is displayed\n$( document ).ready(function() {\n console.log(\"Browser detection: \",navigator.browserSpecs.name, navigator.browserSpecs.version)\n if (isUnsupportedWindowsOs(navigator.appVersion) || navigator.browserSpecs.name == 'IE' && navigator.browserSpecs.version < '11') {\n $('#unsupportedBrowserModal').modal('show');\n }\n});\n\ndocument.cookie = 'countryCode=US';\n","\nimport TrackingMetrics from \"../global/tracking-metrics\";\nimport Modal from '../global/modal';\n\nexport default class indexPage {\n\n static initialize(UrlPathname, apiURL) {\n\n var morePath = window.location.pathname.split('/');\n var inPreview = (morePath[2] === \"preview\" || morePath[2] === \"custompreview\") ? true : false;\n //check for preview\n if (window.location.href.indexOf(\"?previewCarousel=true\") > -1) {\n //$(document).ready(function () {\n setTimeout(function() {\n var editorialTitle = $.cookie(\"editorialTitle\");\n var consumerTitle = $.cookie(\"consumerTitle\");\n var carouselBody = $.cookie(\"carouselBody\");\n var image = $.cookie(\"image\");\n var imageLink = $.cookie(\"imageLink\");\n var imageLinkWindow = $.cookie(\"imageLinkWindow\");\n var startDate = $.cookie(\"startDate\");\n var endDate = $.cookie(\"endDate\");\n var linkOne = $.cookie(\"linkOne\");\n var linkTwo = $.cookie(\"linkTwo\");\n var carouselOrder = $.cookie(\"carouselOrder\");\n var itemStatus = $.cookie(\"itemStatus\");\n var itemType = $.cookie(\"itemType\");\n var createdBy = $.cookie(\"createdBy\");\n //console.log(imageLinkWindow)\n if (imageLink.length > 0) {\n if (imageLinkWindow == \"Yes\") {\n var imageMarkup = \"
    \"\n } else {\n var imageMarkup = \"
    \"\n }\n } else {\n var imageMarkup = \"
    \"\n }\n let body_div = \"\";\n if (typeof carouselBody !== \"undefined\") {\n body_div = \"
    \" + carouselBody + \"
    \";\n }\n $(\"#slide-body\").append(\"
    \" + consumerTitle + \"
    \" + body_div + \"
    \");\n $(\"#slide-img\").append(imageMarkup)\n\n $(\"#ad-row\").append(`\n
    \n
    \n \n
    \n
    \n

    Lorem ipsum

    \n
    \n \n
    \n
    \n\n
    \n
    \n \n
    \n
    \n

    Lorem ipsum

    \n
    \n
    Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
    \n \n
    \n
    `\n );\n\n $('.slider-for').slick({\n slidesToShow: 1,\n slidesToScroll: 1,\n arrows: false,\n fade: true,\n asNavFor: '.slider-nav'\n });\n $('.slider-nav').slick({\n slidesToShow: 1,\n slidesToScroll: 1,\n asNavFor: '.slider-for',\n dots: true,\n customPaging: function(slider, i) {\n var thumb = $(slider.$slides[i]).data();\n return '0' + (\n i + 1) + '';\n },\n draggable: false,\n focusOnSelect: true,\n autoplay: false,\n arrows: true,\n prevArrow: '',\n nextArrow: '',\n appendArrows: '.nav-box',\n appendDots: '.nav-box'\n });\n // loads content for Recently Added block on index page.\n $.ajax({\n url: apiURL + \"/tcmws/latest/6\",\n type: \"GET\",\n cache: false,\n headers: {\n \"accept\": \"application/json;odata=verbose\",\n },\n success: function(data) {\n $.each(data.tcm.titles, function(index, item) {\n var imageURLs = item.imageProfiles;\n var imageURL = \"https://prod-images.tcm.com/v5cache/TCM/Images/watchtcm/WatchTCM_Placeholder_Films.png\"\n var titleID = item.titleId;\n var description = \"Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis p...\";\n var movieName = \"Movie Name\";\n var releaseYear = \"2019\";\n // image swap for short films\n\n $(\"#watchlist-content\").append(`\n
    \n
    \n \n
    \n
    \n
    \n

    ${movieName}(${releaseYear})

    \n

    ${description}

    \n
    \n
    \n `);\n });\n $(function() {\n $('img[data-src-error]').error(function() {\n var o = $(this);\n var errorSrc = o.attr('data-src-error');\n\n if (o.attr('src') != errorSrc) {\n o.attr('src', errorSrc);\n }\n });\n });\n },\n error: function(error) {\n //console.log('error connecting to ' +apiURL+ '/tcmws/latest/6 ' + error + '/n on page: index-page.js');\n }\n });\n\n\n // loads content for Photo Gallery Masonary on index page.\n var rightNow = moment.utc().format('YYYY-MM-DD HH:mm:ss');\n var compareDate = moment(rightNow, 'YYYY-MM-DD HH:mm:ss');\n //console.log(rightNow + '\\n' + compareDate)\n $.ajax({\n\n url: \"http://dev-tcmws.tcm.com/tcmws/featuredArchives\",\n type: \"GET\",\n cache: false,\n headers: {\n \"accept\": \"application/json;odata=verbose\"\n },\n success: function (data) {\n var archives = data.tcm.archives;\n\n $.each(archives, function (index, item) {\n if(index < 7){\n // Displays content Video .. BRANDON DAVIS do the checkidy-check\n if(item.id == \"6\"){\n $(\"#bricks\").append(`\n \n `)\n // Displays images carousels\n }else{\n var imagesArray = item.images;\n var mainImg = \"https://via.placeholder.com/1087X1395/a0a0a0/a0a0a0/?text=.\";\n //console.table(imagesArray)\n var newImagesArray = []\n var imageCopyArray = []\n\n // adding identification seperators to the content arrays\n for (var i = 0, len = imagesArray.length; i < len; i++) {\n var url = imagesArray[i].url + ', '\n newImagesArray.push(url)+ '|||'\n };\n for (var i = 0, len = imagesArray.length; i < len; i++) {\n var description = imagesArray[i].description\n imageCopyArray.push(description);\n };\n\n var myImageUrlsJSON = newImagesArray.join(' ');\n var myimageCopyArray = imageCopyArray.join(\"|||\");\n // console.log('----------------')\n // console.log(myImageUrlsJSON)\n $(\"#bricks\").append(`\n
    \n \n
    \n
    `+item.title+`
    \n
    \n \n
    `);\n }\n }else{\n console.log('Should be after 7')\n }\n });\n },\n error: function (error) {\n console.log('error on Masonary ' + error);\n }\n\n });\n }, 1000)\n //});\n }\n //check for ad preview\n else if (window.location.href.indexOf(\"?previewAds=true\") > -1) {\n //$(document).ready(function () {\n setTimeout(function() {\n var consumerTitle = \"Lorem ipsum dolor sit amet\"\n var carouselBody = \"placerat duis ultricies lacus sed turpis tincidunt id aliquet risus feugiat in ante metus dictum\";\n\n var image = \"https://via.placeholder.com/888x499/a0a0a0/a0a0a0/?text=.\";\n var imageLink = \"#\"\n var startDate = $.cookie(\"startDate\");\n var endDate = $.cookie(\"endDate\");\n var linkOne = `Link 1`\n var linkTwo = `Link 2`\n var carouselOrder = $.cookie(\"carouselOrder\");\n var body_div = \"
    \" + carouselBody + \"
    \";\n $(\"#slide-body\").append(\"
    \" + consumerTitle + \"
    \" + body_div + \"
    \");\n $(\"#slide-img\").append(\"
    \")\n\n $(\"#slide-body\").append(\"
    \" + consumerTitle + \"
    \" + body_div + \"
    \");\n $(\"#slide-img\").append(\"
    \")\n var editorialTitle = $.cookie(\"AdeditorialTitle\");\n var adConsumerTitle = $.cookie(\"AdconsumerTitle\");\n var adCopy = $.cookie(\"adCopy\");\n var shortAdCopy = $.cookie(\"shortAdCopy\");\n var oneThirdImage = $.cookie(\"oneThirdImage\");\n var twoThirdImage = $.cookie(\"twoThirdImage\");\n var fullImage = $.cookie(\"fullImage\");\n var sa1Link = $.cookie(\"sa1Link\");\n var sa2Link = $.cookie(\"sa2Link\");\n\n\n $(\"#ad-row\").append(`\n
    \n
    \n \n
    \n
    \n

    ${shortAdCopy}

    \n
    \n
    ${sa1Link}
    \n
    \n
    \n\n
    \n
    \n \n
    \n
    \n

    ${adConsumerTitle}

    \n
    \n
    ${adCopy}
    \n
    ${sa2Link}
    \n
    \n
    `\n );\n\n $('.slider-for').slick({\n slidesToShow: 1,\n slidesToScroll: 1,\n arrows: false,\n fade: true,\n asNavFor: '.slider-nav'\n });\n $('.slider-nav').slick({\n slidesToShow: 1,\n slidesToScroll: 1,\n asNavFor: '.slider-for',\n dots: true,\n customPaging: function(slider, i) {\n var thumb = $(slider.$slides[i]).data();\n return '0' + (\n i + 1) + '';\n },\n draggable: false,\n focusOnSelect: true,\n autoplay: false,\n arrows: true,\n prevArrow: '',\n nextArrow: '',\n appendArrows: '.nav-box',\n appendDots: '.nav-box'\n });\n // loads content for Recently Added block on index page.\n $.ajax({\n url: apiURL + \"/tcmws/latest/6\",\n type: \"GET\",\n cache: false,\n headers: {\n \"accept\": \"application/json;odata=verbose\",\n },\n success: function(data) {\n $.each(data.tcm.titles, function(index, item) {\n var imageURLs = item.imageProfiles;\n var imageURL = \"https://prod-images.tcm.com/v5cache/TCM/Images/watchtcm/WatchTCM_Placeholder_Films.png\"\n var titleID = item.titleId;\n var description = \"Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis p...\";\n var movieName = \"Movie Name\";\n var releaseYear = \"2019\";\n // image swap for short films\n\n $(\"#watchlist-content\").append(`\n
    \n
    \n \n
    \n
    \n
    \n

    ${movieName}(${releaseYear})

    \n

    ${description}

    \n
    \n
    \n `);\n });\n $(function() {\n $('img[data-src-error]').error(function() {\n var o = $(this);\n var errorSrc = o.attr('data-src-error');\n\n if (o.attr('src') != errorSrc) {\n o.attr('src', errorSrc);\n }\n });\n });\n },\n error: function(error) {\n //console.log('error connecting to url: ' +apiURL+ '/tcmws/latest/6 ' + error + '/n on page: index-page.js');\n }\n });\n\n\n // loads content for Photo Gallery Masonary on index page.\n var rightNow = moment.utc().format('YYYY-MM-DD HH:mm:ss');\n var compareDate = moment(rightNow, 'YYYY-MM-DD HH:mm:ss');\n\n $.ajax({\n url: \"http://dev-tcmws.tcm.com/tcmws/featuredArchives\",\n type: \"GET\",\n cache: false,\n headers: {\n \"accept\": \"application/json;odata=verbose\"\n },\n success: function (data) {\n var archives = data.tcm.archives;\n\n $.each(archives, function (index, item) {\n if(index < 7){\n // Displays content Video .. BRANDON DAVIS do the checkidy-check\n if(item.id == \"6\"){\n $(\"#bricks\").append(`\n \n `)\n // Displays images carousels\n }else{\n var imagesArray = item.images;\n var mainImg = \"https://via.placeholder.com/1087X1395/a0a0a0/a0a0a0/?text=.\";\n //console.table(imagesArray)\n var newImagesArray = []\n var imageCopyArray = []\n\n // adding identification seperators to the content arrays\n for (var i = 0, len = imagesArray.length; i < len; i++) {\n var url = imagesArray[i].url + ', '\n newImagesArray.push(url)+ '|||'\n };\n for (var i = 0, len = imagesArray.length; i < len; i++) {\n var description = imagesArray[i].description\n imageCopyArray.push(description);\n };\n\n var myImageUrlsJSON = newImagesArray.join(' ');\n var myimageCopyArray = imageCopyArray.join(\"|||\");\n // console.log('----------------')\n // console.log(myImageUrlsJSON)\n $(\"#bricks\").append(`\n
    \n \n
    \n
    `+item.title+`
    \n
    \n \n
    `);\n }\n }\n });\n },\n error: function (error) {\n console.log('error on Masonary ' + error);\n }\n\n });\n }, 1000)\n //});\n }\n //whole day preview\n else if (window.location.href.indexOf(\"previewHome=true\")> -1){\n // function you can use:\n function getSecondPart(str) {\n return str.split('previewHome=true&')[1];\n }\n // use the function:\n var url = window.location.href\n var timeStamp = getSecondPart(url)\n //alert(timeStamp)\n //START THIS\n var rightNow = moment.utc().format('YYYY-MM-DD HH:mm:ss');\n\n $.ajax({\n url: apiURL + \"/tcmws/contentApi/runsheet\",\n type: \"GET\",\n cache: false,\n headers: {\n \"accept\": \"application/json;odata=verbose\"\n },\n success: function(data) {\n\n // ##### Homepage Carousel\n var carouselSlides = data.tcm.homeCarousels;\n let homepageCarouselCount = 0;\n $.each(carouselSlides, function(index, item) {\n if (item.itemType === \"homePageCarousel\") {\n //var startDate = item.field_tcm_main_slider_date_range.substr(0, item.field_tcm_main_slider_date_range.indexOf('&'));\n //var endDate = item.field_tcm_main_slider_date_range.split('&')[1];\n var startDate = moment(item.startDate).format();\n var endDate = moment(item.endDate).format();\n let carouselImage = item.image ? item.image : 'https://via.placeholder.com/824x463/000000/FFFFFF/?text=TCM+Missing+Image';\n\n console.log(\"Start Date: \" + startDate + \" End Date:\" + endDate);\n var now = moment(timeStamp).format();\n if (startDate <= now && now <= endDate && homepageCarouselCount < 8) {\n //console.log(\"Start Date: \" + startDate + \" End Date:\" + endDate);\n // if (item.field_block_1_new_window === \"True\") {\n // item.field_tcm_main_carousel_link_1 = item.field_tcm_main_carousel_link_1.replace(\"tabindex=\", \"target=\\\"_blank\\\" tabindex=\");\n // }\n // if (item.field_block_2_new_window === \"True\") {\n // item.field_tcm_main_carousel_link_2 = item.field_tcm_main_carousel_link_2.replace(\"tabindex=\", \"target=\\\"_blank\\\" tabindex=\");\n // }\n let body_div = \"\";\n if (typeof item.body !== \"undefined\") {\n body_div = \"
    \" + item.body + \"
    \";\n }\n\n let dataTitle = \"\";\n if (item.editorialTitle !== \"\") {\n dataTitle = item.editorialTitle.toString().replace(/[^a-zA-Z\\d\\s]/gi, '');\n } else {\n dataTitle = item.consumerTitle.toString().replace(/[^a-zA-Z\\d\\s]/gi, '');\n }\n\n $(\"#slide-body\").append(\"
    \" + item.consumerTitle + \"
    \" + body_div + \"
    \");\n $(\"#slide-img\").append(\"
    \")\n homepageCarouselCount ++\n } else {\n console.log('Carousel Schedule: ' + item.title + \" is not on the schedule today. It will be up on \" + startDate);\n }\n }\n });\n\n $(document).ready(function() {\n $('.slider-for').slick({\n slidesToShow: 1,\n slidesToScroll: 1,\n arrows: false,\n fade: true,\n asNavFor: '.slider-nav'\n });\n $('.slider-nav').slick({\n slidesToShow: 1,\n slidesToScroll: 1,\n asNavFor: '.slider-for',\n dots: true,\n customPaging: function(slider, i) {\n var thumb = $(slider.$slides[i]).data();\n return '0' + (\n i + 1) + '';\n },\n draggable: false,\n focusOnSelect: true,\n autoplay: false,\n arrows: true,\n prevArrow: '',\n nextArrow: '',\n appendArrows: '.nav-box',\n appendDots: '.nav-box'\n });\n\n\n\n\n });\n\n // ##### Homepage Ads\n if(data.tcm.homeAds.length > 1){\n let is1Roadblocked = false;\n let is2Roadblocked = false;\n let firstRoadBlockIndex;\n let secondRoadBlockIndex;\n\n let filteredArray = []\n $.each(data.tcm.homeAds, function(index, item) {\n if((item.sa1Roadblocked == 'yes' && !is1Roadblocked) && (item.sa2Roadblocked == 'yes' && !is2Roadblocked)){\n is1Roadblocked = true;\n firstRoadBlockIndex = index;\n is2Roadblocked = true;\n secondRoadBlockIndex = index;\n }\n // Check for Roadblocks that are currently published.\n else if (item.sa1Roadblocked == 'yes' && !is1Roadblocked) {\n is1Roadblocked = true;\n firstRoadBlockIndex = index;\n }else if (item.sa2Roadblocked == 'yes' && !is2Roadblocked) {\n is2Roadblocked = true;\n secondRoadBlockIndex = index;\n // Create filtered Array without roadblocks.\n }\n\n else{\n filteredArray.push(item)\n }\n });\n\n //console.log('filteredArray length: '+ filteredArray.length)\n //console.table(filteredArray);\n // /Random Number Generator\n let count = 0\n let floor = filteredArray.length\n let SA1tries = 0\n let SA2tries = 0\n let smallAd = 0;\n let largeAd = 0;\n let adContainer = $('#ad-row');\n if (smallAd == 0 || largeAd == 0) {\n do {\n\n smallAd = Math.floor(Math.random() * floor);\n if(filteredArray[smallAd].SA1 === \"Y\"){\n console.log(filteredArray[smallAd].editorialTitle + \" Got \" + filteredArray[smallAd].SA1 + \" for SA1\")\n }\n else{\n SA1tries++\n smallAd = 0;\n largeAd = 0;\n }\n } while (smallAd === largeAd && SA1tries <= 500);\n\n do {\n largeAd = Math.floor(Math.random() * floor)\n //console.log(\"SA2 Status\")\n if(filteredArray[largeAd].SA2 === \"Y\"){\n console.log(filteredArray[largeAd].editorialTitle + \" Got \" + filteredArray[largeAd].SA2 + \" for SA2\")\n }\n else{\n SA1tries++\n largeAd = 0;\n smallAd = 0;\n }\n } while (largeAd === smallAd && SA1tries <= 500);\n }\n else{\n\n }\n // If RoadBlock for SA1 Ad is found\n if(is1Roadblocked){\n adContainer.append(`\n `);\n // If NO RoadBlock Ad is found for SA1 ... random\n }else{\n if(SA1tries <= 499 || is2Roadblocked){\n //alert(SA1tries)\n adContainer.append(`\n `);\n }\n else{\n\n console.log(\"SA 1 FAILED on this try: \"+ SA1tries)\n }\n }\n\n // If RoadBlock for SA2 Ad is found\n if(is2Roadblocked){\n adContainer.append(`\n
    \n
    \n \n
    \n
    \n

    ${data.tcm.homeAds[secondRoadBlockIndex].adTitle}

    \n \n
    ${data.tcm.homeAds[secondRoadBlockIndex].adCopy}
    \n
    ${data.tcm.homeAds[secondRoadBlockIndex].sa2Link}
    \n
    \n
    \n `);\n // If NO RoadBlock Ad is found for SA2 ... random\n }else{\n if(SA1tries <= 499 || is1Roadblocked){\n adContainer.append(`\n
    \n
    \n \n
    \n
    \n

    ${filteredArray[largeAd].adTitle}

    \n \n
    ${filteredArray[largeAd].adCopy}
    \n
    ${filteredArray[largeAd].sa2Link}
    \n
    \n
    \n `);\n }\n else{\n console.log(\"Failed after \"+ SA1tries + \" attempts\")\n }\n }\n\n // ICID Tracking (1/3 ad block)\n $(\".one-third-ad__text-box__link\").each(function(i) {\n let linkObj = $(this).find('a').first();\n TrackingMetrics.addTrackingToLink(linkObj, \"homepage-sau1\");\n });\n\n // ICID Tracking (2/3 ad block)\n $(\".two-third-ad__text-box__link\").each(function(i) {\n let linkObj = $(this).find('a').first();\n TrackingMetrics.addTrackingToLink(linkObj, \"homepage-sau2\");\n });\n\n }\n else{\n console.log(\"No Ads listed on api \" + apiURL + \"/tcmws/contentApi/runsheet\");\n }\n\n // ##### Homepage Gallery\n var gallery = data.tcm.homeGallery;\n //console.table(gallery)\n $.each(gallery, function(index, item) {\n if (index < 7) {\n // Displays 1st Tile\n if(item.itemType == \"homeVideo\"){\n let image1 = item.imageUrl ? item.imageUrl : 'https://prod-images.tcm.com/img/global/tcm-clip-no-image.png'\n image1 = (image1 === undefined) ? '' : 'https:'+image1.substring(image1.indexOf('//'))\n let titleEditorialClean = item.titleEditorial.toString().replace(/[^a-zA-Z\\d\\s]/gi, '');;\n $(\"#bricks\").append(`\n \n `)\n }else if(item.itemType == \"homeArchive\") {\n let imageArray = [];\n let imageCopyArray = [];\n\n // adding identification seperators to the content arrays.\n // Commas between image.urls .. 3 pipes between imgage copy ,|||\n for (var i = 0, len = item.images.length; i < len; i++) {\n // if description has quotes .. replace with @# .. to be converted back on modal-carousel,js\n let singleDescription = item.images[i].description ? item.images[i].description.replace(/\"/gi, '@#') : ' '\n if(i == 0){\n imageArray.push(item.images[i].url)\n imageCopyArray.push(singleDescription ? singleDescription : ' ' )\n }else if(i == item.images.length ){\n imageArray.push(item.images[i].url)\n imageCopyArray.push(singleDescription ? '|||' + singleDescription : ' ' )\n }else{\n imageArray.push(' ' +item.images[i].url )\n imageCopyArray.push( singleDescription ? '|||' + singleDescription : '|||' )\n }\n };\n let itemImgHttps = (item.images[0].url === undefined) ? '' : 'https:'+item.images[0].url.substring(item.images[0].url.indexOf('//'))\n $(\"#bricks\").append(`\n
    \n
    \n
    ${item.title}
    \n
    \n \n
    \n `);\n }\n }\n });\n\n\n\n },\n error: function(error) {\n console.log('error reaching \\n' + apiURL + '/tcmws/contentApi/runsheet \\n' + error);\n }\n });\n\n\n // loads content for Recently Added block on index page.\n\n // loads content for Recently Added block on index page.\n $.ajax({\n url: apiURL + \"/tcmws/latest/6\",\n type: \"GET\",\n cache: false,\n headers: {\n \"accept\": \"application/json;odata=verbose\",\n },\n success: function(data) {\n $.each(data.tcm.titles, function(index, item) {\n var imageURLs = item.imageProfiles;\n var imageURL = \"https://prod-images.tcm.com/v5cache/TCM/Images/watchtcm/WatchTCM_Placeholder_Films.png\"\n var titleID = item.titleId;\n var description = \"Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis p...\";\n var movieName = \"Movie Name\";\n var releaseYear = \"2019\";\n // image swap for short films\n\n $(\"#watchlist-content\").append(`\n
    \n
    \n \n
    \n
    \n
    \n

    ${movieName}(${releaseYear})

    \n

    ${description}

    \n
    \n
    \n `);\n });\n $(function() {\n $('img[data-src-error]').error(function() {\n var o = $(this);\n var errorSrc = o.attr('data-src-error');\n\n if (o.attr('src') != errorSrc) {\n o.attr('src', errorSrc);\n }\n });\n });\n },\n error: function(error) {\n //console.log('error connecting to url: ' +apiURL+ '/tcmws/latest/6 ' + error + '/n on page: index-page.js');\n }\n });\n //END THIS NOW\n }\n //load regularly scheduled content\n else {\n // fire only on homepage\n if (UrlPathname == '/' || (inPreview && UrlPathname === \"/node\")) {\n\n var rightNow = moment.utc().format('YYYY-MM-DD HH:mm:ss');\n var cacheStamp = moment.utc().format('YYYY-MM-DD');\n $.ajax({\n url: apiURL + \"/tcmws/contentApi/runsheet?\"+cacheStamp,\n type: \"GET\",\n success: function(data) {\n $(document).ready(() => {\n // ##### Homepage Carousel\n var carouselSlides = data.tcm.homeCarousels;\n let homepageCarouselCount = 0;\n $.each(carouselSlides, function(index, item) {\n if (item.itemType === \"homePageCarousel\") {\n var startDate = moment(item.startDate).format();\n var endDate = moment(item.endDate).format();\n let carouselImage = item.image ? item.image : 'https://via.placeholder.com/824x463/000000/FFFFFF/?text=TCM+Missing+Image';\n\n var now = moment().format();\n if (startDate <= now && now <= endDate && homepageCarouselCount < 8) {\n let imageLinkWindow = item.imageLinkWindow == \"YES\" ? true : false\n let body_div = \"\";\n if (typeof item.body !== \"undefined\") {\n body_div = \"
    \" + item.body + \"
    \";\n }\n\n let dataTitle = \"\";\n if (item.editorialTitle !== \"\") {\n dataTitle = item.editorialTitle.toString().replace(/[^a-zA-Z\\d\\s]/gi, '');\n } else {\n dataTitle = item.consumerTitle.toString().replace(/[^a-zA-Z\\d\\s]/gi, '');\n }\n if (index === 0) {\n $(\"#slide-body\").append(`

    ${item.consumerTitle}

    ${body_div}
    `);\n $(\"#slide-img\").append(`
    `)\n } else {\n $(\"#slide-body\").append(`

    ${item.consumerTitle}

    ${body_div}
    `);\n $(\"#slide-img\").append(`
    `)\n }\n\n homepageCarouselCount ++\n } else {\n console.log('Carousel Schedule: ' + item.title + \" is not on the schedule today. It will be up on \" + startDate);\n }\n }\n });\n\n $('.slider-for').slick({\n lazyLoad: 'ondemand',\n slidesToShow: 1,\n slidesToScroll: 1,\n arrows: false,\n fade: true,\n asNavFor: '.slider-nav'\n });\n $('.slider-nav').slick({\n lazyLoad: 'ondemand',\n slidesToShow: 1,\n slidesToScroll: 1,\n asNavFor: '.slider-for',\n dots: true,\n customPaging: (slider, i) => `0${i + 1}`,\n draggable: false,\n focusOnSelect: true,\n autoplay: false,\n arrows: true,\n prevArrow: '',\n nextArrow: '',\n appendArrows: '.nav-box',\n appendDots: '.nav-box'\n });\n\n // ICID Tracking (Homepage carousel)\n $(\"#slide-img .slick-slide:not(.slick-cloned)\").each(function(i) {\n let linkObj = $(this).find('a').first();\n var linkText = linkObj.attr(\"data-title\");\n TrackingMetrics.addTrackingToLink(linkObj, \"homepage-carousel\", i);\n\n let slideTextBlock = $(\"#slide-text-\" + i);\n let slideLinks = slideTextBlock.find('a');\n if (slideLinks !== undefined) {\n slideLinks.each(function() {\n TrackingMetrics.addTrackingToLink($(this), \"homepage-carousel\", i, linkText);\n });\n }\n });\n\n\n // ##### Homepage Ads\n\n if (data?.tcm?.homeAds?.length ?? 0 > 0) {\n let adContainer = $('#ad-row');\n let is1Roadblocked = true;\n let is2Roadblocked = true;\n const sa1FilteredArray = data.tcm.homeAds.filter(ad => ad.SA1 === 'Y');\n const sa2FilteredArray = data.tcm.homeAds.filter(ad => ad.SA2 === 'Y');\n\n let sa1Index = sa1FilteredArray.findIndex(ad => ad.sa1Roadblocked === 'yes');\n let sa2Index = sa2FilteredArray.findIndex(ad => ad.sa2Roadblocked === 'yes');\n\n if (sa1Index === -1) {\n is1Roadblocked = false;\n sa1Index = Math.floor(Math.random() * sa1FilteredArray.length);\n }\n\n if (sa2Index === -1) {\n is2Roadblocked = false;\n sa2Index = Math.floor(Math.random() * sa2FilteredArray.length);\n }\n\n // Ensure that both ad units aren't the same.\n if (!is1Roadblocked && !is2Roadblocked && sa1FilteredArray[sa1Index].contentId === sa2FilteredArray[sa2Index].contentId) {\n sa2FilteredArray.splice(sa2Index, 1);\n sa2Index = Math.floor(Math.random() * sa2FilteredArray.length);\n }\n\n adContainer.append(`\n
    \n
    \n \"${sa1FilteredArray[sa1Index].adTitle}\"/\n
    \n
    \n

    ${sa1FilteredArray[sa1Index].adShortCopy}

    \n
    \n
    ${sa1FilteredArray[sa1Index].sa1Link}
    \n
    \n
    \n
    \n
    \n \"${sa2FilteredArray[sa2Index].adTitle}\"/\n
    \n
    \n

    ${sa2FilteredArray[sa2Index].adTitle}

    \n
    \n
    ${sa2FilteredArray[sa2Index].adCopy}
    \n
    ${sa2FilteredArray[sa2Index].sa2Link}
    \n
    \n
    `);\n\n // ICID Tracking (1/3 ad block)\n $(\".one-third-ad__text-box__link\").each(function (i) {\n let linkObj = $(this).find('a').first();\n TrackingMetrics.addTrackingToLink(linkObj, \"homepage-sau1\");\n });\n\n // ICID Tracking (2/3 ad block)\n $(\".two-third-ad__text-box__link\").each(function (i) {\n let linkObj = $(this).find('a').first();\n TrackingMetrics.addTrackingToLink(linkObj, \"homepage-sau2\");\n });\n\n } else {\n console.log(\"No Ads listed on api \" + apiURL + \"/tcmws/contentApi/runsheet\");\n }\n\n // ##### Homepage Masonry\n var gallery = data.tcm.homeGallery;\n $.each(gallery, function(index, item) {\n if (index < 7) {\n // Displays 1st Tile\n if(item.itemType == \"homeVideo\"){\n let image1 = item.imageUrl ? item.imageUrl : 'https://prod-images.tcm.com/img/global/tcm-clip-no-image.png'\n image1 = (image1 === undefined) ? '' : 'https:'+image1.substring(image1.indexOf('//'))\n let titleEditorialClean = item.titleEditorial.toString().replace(/[^a-zA-Z\\d\\s]/gi, '');;\n $(\"#bricks\").append(`\n \n `)\n }else if(item.itemType == \"homeArchive\") {\n let imageArray = [];\n let imageCopyArray = [];\n\n // adding identification seperators to the content arrays.\n // Commas between image.urls .. 3 pipes between imgage copy ,|||\n for (var i = 0, len = item.images.length; i < len; i++) {\n // if description has quotes .. replace with @# .. to be converted back on modal-carousel,js\n let singleDescription = item.images[i].description ? item.images[i].description.replace(/\"/gi, '@#') : ' '\n if(i == 0){\n imageArray.push(item.images[i].url)\n imageCopyArray.push(singleDescription ? singleDescription : ' ' )\n }else if(i == item.images.length ){\n imageArray.push(item.images[i].url)\n imageCopyArray.push(singleDescription ? '|||' + singleDescription : ' ' )\n }else{\n imageArray.push(' ' +item.images[i].url )\n imageCopyArray.push( singleDescription ? '|||' + singleDescription : '|||' )\n }\n };\n let itemImgHttps = (item.images[0].url === undefined) ? '' : 'https:'+item.images[0].url.substring(item.images[0].url.indexOf('//'))\n $(\"#bricks\").append(`\n
    \n
    \n
    ${item.title}
    \n
    \n \n
    \n `);\n }\n }\n });\n\n $('.tcm-modal').on('click', function () {\n const inputData = {\n overlay_type: this.getAttribute('data-overlay-type'),\n overlay_img: this.getAttribute('data-overlay-img-array'),\n overlay_copy: this.getAttribute('data-overlay-img-copy'),\n overlay_title: this.getAttribute('data-overlay-title'),\n overlay_subtitle: this.getAttribute('data-overlay-subtitle')\n };\n\n modalCreation(inputData);\n\n function modalCreation(vodData){\n // Build modal player sub template\n vodData.modal_player_template = '\\\n
    \\\n
    \\\n
    DONE
    \\\n
    \\\n
    \\\n
    \\\n
    \\\n
    \\\n
    \\\n
    \\\n
    \\\n
    \\\n \\\n
    \\\n

    ' + inputData.title + '

    \\\n
    \\\n

    '+inputData.des+'

    \\\n
    ';\n\n\n inputData.template = vodData.modal_player_template;\n\n\n const custom_options_that_are_not_required = {\n onClose: function(inputData) {\n window.console.log('Is the modal open?', this.getIsOpen());\n window.console.log('Additional on close event', inputData);\n $('.modal-overlay__header-offset').removeClass('visually-hidden');\n },\n // called after Modal.js\n onOpen: function(inputData) {\n if(inputData.overlay_type == 'slider'){\n //initiate slick slider\n populateOverlayCarousel( inputData)\n }else if(inputData.overlay_type == 'video'){\n alert('initiate Video player')\n }else{\n alert('Not slider')\n }\n\n // header offset has odd bg, correct with addclass\n $('.modal-overlay__header-offset').addClass('visually-hidden');\n }\n };\n\n const modal = new Modal(inputData, custom_options_that_are_not_required);\n modal.open(inputData);\n }\n });\n\n function populateOverlayCarousel( inputData){\n let carouselImageArray = inputData.overlay_img.split(\", \");\n let carouselImageCopyArray = inputData.overlay_copy.split(\",|||\");\n let carouselImageCopyArrayEscaped = carouselImageCopyArray.map(item => item.replace(/@#/g, '\"') )\n\n $('.modal-overlay__content__main').prepend(`
    ${inputData.overlay_subtitle}
    `);\n $('.modal-overlay__content__main').prepend(`
    ${inputData.overlay_title}
    `);\n // removes last of array that is empty ... yeah sloppy, should have been done in twig\n\n let count = 0;\n carouselImageArray.forEach(img => {\n $('.modal-overlay__content__main--carousel').append(`
    ${carouselImageCopyArrayEscaped[count] ? carouselImageCopyArrayEscaped[count] : \" \"}
    `);\n count ++;\n });\n\n $('.modal-overlay__content__main--carousel').slick({\n dots: true,\n customPaging: function (slider, i) {\n var thumb = $(slider.$slides[i]).data();\n if(i < 9){ // adds a preceding ZERO to slider count if below 9\n return '0' + (i + 1) + '';\n }else{ // removes preceding ZERO to slider count if above 9\n return '' + (i + 1) + '';\n }\n },\n nextArrow: '',\n prevArrow: '',\n infinite: false\n //dotsClass: 'overlay-carousel-dots'\n //appendDots:\n });\n }\n\n // ICID Tracking\n $(\".grid-photo-video__wrap\").each(function(i) {\n $(this).on(\"click\", function() {\n let linkText = $(this).hasClass(\"video\") ? $(this).find('a').first().attr(\"data-title\") : $(this).attr(\"data-overlay-title\");\n let linkTextFormated = TrackingMetrics.formatText(linkText);\n try {\n window.trackMetrics({\n type: 'click-interaction',\n data: {\n url: \"homepage-photos-videos\" + i + \"-\" + linkTextFormated,\n interaction: \"photos-videos\",\n interactionevent: 1\n }\n });\n } catch (e) {\n console.log(\"Unable to track homepage-photos-videos\" + i + \"-\" + linkTextFormated);\n }\n });\n });\n });\n\n },\n error: function(error) {\n console.log('error reaching \\n' + apiURL + '/tcmws/contentApi/runsheet \\n' + error);\n }\n });\n\n\n // loads content for Recently Added block on index page.\n $.ajax({\n // Legacy\n url: apiURL + \"/tcmws/latest/6\",\n type: \"GET\",\n headers: {\n \"accept\": \"application/json;odata=verbose\",\n },\n success: function(data) {\n console.log('Success hitting api\\n'+ apiURL + '/tcmws/latest/6' )\n $.each(data.tcm.titles, function(index, item) {\n var imageURL;\n var titleID = item.titleId;\n var description = item.description ? item.description : '';\n description = description.length > 150 ? description.substring(0, 150) + \" ...\" : description;\n var movieName = item.name ? item.name : '';\n var releaseYear = item.releaseYear ? item.releaseYear : '';\n var icid = movieName + \" \" + releaseYear;\n\n var icid = icid.toLowerCase().replace(/[^a-zA-Z\\d\\s]/gi, '');\n icid = icid.replace(/ /g, '-');\n // image swap for short films\n $.each(item.imageProfiles, function(index, image) {\n if (image.usage == \"homepageExploreThumb\") {\n imageURL = image.url;\n\n // IF it's a short and has placeholder .. replace image\n if(item.isShort && imageURL == 'https://prod-images.tcm.com//img/global/placeholder-films.png?w=319&h=180'){\n imageURL = 'https://prod-images.tcm.com/img/schedule-page/placeholder-short-film.jpg??h=470&w=265'\n }\n }\n })\n\n $(document).ready(function() {\n $(\"#watchlist-content\").append(`\n
    \n
    \n \n
    \n
    \n
    \n

    ${movieName}(${releaseYear})

    \n

    ${description}

    \n
    \n
    \n `);\n });\n });\n\n $(function() {\n $('img[data-src-error]').error(function() {\n var o = $(this);\n var errorSrc = o.attr('data-src-error');\n\n if (o.attr('src') != errorSrc) {\n o.attr('src', errorSrc);\n }\n });\n });\n\n },\n error: function(error) {\n console.log('error reaching \\n'+apiURL + '/tcmws/latest/6\\n' + error);\n }\n });\n\n }\n }\n }\n}\n","export default class stickyNav {\n\n static initialize(UrlPathname) {\n\n const throttle = (func, limit) => {\n let inThrottle\n return function () {\n const args = arguments\n const context = this\n if (!inThrottle) {\n func.apply(context, args)\n inThrottle = true\n setTimeout(() => inThrottle = false, limit)\n }\n }\n }\n\n // Sticky Nav -- When the user scrolls the page run function\n if(UrlPathname == '/schedule' || UrlPathname == '/schedule-monthly'){\n document.addEventListener('DOMContentLoaded', loadStickyNav, false);\n\n $(window).on('orientationchange', function(event) {\n loadStickyNav();\n });\n\n function loadStickyNav(){\n let mainNav = document.querySelector(\".watch__header\");\n let headerblock = document.querySelector(\".schedule__header\");\n // scheduleNav only used on daily schedule page\n let scheduleNav = document.querySelector(\".sticky-wrapper-nav\") || '';\n let dailyLineBreaks ;\n\n // after dom items load grab day headers and add classes\n setTimeout(function(){\n dailyLineBreaks = Array.from(document.querySelectorAll(\".scheduled--day-line-break\") );\n // On monthly-schedule make all daily header sticky when you scroll down\n // Also used on daily-schedule when schedule search is active\n dailyLineBreaks.forEach(ele => {\n if (window.innerWidth >= 1000 || (window.innerWidth > 550 && window.innerWidth < 1000 && window.matchMedia(\"(orientation: portrait)\").matches)) {\n ele.style.top = mainNav.offsetHeight + headerblock.offsetHeight + 'px';\n } else {\n ele.style.top = mainNav.offsetHeight + 'px';\n }\n ele.classList.add('schedule-scroll-pad');\n });\n }, 1000)\n\n // When the user scrolls the page run function\n window.onscroll = throttle(function() {\n return createStickyNavEle();\n }, 1000);\n \n \n\n window.onresize = throttle(function() {\n loadStickyNav();\n return createStickyNavEle();\n }, 500);\n\n // Items to stick on scroll - Daily-Schedule Page mainNav / headerblock / scheduleNav\n // Items to stick on scroll - Monthly-Schedule Page mainNav / headerblock\n\n // Calculate the Css Top: position on scroll.\n function createStickyNavEle() {\n // if not mobile or mobile landscape\n if ((window.innerWidth > 550 && window.innerWidth < 1000 && !window.matchMedia(\"(orientation: landscape)\").matches) || window.innerWidth >= 1000) {\n // make the header area sticky\n headerblock.style.top = mainNav.offsetHeight + 'px';\n if(UrlPathname == '/schedule'){\n // make the daily nav bar sticky\n scheduleNav.style.top = (mainNav.offsetHeight + headerblock.offsetHeight) +'px';\n }\n }\n }\n setTimeout(function(){headerblock.style.top = mainNav.offsetHeight + 'px';});\n }\n }\n }\n}\n","import TrackingMetrics from \"./tracking-metrics\";\n\n// the global subnav (currently , , ect ) will routinly be changed (added / subtracted from)\n// with the brand not adhearing to link or name length, often with the overall nav length being longer than parent container\n// this page fixes that. \nexport default class responsiveSubNav {\n\n static initialize() {\n document.addEventListener('DOMContentLoaded', subNavReWrite, false);\n \n function subNavReWrite(){\n // in main header subnav, show/hide nav elements when the nav list lenght exceeds the containing div\n let enterpriseSubNav = document.querySelector('#block-subnavigation ul') \n let enterpriseSubNavMenuItems = Array.from(enterpriseSubNav.querySelectorAll('li')) \n let menuLenghtArray = enterpriseSubNavMenuItems.map( link => link.offsetWidth) // finds the px length of each sub nav meun item\n let hiddenMenuList = [];\n let stringToBeAppended = '';\n let secondCount = 0\n let currentLength = menuLenghtArray[0];\n\n // loop through array of menu items\n for(let i = 0; i < menuLenghtArray.length; i++){\n stringToBeAppended += '
  • '+enterpriseSubNavMenuItems[i].innerHTML+'
  • ' \n }\n // close the
    • tags\n stringToBeAppended += '
    ';\n enterpriseSubNav.innerHTML = ''\n enterpriseSubNav.innerHTML = stringToBeAppended\n\n // add eventLis to the elipsis ... thingy and toggle active class on click\n // const hiddenMenu = enterpriseSubNav.querySelector('.flyout');\n // hiddenMenu.addEventListener('click', function(){\n // this.firstElementChild.classList.toggle('hidden')\n // });\n\n // Fire tracking metrics after menu has been rebuilt\n TrackingMetrics.bottomMenu();\n }\n }\n}\n","import { createBroadcastEventSchema } from './Schema';\n\nexport default class ScheduleDaily {\n\n static initialize(UrlPathname, apiURL) {\n // only activate if on daily schedule page.\n if(UrlPathname == '/schedule'){\n\n document.addEventListener('DOMContentLoaded', loadDailyScheduleFunctionality, false);\n let isSchemaSet = false;\n\n\n function loadDailyScheduleFunctionality(){\n\n // View of /Preview Page found from /admin/Secret-Sechdule\n if (window.location.href.indexOf(\"?previewSchedule=true\") > -1) {\n // set defaults if page is a content refresh values will be overwritten\n let scheduleClassName = 'us-schedule'\n let scheduleDisplayName = 'U.S.'\n let timezoneeDisplayName = 'EASTERN'\n let timeZone = 'et';\n // let scheduleDateClicked = 'today'; // not used?\n let searchIsActive = false\n let dateToDisplay = moment().format('MM') +'-'+moment().format('DD') ;\n let searchValue = document.getElementById('searchBox')\n let cancelSearchBtn = searchValue.nextElementSibling\n let timeZoneScheduleBtn = $('.timezone-btn')\n let timezoneList = timeZoneScheduleBtn.siblings('.timezone-overlay-content')\n let loader = document.querySelector('.loader')\n let dynamicContent = document.querySelector('.schedule__daily__container')\n let clearSearchBtn = document.querySelector('.schedule__header--search__clear')\n let mainNav = document.querySelector(\".watch__header\");\n let headerblock = document.querySelector('.schedule__header')\n let scheduleNav = document.querySelector(\".sticky-wrapper-nav\");\n let emptySearchDiv = document.querySelector('.scheduled--vod--search-return-empty')\n let emptyDayDiv = document.querySelector('.scheduled--vod--day-return-empty')\n let totalVodCount = 0;\n let count = 0;\n let ajaxCall = 0;\n let scheduleContainerMaster = $('#schedule')\n\n mainNav.classList.add(\"daily_schedule\")\n\n function closeTimeZoneModal(){\n timeZoneScheduleBtn.removeClass('active');\n timezoneList.removeClass('active')\n $('body').css('overflow-y','scroll')\n }\n\n function resetTimeZoneOverlayMobile(currentScheduleClassName, currentTimeZone){\n //resets schedule back to current applied state\n $('.schedule').removeClass('active');\n $('.schedule').each(function(){\n if( $(this).data('schedule') == currentScheduleClassName){\n $(this).addClass('active');\n }\n })\n\n //resets timezone back to current applied state\n $('.timezone').removeClass('active');\n $('.timezone').each(function(){\n if( $(this).data('timezone') == currentTimeZone){\n $(this).addClass('active');\n }\n })\n }\n\n\n function refreshPage(scheduleClassName, timeZone){\n // grab all schedule data\n let currentScheduleClassName = scheduleClassName;\n let currentTimeZone = timeZone;\n console.log('scheduleClassName '+ scheduleClassName + '\\ntimeZone '+ timeZone)\n loader.classList.remove('hidden')\n dynamicContent.classList.add('hidden')\n searchValue.value = '';\n\n var USA = localStorage.getItem(\"USASched\");\n var USATable = JSON.parse(USA)\n\n var CAN = localStorage.getItem(\"CANSched\");\n var CANTable = JSON.parse(CAN)\n\n console.log('ajax success ---')\n console.log('API connection succe: '+apiURL+'/tcmws/MonthSchedule\\nPage schedule-daily.js');\n let navElementsArray = [];\n let currentTimeStamp = moment().toISOString();\n let isCurrentVod = false;\n let isToday = false;\n let timeZoneOffset;\n let dailyNavContainer = $(\"#pnProductNavContents\")\n dailyNavContainer.empty()\n scheduleContainerMaster.empty()\n switch(timeZone){\n case 'ct':\n timeZoneOffset = '-05:00';\n break;\n case 'mt':\n timeZoneOffset = '-06:00';\n break;\n case 'pt':\n timeZoneOffset = '-07:00';\n break;\n default:\n timeZoneOffset = '-04:00' ;\n }\n\n $.each(USATable, function (index, item) {\n // garbage content check .. if there' no name .. fkit\n if(item.Name !== null){\n // format startdate and reassign\n item.StartDate = moment(item.StartDate).utcOffset(timeZoneOffset);\n let fullDateYear = moment(item.StartDate).format('MM') +'-'+moment(item.StartDate).format('DD');\n let dayofWeek = moment(item.StartDate).format('dddd');\n let monthString = moment(item.StartDate).format('MMM');\n let fullMonthString = moment(item.StartDate).format('MMMM');\n let monthInt = moment(item.StartDate).format('MM');\n let dayNo = moment(item.StartDate).format('DD');\n let dayNoNoZero = moment(item.StartDate).format('D');\n let startTime = moment(item.StartDate).format('h:mm');\n let ampm = moment(item.StartDate).format('a');\n let country = item.NetworkFeedCode;\n item.Available = (item.Available == 'TRUE') // change string to boolean\n let url = '/tcmdb/title/'+ item.TitleId + '/' + item.urlSlug;\n item.Length = item.Length ? (item.Length > 60 ? ( Math.floor( item.Length / 60) + 'h ' + (item.Length % 60) + 'm ' ) : item.Length + 'm' ) : '';\n isToday = fullDateYear == dateToDisplay ? true : false;\n\n // find currently playing vod .. will result in 2, one CAN one US\n if(currentTimeStamp >= moment(item.StartDate).toISOString() && currentTimeStamp <= moment(item.EndDate).toISOString()){\n isCurrentVod = true;\n if (!isSchemaSet) {\n createBroadcastEventSchema(item);\n isSchemaSet = true;\n }\n }\n // Navigation: Iterate through all content, grab and create date ranges, give active state to today's\n // Create array, Remove for duplicate dates then create Nav\n let isDateAlreadyInNav = navElementsArray.find(date => date == (monthInt+'-'+dayNo) );\n if(!isDateAlreadyInNav && dayofWeek !== 'Invalid date'){\n navElementsArray.push( monthInt+'-'+dayNo);\n $(\"#pnProductNavContents\").append(`\n
    \n
    ${ isToday? 'Today' : dayofWeek.substring(0, 3)}
    \n
    ${monthString} ${dayNo}
    \n
    `);\n }\n\n\n // Append all VOD's to page with active states given to today's date.\n //var infoClass = \"schedule-status-\"+item.status;\n let vodUrlAvalible = item.status == 'yes' ? true : false;\n var profileImage = item.profileImage;\n if(profileImage == null){\n profileImage = \"https://prod-images.tcm.com/img/schedule-page/placeholder-vod-film.jpg?w=900\"\n }\n scheduleContainerMaster.append(`\n ${!isDateAlreadyInNav ? `\n
    ${dayofWeek}, ${fullMonthString} ${dayNoNoZero}
    ` : ''}\n
    \n
    \n
    \n
    ${startTime}
    \n
    ${ampm}
    \n
    \n
    \n ${isCurrentVod ? `` : `${item.Available ? `` : ``} ` }\n
    \n ${profileImage ? ` ` : ` `}\n ${item.Available || isCurrentVod ? `
    ` : ``}\n ${isCurrentVod ? '
    On Now
    ': '' }\n
    \n ${isCurrentVod || item.Available ? `
    ` : ``}\n
    \n
    ${item.Name} (${item.ReleaseYear})
    \n
    ${item.Length ? item.Length +' | ' : ''}${item.tvGenres ? item.tvGenres : ''} ${item.tvRating ? \" | \"+item.tvRating : ''}
    \n
    ${ item.Storyline ? (item.Storyline.length < 80) ? item.Storyline : item.Storyline.substring(0,80)+'...' : 'No Description available' }
    \n
    \n
    Director
    \n
    ${item.Director ? item.Director : 'No Director Information Available.'}
    \n
    \n
    \n
    Cast
    \n
    ${item.Cast ? item.Cast.replace(/,/g , ', ') : 'No Cast Information Available.'}
    \n
    \n MORE INFO \n
    \n
    \n
    `)\n isCurrentVod = false;\n } // end garbage content check\n }); // end each loop\n $.each(CANTable, function (index, item) {\n // garbage content check .. if there' no name .. fkit\n if(item.Name !== null){\n // format startdate and reassign\n item.StartDate = moment(item.StartDate).utcOffset(timeZoneOffset);\n let fullDateYear = moment(item.StartDate).format('MM') +'-'+moment(item.StartDate).format('DD');\n let dayofWeek = moment(item.StartDate).format('dddd');\n let monthString = moment(item.StartDate).format('MMM');\n let fullMonthString = moment(item.StartDate).format('MMMM');\n let monthInt = moment(item.StartDate).format('MM');\n let dayNo = moment(item.StartDate).format('DD');\n let dayNoNoZero = moment(item.StartDate).format('D');\n let startTime = moment(item.StartDate).format('h:mm');\n let ampm = moment(item.StartDate).format('a');\n let country = item.NetworkFeedCode;\n item.Available = (item.Available == 'TRUE') // change string to boolean\n let url = '/tcmdb/title/'+ item.TitleId + '/' + item.urlSlug;\n item.Length = item.Length ? (item.Length > 60 ? ( Math.floor( item.Length / 60) + 'h ' + (item.Length % 60) + 'm ' ) : item.Length + 'm' ) : '';\n isToday = fullDateYear == dateToDisplay ? true : false;\n\n // find currently playing vod .. will result in 2, one CAN one US\n if(currentTimeStamp >= moment(item.StartDate).toISOString() && currentTimeStamp <= moment(item.EndDate).toISOString()){\n isCurrentVod = true;\n if (!isSchemaSet) {\n createBroadcastEventSchema(item);\n isSchemaSet = true;\n }\n }\n // Navigation: Iterate through all content, grab and create date ranges, give active state to today's\n // Create array, Remove for duplicate dates then create Nav\n let isDateAlreadyInNav = navElementsArray.find(date => date == (monthInt+'-'+dayNo) );\n if(!isDateAlreadyInNav && dayofWeek !== 'Invalid date'){\n navElementsArray.push( monthInt+'-'+dayNo);\n $(\"#pnProductNavContents\").append(`\n
    \n
    ${ isToday? 'Today' : dayofWeek.substring(0, 3)}
    \n
    ${monthString} ${dayNo}
    \n
    `);\n }\n\n\n // Append all VOD's to page with active states given to today's date.\n //var infoClass = \"schedule-status-\"+item.status;\n let vodUrlAvalible = item.status == 'yes' ? true : false;\n var profileImage = item.profileImage;\n if(profileImage == null){\n profileImage = \"https://prod-images.tcm.com/img/schedule-page/placeholder-vod-film.jpg?w=900\"\n }\n scheduleContainerMaster.append(`\n ${!isDateAlreadyInNav ? `\n
    ${dayofWeek}, ${fullMonthString} ${dayNoNoZero}
    ` : ''}\n
    \n
    \n
    \n
    ${startTime}
    \n
    ${ampm}
    \n
    \n
    \n ${isCurrentVod ? `` : `${item.Available ? `` : ``} ` }\n
    \n ${profileImage ? ` ` : ` `}\n ${item.Available || isCurrentVod ? `
    ` : ``}\n ${isCurrentVod ? '
    On Now
    ': '' }\n
    \n ${isCurrentVod || item.Available ? `
    ` : ``}\n
    \n
    ${item.Name} (${item.ReleaseYear})
    \n
    ${item.Length ? item.Length +' | ' : ''}${item.tvGenres ? item.tvGenres : ''} ${item.tvRating ? \" | \"+item.tvRating : ''}
    \n
    ${ item.Storyline ? (item.Storyline.length < 80) ? item.Storyline : item.Storyline.substring(0,80)+'...' : 'No Description available' }
    \n
    \n
    Director
    \n
    ${item.Director ? item.Director : 'No Director Information Available.'}
    \n
    \n
    \n
    Cast
    \n
    ${item.Cast ? item.Cast.replace(/,/g , ', ') : 'No Cast Information Available.'}
    \n
    \n MORE INFO \n
    \n
    \n
    `)\n isCurrentVod = false;\n } // end garbage content check\n }); // end each loop\n\n // ajaxStop fires mulitiple times because of Timezone and US/Canidian toggle\n // changes create another call to api for updated times. correcting by using loop\n console.log('should run Once 1----- ')\n setTimeout(function(){\n\n\n console.log('should run Once 2----- ')\n let timeout = null;\n\n // VODs that are todays date (defalult us-schedule / defatult ET schedule) On page load\n if(!searchIsActive){\n //console.log('should be running this? ')\n $('.scheduled--vod ').each(function(){\n if ($(this).data('vod-date') == dateToDisplay && $(this).hasClass(scheduleClassName) ){\n $(this).removeClass('scheduleHidden')\n }else{\n $(this).addClass('dayFilterHidden')\n }\n });\n setTimeout(currentVodScroll, 100)\n }\n\n // TimeZone and us/canadian click - schedule modification\n timeZoneScheduleBtn.off() // remove previous eventlistner\n timeZoneScheduleBtn.on('click', function(event){\n event.stopPropagation();\n // toggle class on timezone btn and flyout menu\n if( $(this).hasClass('active') ){\n $('body').css('overflow-y','scroll')\n $(this).removeClass('active')\n timezoneList.removeClass('active')\n }else{\n $('body').css('overflow-y','hidden')\n $(this).addClass('active')\n timezoneList.addClass('active')\n }\n\n })\n\n // Close Timezone and us/canadian flyout on window click\n if(window.innerWidth >= 1024){\n $(window).click(function() {\n timeZoneScheduleBtn.removeClass('active');\n timezoneList.removeClass('active')\n $('body').css('overflow-y','scroll')\n });\n }\n\n $('.timezone-overlay-content #close-modal').click(function() {\n resetTimeZoneOverlayMobile(currentScheduleClassName, currentTimeZone);\n closeTimeZoneModal();\n });\n\n $('.timezone-overlay-content #cancel-button').click(function() {\n resetTimeZoneOverlayMobile(currentScheduleClassName, currentTimeZone);\n closeTimeZoneModal();\n });\n\n $('.timezone-overlay-content #apply-button').click(function() {\n closeTimeZoneModal();\n refreshPage(scheduleClassName , timeZone);\n timeZoneScheduleBtn.find('span').text(timeZoneScheduleBtnChg());\n });\n\n // Timezone - add eventlistner to each flyout nav element\n // When Schedule is clicked (US/Canidian) the content is already on the page. show/hide is run\n // When Timezones are changed, page is refreshed to correctly order the hours.\n timezoneList.off() // remove previous eventlistner\n timezoneList.children('.timezone-content').children('li').each( function(){\n $(this).off()\n $(this).on('click', function(){\n //console.log('click')\n // identify if schedule portion or timezone was clicked\n let whatChanged = $(this).data('schedule') ? 'schedule' : 'timezone';\n console.log(whatChanged)\n // handle Schedule clicks / changes\n if(whatChanged == 'schedule'){\n // change style on btn dropdown\n $('.schedule').toggleClass('active')\n scheduleClassName = $(this).data('schedule');\n // Toggle VOD's on page based on Schedule selection\n $('.scheduled--vod ').each(function(){\n // search is active\n if(searchIsActive){\n // remove day filter class\n $(this).removeClass('dayFilterHidden')\n // current vod is in current schedule\n if( $(this).hasClass(scheduleClassName) && !$(this).hasClass('searchHidden') ) {\n $(this).removeClass('scheduleHidden')\n }else{\n $(this).addClass('scheduleHidden')\n }\n }else{\n // if not in search view // in current schedule if date = today\n if( $(this).hasClass(scheduleClassName) && $(this).data('vod-date') == dateToDisplay ) {\n $(this).removeClass('scheduleHidden')\n $(this).removeClass('dayFilterHidden')\n }else{\n $(this).addClass('scheduleHidden')\n $(this).removeClass('dayFilterHidden')\n }\n }\n });\n if(count <=1){\n console.log('timezone Page Refresh() ----')\n refreshPage( scheduleClassName , timeZone)\n timeZoneScheduleBtn.find('span').text(timeZoneScheduleBtnChg())\n }\n }\n // Timezone clicks / changes\n else{\n timeZone = $(this).data('timezone');\n $('.timezone').removeClass('active');\n $('.timezone').each(function(){\n if( $(this).data('timezone') == timeZone){\n $(this).addClass('active');\n }\n })\n\n if(window.innerWidth >= 1024){\n $('#schedule').empty()\n loader.classList.remove('hidden')\n\n /*$('.schedule__nav__date--ele ').remove();\n $('.scheduled--vod').remove()\n $('.scheduled--day-line-break') */\n //console.log('outside tz: ' + timeZone)\n if(count <=1){\n console.log('timezone Page Refresh() ----')\n refreshPage( scheduleClassName , timeZone)\n timeZoneScheduleBtn.find('span').text(timeZoneScheduleBtnChg())\n }\n }\n }\n })\n })\n\n // Daily Navigation - click - shows VODs for Date of clicked data\n $('.schedule__nav__date--ele').click( function(){\n let clickedNavElement = $(this).data('vod-date');\n dateToDisplay = clickedNavElement;\n let headerId = \"vod-\"+dateToDisplay;\n // remove active class from Main nav then add it to clicked link\n $('.schedule__nav__date--ele').removeClass('active')\n $(this).addClass('active')\n // Loop through Vods and\n $('.scheduled--vod ').each(function(){\n if( $(this).data('vod-date') == clickedNavElement && $(this).hasClass(scheduleClassName)){\n $(this).removeClass('dayFilterHidden');\n $(this).removeClass('scheduleHidden');\n }else{\n $(this).addClass('dayFilterHidden');\n }\n });\n $(\"div\").each(function(){\n //$(this).hide();\n if($(this).hasClass('headerHidden')&& $(this).attr('id') == headerId ) {\n $(this).show();\n }\n else if ($(this).hasClass('headerHidden')&& $(this).attr('id') != headerId ){\n $(this).hide();\n }\n });\n // If Today Btn is clicked on Daily Nav, display page and .. scroll to now playing\n if(clickedNavElement == moment().format('MM') +'-'+moment().format('DD') ){\n setTimeout(currentVodScroll, 100)\n }else{\n document.documentElement.scrollTop = 0\n }\n\n });\n\n // Daily Navigation - Right / Left movement\n setTimeout(buildDailyNavigation, 500)\n function buildDailyNavigation(){\n\n var SETTINGS = {\n navBarTravelling: false,\n navBarTravelDirection: \"\",\n navBarTravelDistance: 600\n }\n\n document.documentElement.classList.remove(\"no-js\");\n document.documentElement.classList.add(\"js\");\n\n // Out advancer buttons\n var pnAdvancerLeft = document.getElementById(\"pnAdvancerLeft\");\n var pnAdvancerRight = document.getElementById(\"pnAdvancerRight\");\n var pnProductNav = document.getElementById(\"pnProductNav\");\n var pnProductNavContents = document.getElementById(\"pnProductNavContents\");\n\n pnProductNav.setAttribute(\"data-overflowing\", determineOverflow(pnProductNavContents, pnProductNav));\n pnAdvancerRight.children[0].classList.remove('hidden')\n // Handle the scroll of the horizontal container\n var last_known_scroll_position = 0;\n var ticking = false;\n\n function doSomething(scroll_pos) {\n pnProductNav.setAttribute(\"data-overflowing\", determineOverflow(pnProductNavContents, pnProductNav));\n }\n\n pnProductNav.addEventListener(\"scroll\", function() {\n last_known_scroll_position = window.scrollY;\n if (!ticking) {\n window.requestAnimationFrame(function() {\n doSomething(last_known_scroll_position);\n ticking = false;\n });\n }\n ticking = true;\n });\n\n\n pnAdvancerLeft.addEventListener(\"click\", function() {\n // If in the middle of a move return\n if (SETTINGS.navBarTravelling === true) {\n return;\n }\n // If we have content overflowing both sides or on the left\n if (determineOverflow(pnProductNavContents, pnProductNav) === \"left\" || determineOverflow(pnProductNavContents, pnProductNav) === \"both\") {\n // Find how far this panel has been scrolled\n var availableScrollLeft = pnProductNav.scrollLeft;\n // If the space available is less than two lots of our desired distance, just move the whole amount\n // otherwise, move by the amount in the settings\n if (availableScrollLeft < SETTINGS.navBarTravelDistance * 2) {\n pnProductNavContents.style.transform = \"translateX(\" + availableScrollLeft + \"px)\";\n } else {\n pnProductNavContents.style.transform = \"translateX(\" + SETTINGS.navBarTravelDistance + \"px)\";\n }\n // We do want a transition (this is set in CSS) when moving so remove the class that would prevent that\n pnProductNavContents.classList.remove(\"pn-ProductNav_Contents-no-transition\");\n // Update our settings\n SETTINGS.navBarTravelDirection = \"left\";\n SETTINGS.navBarTravelling = true;\n }\n // Now update the attribute in the DOM\n pnProductNav.setAttribute(\"data-overflowing\", determineOverflow(pnProductNavContents, pnProductNav));\n });\n\n pnAdvancerRight.addEventListener(\"click\", function() {\n // If in the middle of a move return\n if (SETTINGS.navBarTravelling === true) {\n return;\n }\n // If we have content overflowing both sides or on the right\n if (determineOverflow(pnProductNavContents, pnProductNav) === \"right\" || determineOverflow(pnProductNavContents, pnProductNav) === \"both\") {\n // Get the right edge of the container and content\n var navBarRightEdge = pnProductNavContents.getBoundingClientRect().right;\n var navBarScrollerRightEdge = pnProductNav.getBoundingClientRect().right;\n // Now we know how much space we have available to scroll\n var availableScrollRight = Math.floor(navBarRightEdge - navBarScrollerRightEdge);\n // If the space available is less than two lots of our desired distance, just move the whole amount\n // otherwise, move by the amount in the settings\n if (availableScrollRight < SETTINGS.navBarTravelDistance * 2) {\n pnProductNavContents.style.transform = \"translateX(-\" + availableScrollRight + \"px)\";\n } else {\n pnProductNavContents.style.transform = \"translateX(-\" + SETTINGS.navBarTravelDistance + \"px)\";\n }\n // We do want a transition (this is set in CSS) when moving so remove the class that would prevent that\n pnProductNavContents.classList.remove(\"pn-ProductNav_Contents-no-transition\");\n // Update our settings\n SETTINGS.navBarTravelDirection = \"right\";\n SETTINGS.navBarTravelling = true;\n }\n // Now update the attribute in the DOM\n pnProductNav.setAttribute(\"data-overflowing\", determineOverflow(pnProductNavContents, pnProductNav));\n });\n\n pnProductNavContents.addEventListener(\n \"transitionend\",\n function() {\n // get the value of the transform, apply that to the current scroll position\n //(so get the scroll pos first) and then remove the transform\n var styleOfTransform = window.getComputedStyle(pnProductNavContents, null);\n var tr = styleOfTransform.getPropertyValue(\"-webkit-transform\") || styleOfTransform.getPropertyValue(\"transform\");\n // If there is no transition we want to default to 0 and not null\n var amount = Math.abs(parseInt(tr.split(\",\")[4]) || 0);\n pnProductNavContents.style.transform = \"none\";\n pnProductNavContents.classList.add(\"pn-ProductNav_Contents-no-transition\");\n // Set Scroll amount ... how many days scroll by.\n if (SETTINGS.navBarTravelDirection === \"left\") {\n pnProductNav.scrollLeft = pnProductNav.scrollLeft - (amount * 1.78);\n } else {\n pnProductNav.scrollLeft = pnProductNav.scrollLeft + (amount * 1.78);\n }\n SETTINGS.navBarTravelling = false;\n },\n false\n );\n\n // Handle setting the currently active link\n pnProductNavContents.addEventListener(\"click\", function(e) {\n var links = [].slice.call(document.querySelectorAll(\".pn-ProductNav_Link\"));\n links.forEach(function(item) {\n item.setAttribute(\"aria-selected\", \"false\");\n })\n e.target.setAttribute(\"aria-selected\", \"true\");\n })\n\n function determineOverflow(content, container) {\n var containerMetrics = container.getBoundingClientRect();\n var containerMetricsRight = Math.floor(containerMetrics.right);\n var containerMetricsLeft = Math.floor(containerMetrics.left);\n var contentMetrics = content.getBoundingClientRect();\n var contentMetricsRight = Math.floor(contentMetrics.right);\n\n var contentMetricsLeft = Math.floor(contentMetrics.left);\n if (containerMetricsLeft > contentMetricsLeft && containerMetricsRight < contentMetricsRight) {\n pnAdvancerLeft.classList.remove('hidden')\n pnAdvancerRight.classList.remove('hidden')\n return \"both\";\n } else if (contentMetricsLeft < containerMetricsLeft) {\n pnAdvancerRight.classList.add('hidden')\n return \"left\";\n } else if (contentMetricsRight > containerMetricsRight) {\n pnAdvancerLeft.classList.add('hidden')\n return \"right\";\n } else {\n return \"none\";\n }\n }\n }\n\n // Search - Listen for keystroke events\n searchValue.onkeyup = function (e) {\n if(searchValue.value.trim() != ''){\n emptySearchDiv.classList.add('hidden')\n searchIsActive = true\n loader.classList.remove('hidden')\n dynamicContent.classList.add('hidden')\n // prevent retun key from refrehing page.\n e.preventDefault();\n // hide the daily navigation bar when search is activated.\n scheduleNav.classList.add('hidden');\n\n // Clear the timeout if it has already been set.\n // This will prevent the previous task from executing\n // if it has been less than \n clearTimeout(timeout);\n\n // Make a new timeout set to go off in 800ms\n timeout = setTimeout(function () {\n\n // hide all date headers that appear above serched items\n let listedVOodHeader = Array.from(document.querySelectorAll('.scheduled--day-line-break') );\n\n listedVOodHeader.forEach(sup => {\n sup.classList.add('headerHidden')\n })\n\n // grab all vods\n let listedVODs = Array.from(document.querySelectorAll('.scheduled--vod') );\n // use if you only want to filter current schedule\n\n listedVODs.map(vod => {\n // remove all dayhidden classes\n vod.classList.remove('dayFilterHidden')\n // remove all searchHidden classes from current schedule\n vod.classList.remove('searchHidden');\n // if title does NOT contain search term .. hide div\n if(!vod.querySelector('.scheduled--vod__daily__copy__title').textContent.toLowerCase().includes(searchValue.value.toLowerCase().trim())){\n vod.classList.add('searchHidden');\n totalVodCount ++;\n }else{\n // if title contains search term .. show div\n vod.classList.remove('searchHidden');\n // also show the date header associated with serched vod\n var vodDateOfSearchReturn = vod.dataset.vodDate\n var vodDateOfSearchReturnId = document.getElementById('vod-'+vodDateOfSearchReturn)\n vodDateOfSearchReturnId.classList.remove('headerHidden')\n }\n })\n // Empty search?\n // Is Search term is NOT found in any Vods? Then display empty log warning\n if(totalVodCount == listedVODs.length ){\n // If empty log is NOT showing .. show\n if(emptySearchDiv.classList.contains('hidden')){\n emptySearchDiv.classList.remove('hidden')\n }\n }else{\n emptySearchDiv.classList.add('hidden')\n }\n // Reset count for Search\n totalVodCount = 0;\n\n loader.classList.add('hidden')\n dynamicContent.classList.remove('hidden')\n }, 1000);\n document.documentElement.scrollTop = 0\n }\n };\n\n // Individual VOD content show/hide\n $('.scheduled--vod').off()\n $('.scheduled--vod').on('click', function(e){\n let vodContainer = $(this)\n let playBtn = vodContainer.find('.scheduled--vod__daily__img__play-btn')\n // VOD has clickable children, if they are the target disable parents onclick.\n // Brand requsts that div doesn't collapse on click\n // If VOD is open/active\n if( $(this).hasClass('active')){\n\n // If link clicked = MORE INFO -> link\n if($(e.target).hasClass(\"scheduled--vod__daily__copy__more-info\") ) {\n e.preventDefault()\n //console.log('Regular A link \\n'+ e.target.href)\n window.location.href = e.target.href\n\n // If link clicked = PLAYBTN link\n }else if($(e.target).hasClass('scheduled--vod__daily__img__play-btn')){\n // brand requsts that div doesn't collapse on click\n e.preventDefault();\n //var windowName = e.target.parentNode.parentElement.id\n window.open(e.target.parentNode.parentElement.href)\n\n // If clicked link = VOD Image / also open in new window\n }else if($(e.target).hasClass('scheduled--vod__daily__img__src') || $(e.target).hasClass('scheduled--vod__daily__img__src__now-showing')){\n // If VOD is available for streaming OR is current playing VOD\n if(e.target.parentNode.parentElement.href){\n e.preventDefault();\n //var windowName = e.target.parentNode.parentElement.id\n window.open(e.target.parentNode.parentElement.href);\n\n // If NOT, collapse the Show/Hide\n }else{\n playBtn.hide()\n vodContainer.removeClass(' active')\n }\n // If clicked link = VOD Title / open in same window\n }else if($(e.target).hasClass('scheduled--vod__daily__copy__title')){\n e.preventDefault();\n let urlForTitle = $(this).find('.scheduled--vod__daily__copy__more-info').attr('href');\n //console.log('title \\n'+ urlForTitle)\n window.location.href = urlForTitle\n }else{\n playBtn.hide()\n vodContainer.removeClass(' active')\n }\n // Close / Hide div\n }else{\n vodContainer.addClass('active')\n playBtn.show();\n }\n });\n\n // change inner html of schedule BTN based on var scheduleClassName & timeZone\n function timeZoneScheduleBtnChg(){\n let timez, sched;\n sched = scheduleClassName == 'ca-schedule' ? 'ca' : 'us'\n switch(timeZone) {\n case 'ct':\n timez = 'central'\n break;\n case 'mt':\n timez = 'mountain'\n break;\n case 'pt':\n timez = 'pacific'\n break;\n default:\n timez = 'eastern'\n }\n return sched +'/'+ timez\n }\n\n // content scroll on page load - to display 'now showing' vod in window frame\n function currentVodScroll(){\n\n // there are 2 currently playing vods on page 1us and 1canidain eh?\n let currentPlayingVODArray = Array.from(document.querySelectorAll(\".scheduled--vod.active\"))\n // grab the one thats doesn't contain class scheduleHidden\n let currentPlayingVOD = currentPlayingVODArray.find(vod => {\n if(!vod.className.includes('scheduleHidden')){\n return vod;\n }\n })\n currentPlayingVOD = currentPlayingVOD.getBoundingClientRect() ;\n\n let scrollToPoint;\n\n if (window.innerWidth >= 1000 || (window.innerWidth > 550 && window.innerWidth < 1000 && window.matchMedia(\"(orientation: portrait)\").matches)) {\n scrollToPoint = (currentPlayingVOD.top - (mainNav.offsetHeight + headerblock.offsetHeight + scheduleNav.offsetHeight) ) + (window.pageYOffset - 100);\n } else {\n scrollToPoint = (currentPlayingVOD.top - mainNav.offsetHeight) + (window.pageYOffset - 100);\n }\n\n //Validates is smooth scrolling works in browser\n if('scrollBehavior' in document.documentElement.style){\n window.scrollTo({\n top: scrollToPoint,\n behavior: 'smooth'\n });\n }else{\n window.scrollTo(0, scrollToPoint)\n }\n }\n loader.classList.add('hidden')\n dynamicContent.classList.remove('hidden')\n }, 1000);\n\n searchIsActive = false;\n ajaxCall++\n\n }\n\n // fire this call on first page load only\n if( count <= 1){\n console.log('Initial Page Refresh() ------- ')\n refreshPage(scheduleClassName , timeZone)\n }\n\n clearSearchBtn.addEventListener('click', function(){\n emptySearchDiv.classList.add('hidden')\n searchIsActive = false;\n ajaxCall = 0; // reset like it's the first call\n scheduleNav.classList.remove('hidden')\n console.log('Clear button Page Refresh() ------- ')\n refreshPage(scheduleClassName , timeZone)\n })\n\n // Listen for click events on Dom\n window.addEventListener('click', function(){\n //if clicked into searchbox\n if (document.activeElement == searchValue) {\n cancelSearchBtn.classList.remove('hidden');\n } else {\n cancelSearchBtn.classList.add('hidden');\n }\n })\n }\n else{\n // View of Front-End page\n // set defaults if page is a content refresh values will be overwritten\n // let scheduleClassName = 'us-schedule'\n let scheduleClassName = '';\n /*let scheduleDisplayName = 'U.S.'\n let timezoneeDisplayName = 'EASTERN' */\n let timeZone;\n let timeZoneMoment ;\n // let scheduleDateClicked = 'today'; // not used?\n let currentTimeStamp;\n let searchIsActive = false\n let dateToDisplay = moment().format('MM') +'-'+moment().format('DD') ;\n let todaysDate = moment().format('MM') +'-'+moment().format('DD') ;\n let todaysDateDiffTimezone = moment().format('MM') +'-'+moment().add(1,'days').format('DD');\n let searchValue = document.getElementById('searchBox')\n let cancelSearchBtn = searchValue.nextElementSibling\n let timeZoneScheduleBtn = $('.timezone-btn')\n let timezoneList = timeZoneScheduleBtn.siblings('.timezone-overlay-content')\n let loader = document.querySelector('.loader')\n let dynamicContent = document.querySelector('.schedule__daily__container')\n let clearSearchBtn = document.querySelector('.schedule__header--search__clear')\n let mainNav = document.querySelector(\".watch__header\");\n let headerblock = document.querySelector('.schedule__header')\n let scheduleNav = document.querySelector(\".sticky-wrapper-nav\");\n let emptySearchDiv = document.querySelector('.scheduled--vod--search-return-empty')\n let emptyDayDiv = document.querySelector('.scheduled--vod--day-return-empty')\n let totalVodCount = 0;\n let count = 0;\n let ajaxCall = 0;\n let scheduleContainerMaster = $('#schedule')\n const itemListSchema = [];\n\n mainNav.classList.add(\"daily__schedule\")\n\n // Modal Close - Timezone on Mobile\n function closeTimeZoneModal(){\n timeZoneScheduleBtn.removeClass('active');\n timezoneList.removeClass('active')\n $('body').css('overflow-y','scroll')\n }\n\n /*\n function resetTimeZoneOverlayMobile(currentScheduleClassName, currentTimeZone){\n //resets schedule back to current applied state\n alert('mobile only? ')\n $('.schedule').removeClass('active');\n $('.schedule').each(function(){\n if( $(this).data('schedule') == currentScheduleClassName){\n $(this).addClass('active');\n }\n })\n\n //resets timezone back to current applied state\n $('.timezone').removeClass('active');\n $('.timezone').each(function(){\n if( $(this).data('timezone') == currentTimeZone){\n $(this).addClass('active');\n }\n })\n }\n */\n\n function refreshPage(scheduleClassName, timeZone){\n // Timezone/Country Cookie Check ==================\n let tcmCookiesArray = document.cookie.split(';')\n let timeZoneCookieValue = null;\n let countryCodeCookieValue = null;\n tcmCookiesArray.forEach( (cookie, count) => {\n // Timezone check\n let jsDate = new Date()\n let trueOffset = moment().utcOffset() / 60\n let correctedOffset;\n if(cookie.trim().startsWith('timeZoneSetting=')){\n // Timezone Cookie Found\n timeZoneCookieValue = cookie.split('=').pop().trim()\n timeZone = timeZoneCookieValue;\n\n // Styles TZ and Region dropdown.\n $('.timezone').each(function( count ){\n if( $(this).data( \"timezone\" ) == timeZoneCookieValue ){\n $(this).addClass('active')\n }else{\n $(this).removeClass('active')\n }\n });\n\n if(timeZoneCookieValue == 'et'){\n // Set timzone to EST\n timeZoneMoment = 'America/New_York'\n // If actuall timezone is EST\n if(trueOffset == -5){\n console.log('1. actual timezone is NY')\n currentTimeStamp = moment(jsDate).tz(timeZoneMoment)\n }else{\n // if Actual TZ isn't EST ... fixes errors when you change local TZ\n // console.log('1. actual timezone is ' + moment.tz.guess() )\n // Set timzone to EST\n currentTimeStamp = moment(jsDate).tz(timeZoneMoment)\n correctedOffset = trueOffset - (currentTimeStamp.utcOffset() / 60 )\n console.log(correctedOffset)\n currentTimeStamp = moment().tz(timeZoneMoment).subtract(correctedOffset, 'h')\n /*\n if( Math.sign(trueOffset) == 1){ // is user East of GMT modify the day\n console.log('----ASDFASDF-------\\n' + todaysDateDiffTimezone + '\\n' + dateToDisplay)\n dateToDisplay = todaysDateDiffTimezone;\n }*/\n }\n }else if(timeZoneCookieValue == 'ct'){\n timeZoneMoment = 'America/Chicago'\n // currentTimeStamp = moment().tz(timeZoneMoment).subtract(1, 'h') // Works without local TZ change.\n currentTimeStamp = moment(jsDate).tz(timeZoneMoment)\n correctedOffset = trueOffset - (currentTimeStamp.utcOffset() / 60 )\n console.log(correctedOffset)\n currentTimeStamp = moment().tz(timeZoneMoment).subtract(correctedOffset, 'h')\n }else if(timeZoneCookieValue == 'mt'){\n timeZoneMoment = 'America/Denver'\n // currentTimeStamp = moment().tz(timeZoneMoment).subtract(2, 'h') // Works without local TZ change.\n currentTimeStamp = moment(jsDate).tz(timeZoneMoment)\n correctedOffset = trueOffset - (currentTimeStamp.utcOffset() / 60 )\n console.log(correctedOffset)\n currentTimeStamp = moment().tz(timeZoneMoment).subtract(correctedOffset, 'h')\n }else if(timeZoneCookieValue == 'pt'){\n timeZoneMoment = 'America/Los_Angeles'\n // currentTimeStamp = moment().tz(timeZoneMoment).subtract(3, 'h') // Works without local TZ change.\n currentTimeStamp = moment(jsDate).tz(timeZoneMoment)\n correctedOffset = trueOffset - (currentTimeStamp.utcOffset() / 60 )\n console.log(correctedOffset)\n currentTimeStamp = moment().tz(timeZoneMoment).subtract(correctedOffset, 'h')\n }\n }else{ // Empty Timezone -- Set Cookie as it's not there\n if(count == tcmCookiesArray.length -1 && !timeZoneCookieValue) {\n document.cookie = \"timeZoneSetting=est\";\n timeZoneCookieValue = \"est\"\n timeZone = timeZoneCookieValue;\n // Set timzone to NY\n timeZoneMoment = 'America/New_York'\n // if actuall timezone is EST\n if(moment().utcOffset() / 60 == -5){\n console.log('1. actual timezone is NY')\n currentTimeStamp = moment(jsDate).tz(timeZoneMoment)\n }else{\n // if Actual TZ isn't EST ... fixes errors when you change local TZ\n console.log('1. actual timezone is ' + moment.tz.guess() )\n // Set timzone to NY\n currentTimeStamp = moment(jsDate).tz(timeZoneMoment) // keeper DON'T TOUCH\n correctedOffset = trueOffset - (currentTimeStamp.utcOffset() / 60 )\n console.log(correctedOffset)\n currentTimeStamp = moment().tz(timeZoneMoment).subtract(correctedOffset, 'h')\n }\n }\n }\n // Country Code\n if(cookie.trim().startsWith('countryCodeSetting=')){\n // Country Cookie Found\n countryCodeCookieValue = cookie.split('=').pop().trim()\n scheduleClassName = countryCodeCookieValue;\n $('.schedule').each(function( count ){\n if( $(this).data( \"schedule\" ) == scheduleClassName){\n $(this).addClass('active')\n }else{\n $(this).removeClass('active')\n }\n });\n }else{ // Empty Country -- Set Cookie as it's not there\n if(count == tcmCookiesArray.length -1 && !countryCodeCookieValue) {\n document.cookie = \"countryCodeSetting=us-schedule\";\n countryCodeCookieValue = 'us-schedule'\n scheduleClassName = 'us-schedule'\n }\n } // Searched all of Cookie - Update HTML Drop Box\n if(count == tcmCookiesArray.length -1){\n timeZoneScheduleBtn.find('span').text( timeZoneScheduleBtnChg() )\n }\n })\n\n let currentTimeZone = timeZone;\n loader.classList.remove('hidden')\n dynamicContent.classList.add('hidden')\n emptyDayDiv.classList.add('hidden')\n searchValue.value = '';\n $.ajax({\n //url: \"https://qa-tcmws.tcm.com/tcmws/NewSchedule\",\n //url: \"https://localhost:3306/tcmws/NewSchedule\",\n url: `${apiURL}/tcmws/NewSchedule/${timeZoneCookieValue}`,\n type: \"GET\",\n headers: {\n \"accept\": \"application/json;odata=verbose\"\n },\n success: function (data) {\n console.log(`API connection success: ${apiURL}/tcmws/NewSchedule/${timeZoneCookieValue}`);\n let navElementsArray = [];\n // let currentTimeStamp = moment().toISOString(); // ORIGIONAL DON'T TOUCH\n let isCurrentVod = false;\n let isToday = false;\n let isDailyNavHighlight = false;\n let dailyNavContainer = $(\"#pnProductNavContents\")\n dailyNavContainer.empty()\n scheduleContainerMaster.empty()\n\n let dayCount = 0;\n $.each(data, function (index, item) {\n // garbage content check .. if there' no name .. fkit\n if(item.Name !== null){\n // format startdate and reassign\n item.StartDate = moment(item.StartDate);\n item.EndDate = moment(item.EndDate);\n let fullDateYear = moment(item.StartDate).format('MM') +'-'+moment(item.StartDate).format('DD');\n let dayofWeek = moment(item.StartDate).format('dddd');\n let monthString = moment(item.StartDate).format('MMM');\n let fullMonthString = moment(item.StartDate).format('MMMM');\n let monthInt = moment(item.StartDate).format('MM');\n let dayNo = moment(item.StartDate).format('DD');\n let dayNoNoZero = moment(item.StartDate).format('D');\n let startTime = moment(item.StartDate).format('h:mm');\n let ampm = moment(item.StartDate).format('a');\n let country = item.NetworkFeedCode;\n item.Available = (item.Available == 'TRUE') // change string to boolean\n let url = '/tcmdb/title/'+ item.TitleId + '/' + item.urlSlug;\n item.Length = item.Length ? (item.Length > 59 ? ( Math.floor( item.Length / 60) + 'h ' + (item.Length % 60 == 0 ? '': item.Length % 60 + 'm ') ) : item.Length + 'm' ) : '';\n isDailyNavHighlight = fullDateYear == dateToDisplay ? true : false;\n isToday = fullDateYear == todaysDate ? true : false;\n if (isToday && item.NetworkFeedCode === 'N') {\n itemListSchema.push(item)\n }\n // Used for Front-end Runtime | Genre | Rating\n let firstSlash = (item.Length && item.tvGenres) ? ' | ' : ''\n let secondSlash = ( (item.tvGenres && item.tvRating) || (item.Length && item.tvRating)) ? ' | ' : ''\n\n if(currentTimeStamp >= moment(item.StartDate, 'MM/DD/YYYY HH:MM:SS a') && currentTimeStamp <= moment(item.EndDate, 'MM/DD/YYYY HH:MM:SS a') ) {\n isCurrentVod = true;\n if (!isSchemaSet) {\n createBroadcastEventSchema(item);\n isSchemaSet = true;\n }\n }\n // Navigation: Iterate through all content, grab and create date ranges, give active state to today's\n // Create array, Remove for duplicate dates then create Nav\n let isDateAlreadyInNav = navElementsArray.find(date => date == (monthInt+'-'+dayNo) );\n\n if((!isDateAlreadyInNav && dayofWeek !== 'Invalid date') && (dayCount < 31)){\n navElementsArray.push( monthInt+'-'+dayNo);\n $(\"#pnProductNavContents\").append(`\n
    \n
    ${ isToday? 'Today' : dayofWeek.substring(0, 3)}
    \n
    ${monthString} ${dayNo}
    \n
    `);\n dayCount++\n }\n\n // Append all VOD's to page with active states given to today's date.\n var profileImage = item.profileImage;\n var genre = item.tvGenres;\n // var infoClass = \"schedule-status-\"+item.status;\n let vodUrlAvalible = item.status == 'yes' ? true : false;\n\n if(!profileImage){\n // Image - If no image and vod is a short\n if(item.isShort){\n profileImage = 'https://prod-images.tcm.com/img/schedule-page/placeholder-short-film.jpg??h=470&w=422'\n }else{\n profileImage = 'https://prod-images.tcm.com/img/schedule-page/placeholder-vod-film.jpg?w=422'\n }\n }\n scheduleContainerMaster.append(`\n ${!isDateAlreadyInNav ? `\n
    ${dayofWeek}, ${fullMonthString} ${dayNoNoZero}
    ` : ''}\n
    \n
    \n
    \n
    ${startTime}
    \n
    ${ampm}
    \n
    \n
    \n ${isCurrentVod ? `` : `${item.Available ? `` : ``} ` }\n
    \n \n ${item.Available || isCurrentVod ? `
    ` : ``}\n ${isCurrentVod ? '
    On Now
    ': '' }\n
    \n ${isCurrentVod || item.Available ? `
    ` : ``}\n
    \n
    ${item.Name} (${item.ReleaseYear})
    \n
    ${item.Length ? item.Length : ''} ${firstSlash} ${item.tvGenres ? item.tvGenres : ''} ${secondSlash} ${item.tvRating ? item.tvRating : ''}
    \n
    ${ item.Storyline ? (item.Storyline.length < 80) ? item.Storyline : item.Storyline.substring(0,80)+'...' : 'No Description available' }
    \n
    \n
    Director
    \n
    ${item.Director ? item.Director : 'No Director Information Available.'}
    \n
    \n
    \n
    Cast
    \n
    ${item.Cast ? item.Cast.replace(/,/g , ', ') : 'No Cast Information Available.'}
    \n
    \n MORE INFO \n
    \n
    \n
    `)\n isCurrentVod = false;\n }\n });\n\n\n // ajaxStop fires mulitiple times because of Timezone and US/Canidian toggle\n // changes create another call to api for updated times. correcting by using loop\n setTimeout(function(){\n let timeout = null;\n\n // VODs that are todays date\n if(!searchIsActive){\n $('.scheduled--vod ').each(function(){\n if ($(this).data('vod-date') !== dateToDisplay ){\n $(this).addClass('dayFilterHidden')\n if ( $(this).hasClass(scheduleClassName) ){\n $(this).removeClass('scheduleHidden')\n }\n\n }else{\n if ( $(this).hasClass(scheduleClassName) ){\n $(this).removeClass('scheduleHidden')\n }\n }\n });\n setTimeout(currentVodScroll, 500)\n }\n\n // TimeZone and us/canadian click - schedule modification\n timeZoneScheduleBtn.off() // remove previous eventlistner\n timeZoneScheduleBtn.on('click', function(event){\n event.stopPropagation();\n // toggle class on timezone btn and flyout menu\n if( $(this).hasClass('active') ){\n $(this).removeClass('active')\n timezoneList.removeClass('active')\n }else{\n $(this).addClass('active')\n timezoneList.addClass('active')\n }\n })\n\n // Close Timezone and us/canadian flyout on window click .. DESKTOP\n if(window.innerWidth >= 1024){\n $(window).click(function() {\n timeZoneScheduleBtn.removeClass('active');\n timezoneList.removeClass('active')\n $('body').css('overflow-y','scroll')\n });\n }\n\n // Close Timezone and us/canadian flyout on window click .. MOBILE\n $('.timezone-overlay-content #close-modal').click(function() {\n closeTimeZoneModal();\n });\n\n $('.timezone-overlay-content #cancel-button').click(function() {\n closeTimeZoneModal();\n });\n // Close Timezone and us/canadian flyout on window click .. MOBILE - Apply button\n $('.timezone-overlay-content #apply-button').click(function() {\n closeTimeZoneModal();\n document.cookie = \"timeZoneSetting=\"+timeZone;\n refreshPage( scheduleClassName, timeZone)\n timeZoneScheduleBtn.find('span').text(timeZoneScheduleBtnChg());\n });\n\n // Timezone - add eventlistner to each flyout nav element\n // When Schedule is clicked (US/Canidian) the content is already on the page. show/hide is run\n // When Timezones are changed, page is refreshed to correctly order the hours.\n timezoneList.off() // remove previous eventlistner\n timezoneList.children('.timezone-content').children('li').each( function(){\n $(this).off()\n $(this).on('click', function(){\n // identify if schedule portion or timezone was clicked\n let whatChanged = $(this).data('schedule') ? 'schedule' : 'timezone';\n // handle Schedule clicks / changes\n if(whatChanged == 'schedule'){\n // change style on btn dropdown\n $('.schedule').toggleClass('active')\n scheduleClassName = $(this).data('schedule');\n // Toggle VOD's on page based on Schedule selection\n let todaysVodCount = 0\n $('.scheduled--vod ').each(function(){\n // Search IS Active\n if(searchIsActive){\n // remove day filter class\n $(this).removeClass('dayFilterHidden')\n // current vod is in current schedule\n if( $(this).hasClass(scheduleClassName) && !$(this).hasClass('searchHidden') ) {\n $(this).removeClass('scheduleHidden')\n }else{\n $(this).addClass('scheduleHidden')\n }\n }else{ // Search Not Active\n // in current schedule if date = today\n if( $(this).hasClass(scheduleClassName) && $(this).data('vod-date') == dateToDisplay ) {\n todaysVodCount ++\n $(this).addClass('scheduleHidden')\n $(this).removeClass('dayFilterHidden')\n }else{\n $(this).addClass('scheduleHidden')\n $(this).removeClass('dayFilterHidden')\n }\n }\n });\n if(todaysVodCount > 0){\n emptyDayDiv.classList.add('hidden')\n } else{\n emptyDayDiv.classList.remove('hidden')\n }\n if(count <=1){ // Timezone refresh\n console.log('timezone Page Refresh() ----')\n document.cookie = \"countryCodeSetting=\"+scheduleClassName;\n refreshPage( scheduleClassName, timeZone)\n //timeZoneScheduleBtn.find('span').text(timeZoneScheduleBtnChg())\n }\n }\n // Timezone clicks / changes\n else{\n timeZone = $(this).data('timezone');\n $('.timezone').removeClass('active');\n $('.timezone').each(function(){\n if( $(this).data('timezone') == timeZone){\n $(this).addClass('active');\n }\n })\n if(window.innerWidth >= 1024){\n $('#schedule').empty()\n loader.classList.remove('hidden')\n if(count <=1){\n console.log('timezone Page Refresh() ----')\n document.cookie = \"timeZoneSetting=\"+timeZone;\n refreshPage( scheduleClassName, timeZone)\n timeZoneScheduleBtn.find('span').text(timeZoneScheduleBtnChg())\n }\n }\n }\n })\n })\n\n // Daily Navigation - click - shows VODs for Date of clicked data\n $('.schedule__nav__date--ele').click( function(){\n let clickedNavElement = $(this).data('vod-date');\n dateToDisplay = clickedNavElement;\n let headerId = \"vod-\"+dateToDisplay;\n // remove active class from Main nav then add it to clicked link\n $('.schedule__nav__date--ele').removeClass('active')\n $(this).addClass('active')\n // Loop through Vods, Show all VOD's for that date.\n let dayHasVods = false;\n $('.scheduled--vod ').each(function(){\n if( $(this).data('vod-date') == clickedNavElement && $(this).hasClass(scheduleClassName)){\n $(this).removeClass('dayFilterHidden');\n $(this).removeClass('scheduleHidden');\n dayHasVods = true;\n }else{\n $(this).addClass('dayFilterHidden');\n }\n });\n if(!dayHasVods){\n emptyDayDiv.classList.remove('hidden')\n }else{\n emptyDayDiv.classList.add('hidden')\n }\n $(\"div\").each(function(){\n if($(this).hasClass('headerHidden')&& $(this).attr('id') == headerId ) {\n $(this).show();\n }\n else if ($(this).hasClass('headerHidden')&& $(this).attr('id') != headerId ){\n $(this).hide();\n }\n });\n // If Today Btn is clicked on Daily Nav, display page and .. scroll to now playing\n if(clickedNavElement == moment().format('MM') +'-'+moment().format('DD') ){\n setTimeout(currentVodScroll, 100)\n }else{\n document.documentElement.scrollTop = 0\n }\n\n });\n\n // Daily Navigation - Right / Left movement\n setTimeout(buildDailyNavigation, 500)\n function buildDailyNavigation(){\n\n var SETTINGS = {\n navBarTravelling: false,\n navBarTravelDirection: \"\",\n navBarTravelDistance: 610\n }\n\n document.documentElement.classList.remove(\"no-js\");\n document.documentElement.classList.add(\"js\");\n\n // Out advancer buttons\n var pnAdvancerLeft = document.getElementById(\"pnAdvancerLeft\");\n var pnAdvancerRight = document.getElementById(\"pnAdvancerRight\");\n var pnProductNav = document.getElementById(\"pnProductNav\");\n var pnProductNavContents = document.getElementById(\"pnProductNavContents\");\n\n pnProductNav.setAttribute(\"data-overflowing\", determineOverflow(pnProductNavContents, pnProductNav));\n pnAdvancerRight.children[0].classList.remove('hidden')\n // Handle the scroll of the horizontal container\n var last_known_scroll_position = 0;\n var ticking = false;\n\n function doSomething(scroll_pos) {\n pnProductNav.setAttribute(\"data-overflowing\", determineOverflow(pnProductNavContents, pnProductNav));\n }\n\n pnProductNav.addEventListener(\"scroll\", function() {\n last_known_scroll_position = window.scrollY;\n if (!ticking) {\n window.requestAnimationFrame(function() {\n doSomething(last_known_scroll_position);\n ticking = false;\n });\n }\n ticking = true;\n });\n\n\n pnAdvancerLeft.addEventListener(\"click\", function() {\n // If in the middle of a move return\n if (SETTINGS.navBarTravelling === true) {\n return;\n }\n // If we have content overflowing both sides or on the left\n if (determineOverflow(pnProductNavContents, pnProductNav) === \"left\" || determineOverflow(pnProductNavContents, pnProductNav) === \"both\") {\n // Find how far this panel has been scrolled\n var availableScrollLeft = pnProductNav.scrollLeft;\n // If the space available is less than two lots of our desired distance, just move the whole amount\n // otherwise, move by the amount in the settings\n if (availableScrollLeft < SETTINGS.navBarTravelDistance * 2) {\n pnProductNavContents.style.transform = \"translateX(\" + availableScrollLeft + \"px)\";\n } else {\n pnProductNavContents.style.transform = \"translateX(\" + SETTINGS.navBarTravelDistance + \"px)\";\n }\n // We do want a transition (this is set in CSS) when moving so remove the class that would prevent that\n pnProductNavContents.classList.remove(\"pn-ProductNav_Contents-no-transition\");\n // Update our settings\n SETTINGS.navBarTravelDirection = \"left\";\n SETTINGS.navBarTravelling = true;\n }\n // Now update the attribute in the DOM\n pnProductNav.setAttribute(\"data-overflowing\", determineOverflow(pnProductNavContents, pnProductNav));\n });\n\n pnAdvancerRight.addEventListener(\"click\", function() {\n // If in the middle of a move return\n if (SETTINGS.navBarTravelling === true) {\n return;\n }\n // If we have content overflowing both sides or on the right\n if (determineOverflow(pnProductNavContents, pnProductNav) === \"right\" || determineOverflow(pnProductNavContents, pnProductNav) === \"both\") {\n // Get the right edge of the container and content\n var navBarRightEdge = pnProductNavContents.getBoundingClientRect().right;\n var navBarScrollerRightEdge = pnProductNav.getBoundingClientRect().right;\n // Now we know how much space we have available to scroll\n var availableScrollRight = Math.floor(navBarRightEdge - navBarScrollerRightEdge);\n // If the space available is less than two lots of our desired distance, just move the whole amount\n // otherwise, move by the amount in the settings\n if (availableScrollRight < SETTINGS.navBarTravelDistance * 2) {\n pnProductNavContents.style.transform = \"translateX(-\" + availableScrollRight + \"px)\";\n } else {\n pnProductNavContents.style.transform = \"translateX(-\" + SETTINGS.navBarTravelDistance + \"px)\";\n }\n // We do want a transition (this is set in CSS) when moving so remove the class that would prevent that\n pnProductNavContents.classList.remove(\"pn-ProductNav_Contents-no-transition\");\n // Update our settings\n SETTINGS.navBarTravelDirection = \"right\";\n SETTINGS.navBarTravelling = true;\n }\n // Now update the attribute in the DOM\n pnProductNav.setAttribute(\"data-overflowing\", determineOverflow(pnProductNavContents, pnProductNav));\n });\n\n pnProductNavContents.addEventListener(\n \"transitionend\",\n function() {\n // get the value of the transform, apply that to the current scroll position\n //(so get the scroll pos first) and then remove the transform\n var styleOfTransform = window.getComputedStyle(pnProductNavContents, null);\n var tr = styleOfTransform.getPropertyValue(\"-webkit-transform\") || styleOfTransform.getPropertyValue(\"transform\");\n // If there is no transition we want to default to 0 and not null\n var amount = Math.abs(parseInt(tr.split(\",\")[4]) || 0);\n pnProductNavContents.style.transform = \"none\";\n pnProductNavContents.classList.add(\"pn-ProductNav_Contents-no-transition\");\n // Set Scroll amount ... how many days scroll by.\n if (SETTINGS.navBarTravelDirection === \"left\") {\n pnProductNav.scrollLeft = pnProductNav.scrollLeft - (amount * 1.78);\n } else {\n pnProductNav.scrollLeft = pnProductNav.scrollLeft + (amount * 1.78);\n }\n SETTINGS.navBarTravelling = false;\n },\n false\n );\n\n // Handle setting the currently active link\n pnProductNavContents.addEventListener(\"click\", function(e) {\n var links = [].slice.call(document.querySelectorAll(\".pn-ProductNav_Link\"));\n links.forEach(function(item) {\n item.setAttribute(\"aria-selected\", \"false\");\n })\n e.target.setAttribute(\"aria-selected\", \"true\");\n })\n\n function determineOverflow(content, container) {\n var containerMetrics = container.getBoundingClientRect();\n var containerMetricsRight = Math.floor(containerMetrics.right);\n var containerMetricsLeft = Math.floor(containerMetrics.left);\n var contentMetrics = content.getBoundingClientRect();\n var contentMetricsRight = Math.floor(contentMetrics.right);\n\n var contentMetricsLeft = Math.floor(contentMetrics.left);\n if (containerMetricsLeft > contentMetricsLeft && containerMetricsRight < contentMetricsRight) {\n pnAdvancerLeft.classList.remove('hidden')\n pnAdvancerRight.classList.remove('hidden')\n return \"both\";\n } else if (contentMetricsLeft < containerMetricsLeft) {\n pnAdvancerRight.classList.add('hidden')\n return \"left\";\n } else if (contentMetricsRight > containerMetricsRight) {\n pnAdvancerLeft.classList.add('hidden')\n return \"right\";\n } else {\n return \"none\";\n }\n }\n }\n\n // Search - Listen for keystroke events\n searchValue.onkeyup = function (e) {\n if(searchValue.value.trim() != ''){\n emptySearchDiv.classList.add('hidden')\n emptyDayDiv.classList.add('hidden')\n searchIsActive = true\n loader.classList.remove('hidden')\n dynamicContent.classList.add('hidden')\n // prevent retun key from refrehing page.\n e.preventDefault();\n // hide the daily navigation bar when search is activated.\n scheduleNav.classList.add('hidden');\n\n // Clear the timeout if it has already been set.\n // This will prevent the previous task from executing\n // if it has been less than \n clearTimeout(timeout);\n\n // Make a new timeout set to go off in 800ms\n timeout = setTimeout(function () {\n\n // hide all date headers that appear above serched items\n let listedVOodHeader = Array.from(document.querySelectorAll('.scheduled--day-line-break') );\n\n listedVOodHeader.forEach(dailyHeader => {\n dailyHeader.classList.add('headerHidden')\n })\n\n // grab all vods\n let listedVODs = Array.from(document.querySelectorAll('.scheduled--vod') );\n // use if you only want to filter current schedule\n\n listedVODs.map(vod => {\n // remove all dayhidden classes\n vod.classList.remove('dayFilterHidden')\n // remove all searchHidden classes from current schedule\n vod.classList.remove('searchHidden');\n // if title does NOT contain search term .. hide div\n if(!vod.querySelector('.scheduled--vod__daily__copy__title').textContent.toLowerCase().includes(searchValue.value.toLowerCase().trim())){\n vod.classList.add('searchHidden');\n totalVodCount ++;\n }else{\n // if title contains search term .. show div\n vod.classList.remove('searchHidden');\n // also show the date header associated with serched vod\n var vodDateOfSearchReturn = vod.dataset.vodDate\n var vodDateOfSearchReturnId = document.getElementById('vod-'+vodDateOfSearchReturn)\n vodDateOfSearchReturnId.classList.remove('headerHidden')\n vodDateOfSearchReturnId.style.display = 'block'\n }\n })\n // Empty search?\n // Is Search term is NOT found in any Vods? Then display empty log warning\n if(totalVodCount == listedVODs.length ){\n // If empty log is NOT showing .. show\n if(emptySearchDiv.classList.contains('hidden')){\n emptySearchDiv.classList.remove('hidden')\n }\n }else{\n emptySearchDiv.classList.add('hidden')\n }\n // Reset count for Search\n totalVodCount = 0;\n loader.classList.add('hidden')\n dynamicContent.classList.remove('hidden')\n }, 1000);\n document.documentElement.scrollTop = 0\n }\n };\n\n // Individual VOD content show/hide\n $('.scheduled--vod').off()\n $('.scheduled--vod').on('click', function(e){\n let vodContainer = $(this)\n let playBtn = vodContainer.find('.scheduled--vod__daily__img__play-btn')\n // VOD has clickable children, if they are the target disable parents onclick.\n // Brand requsts that div doesn't collapse on click\n // If VOD is open/active\n if( $(this).hasClass('active')){\n\n // If link clicked = MORE INFO -> link\n if($(e.target).hasClass(\"scheduled--vod__daily__copy__more-info\") ) {\n e.preventDefault()\n //console.log('Regular A link \\n'+ e.target.href)\n window.location.href = e.target.href\n\n // If link clicked = PLAYBTN link\n }else if($(e.target).hasClass('scheduled--vod__daily__img__play-btn')){\n // brand requsts that div doesn't collapse on click\n e.preventDefault();\n //var windowName = e.target.parentNode.parentElement.id\n window.open(e.target.parentNode.parentElement.href)\n\n // If clicked link = VOD Image / also open in new window\n }else if($(e.target).hasClass('scheduled--vod__daily__img__src') || $(e.target).hasClass('scheduled--vod__daily__img__src__now-showing')){\n // If VOD is available for streaming OR is current playing VOD\n if(e.target.parentNode.parentElement.href){\n e.preventDefault();\n //var windowName = e.target.parentNode.parentElement.id\n window.open(e.target.parentNode.parentElement.href);\n\n // If NOT, collapse the Show/Hide\n }else{\n playBtn.hide()\n vodContainer.removeClass(' active')\n }\n // If clicked link = VOD Title / open in same window\n }else if($(e.target).hasClass('scheduled--vod__daily__copy__title')){\n e.preventDefault();\n // Some BS on titles that Josh doesn't want to click-through\n if($(e.target).hasClass('dead-link')){\n console.table( $(this) )\n\n }else{\n let urlForTitle = $(this).find('.scheduled--vod__daily__copy__more-info').attr('href');\n //console.log('title \\n'+ urlForTitle)\n window.location.href = urlForTitle\n }\n }else{\n playBtn.hide()\n vodContainer.removeClass(' active')\n }\n // Close / Hide div\n }else{\n vodContainer.addClass('active')\n playBtn.show();\n }\n });\n\n // Scroll - content scroll on page load - to display 'now showing' vod in window frame\n function currentVodScroll(){\n // there are 2 currently playing vods on page 1US and 1 Canadian eh?\n let currentPlayingVODArray = Array.from(document.querySelectorAll(\".scheduled--vod.active\"))\n\n // grab the one thats doesn't contain class scheduleHidden\n let currentPlayingVOD = currentPlayingVODArray.find(vod => {\n if(!vod.className.includes('scheduleHidden')){\n return vod;\n }\n })\n currentPlayingVOD = currentPlayingVOD.getBoundingClientRect();\n\n let scrollToPoint;\n if (window.innerWidth >= 1000 || (window.innerWidth > 550 && window.innerWidth < 1000 && window.matchMedia(\"(orientation: portrait)\").matches)) {\n scrollToPoint = (currentPlayingVOD.top - (mainNav.offsetHeight + headerblock.offsetHeight + scheduleNav.offsetHeight) ) + (window.pageYOffset - 100);\n } else {\n scrollToPoint = (currentPlayingVOD.top - mainNav.offsetHeight) + (window.pageYOffset - 100);\n }\n\n // Validates is smooth scrolling works in browser\n if('scrollBehavior' in document.documentElement.style){\n window.scrollTo({\n top: scrollToPoint,\n behavior: 'smooth'\n });\n }else{\n window.scrollTo(0, scrollToPoint)\n }\n\n\n /* Validates is smooth scrolling works in browser\n if('scrollBehavior' in document.documentElement.style){\n window.scrollTo({\n top: scrollToPoint,\n behavior: 'smooth'\n });\n }else{\n window.scrollTo(0, scrollToPoint)\n } */\n }\n loader.classList.add('hidden')\n dynamicContent.classList.remove('hidden')\n }, 1000);\n\n searchIsActive = false;\n ajaxCall++\n },\n error: function (error) {\n console.log(`API connection error: ${apiURL}/tcmws/NewSchedule/${timeZoneCookieValue}\\n + error`);\n }\n });\n\n // change inner html of schedule BTN based on var scheduleClassName & timeZone\n function timeZoneScheduleBtnChg(){\n let timez, sched;\n sched = scheduleClassName == 'ca-schedule' ? 'ca' : 'us'\n switch(timeZone) {\n case 'ct':\n timez = 'central'\n document.cookie = \"timeZoneSetting=ct\";\n timeZoneCookieValue = \"cst\"\n break;\n case 'mt':\n timez = 'mountain'\n document.cookie = \"timeZoneSetting=mt\";\n timeZoneCookieValue = \"mst\"\n break;\n case 'pt':\n timez = 'pacific'\n document.cookie = \"timeZoneSetting=pt\";\n timeZoneCookieValue = \"pst\"\n break;\n default:\n timez = 'eastern'\n document.cookie = \"timeZoneSetting=et\";\n timeZoneCookieValue = \"est\"\n }\n return sched +'/'+ timez\n }\n }\n\n // fire this call on first page load only\n if( count <= 1){\n //console.log('Initial Page Refresh() ------- ')\n refreshPage(scheduleClassName , timeZone)\n }\n\n // X-out of Search\n clearSearchBtn.addEventListener('click', function(){\n emptySearchDiv.classList.add('hidden')\n searchIsActive = false;\n ajaxCall = 0; // reset like it's the first call\n scheduleNav.classList.remove('hidden')\n console.log('Clear button Page Refresh() ------- ')\n refreshPage(scheduleClassName , timeZone)\n })\n\n // Listen for click events on Dom\n window.addEventListener('click', function(){\n //if clicked into searchbox\n if (document.activeElement == searchValue) {\n cancelSearchBtn.classList.remove('hidden');\n } else {\n cancelSearchBtn.classList.add('hidden');\n }\n })\n }\n }\n }\n }\n}\n","import { createItemListSchema } from './Schema';\n\nexport default class ScheduleMonthly {\n\n static initialize(UrlPathname, apiURL) {\n // only activate if on monthly schedule page.\n if(UrlPathname == '/schedule-monthly'){\n\n document.addEventListener('DOMContentLoaded', loadMonthlyScheduleFunctionality, false);\n\n function loadMonthlyScheduleFunctionality(){ \n let scheduleClassName = 'us-schedule'\n //let scheduleDisplayName = 'U.S.'\n //let timezoneeDisplayName = 'EASTERN'\n let timeZone = 'et';\n let jsDate = new Date()\n let currentTimeStamp;\n let timeZoneMoment;\n let timeZoneOffset;\n //let scheduleDateClicked = 'today'; // not used?\n let searchIsActive = false\n let dateToDisplay = moment().format('MM') +'-'+moment().format('DD') ;\n let searchValue = document.getElementById('searchBox')\n let cancelSearchBtn = searchValue.nextElementSibling\n let timeZoneScheduleBtn = $('.timezone-btn')\n let timezoneList = timeZoneScheduleBtn.siblings('.timezone-overlay-content')\n let loader = document.querySelector('.loader')\n let dynamicContent = document.querySelector('.schedule__monthly__container')\n let clearSearchBtn = document.querySelector('.schedule__header--search__clear')\n let mainNav = document.querySelector(\".watch__header\");\n let emptySearchDiv = document.querySelector('.scheduled--vod--search-return-empty')\n let totalVodCount = 0;\n let count = 0;\n let ajaxCall = 0;\n let scheduleContainerMaster = $('#schedule')\n const itemListSchema = [];\n\n mainNav.classList.add(\"monthly__schedule\")\n\n function closeTimeZoneModal(){\n timeZoneScheduleBtn.removeClass('active');\n timezoneList.removeClass('active')\n $('body').css('overflow-y','scroll')\n }\n\n function resetTimeZoneOverlayMobile(currentScheduleClassName, currentTimeZone){\n //resets schedule back to current applied state\n $('.schedule').removeClass('active');\n $('.schedule').each(function(){\n if( $(this).data('schedule') == currentScheduleClassName){\n $(this).addClass('active');\n }\n })\n\n //resets timezone back to current applied state\n $('.timezone').removeClass('active');\n $('.timezone').each(function(){\n if( $(this).data('timezone') == currentTimeZone){\n $(this).addClass('active');\n }\n })\n }\n\n function refreshPage(scheduleClassName, timeZone){\n // variables with current applied state\n let currentScheduleClassName = scheduleClassName;\n let currentTimeZone = timeZone;\n\n\n // Timezone/Country Cookie Check ==================\n let tcmCookiesArray = document.cookie.split(';')\n let timeZoneCookieValue = null;\n let countryCodeCookieValue = null;\n tcmCookiesArray.forEach( (cookie, count) => {\n // IF Timezone Cookie Found\n if(cookie.trim().startsWith('timeZoneSetting=')){ \n timeZoneCookieValue = cookie.split('=').pop().trim()\n timeZone = timeZoneCookieValue; \n // Styles TZ and Region dropdown.\n $('.timezone').each(function( count ){\n if( $(this).data( \"timezone\" ) == timeZoneCookieValue ){\n $(this).addClass('active')\n }else{\n $(this).removeClass('active')\n }\n }); \n\n if(timeZoneCookieValue == 'et'){ \n timeZoneMoment = 'America/New_York' \n currentTimeStamp = moment(jsDate).tz(timeZoneMoment)\n currentTimeStamp = moment().tz(timeZoneMoment).add(1, 'h')\n timeZoneOffset = 0 \n }else if(timeZoneCookieValue == 'ct'){ \n timeZoneMoment = 'America/Chicago' \n currentTimeStamp = moment(jsDate).tz(timeZoneMoment)\n currentTimeStamp = moment().add(1, 'hours');\n timeZoneOffset = 1\n \n }else if(timeZoneCookieValue == 'mt'){ \n timeZoneMoment = 'America/Denver'\n currentTimeStamp = moment(jsDate).tz(timeZoneMoment)\n currentTimeStamp = moment().tz(timeZoneMoment).add(1, 'h')\n currentTimeStamp = moment().add(2, 'hours');\n timeZoneOffset = 2\n }else if(timeZoneCookieValue == 'pt'){ \n timeZoneMoment = 'America/Los_Angeles'\n currentTimeStamp = moment(jsDate).tz(timeZoneMoment)\n currentTimeStamp = moment().tz(timeZoneMoment).add(1, 'h')\n timeZoneOffset = 3\n }\n }else{ // Empty Timezone -- Set Cookie as it's not there \n if(count == tcmCookiesArray.length -1 && !timeZoneCookieValue) {\n document.cookie = \"timeZoneSetting=est\";\n timeZoneCookieValue = \"est\"\n timeZone = timeZoneCookieValue; \n timeZoneMoment = 'America/New_York' \n currentTimeStamp = moment(jsDate).tz(timeZoneMoment)\n currentTimeStamp = moment().tz(timeZoneMoment).add(1, 'h')\n timeZoneOffset = 0 \n }\n }\n // Country Code Cookie found\n if(cookie.trim().startsWith('countryCodeSetting=')){\n // Country Cookie Found\n countryCodeCookieValue = cookie.split('=').pop().trim()\n scheduleClassName = countryCodeCookieValue; \n //alert('Country cookie found '+ scheduleClassName +' '+countryCodeCookieValue )\n $('.schedule').each(function( count ){\n if( $(this).data( \"schedule\" ) == scheduleClassName){\n $(this).addClass('active')\n }else{\n $(this).removeClass('active')\n }\n }); \n }else{ // Country Code Cookie NOT found -- Set Cookie\n if(count == tcmCookiesArray.length -1 && !countryCodeCookieValue) {\n document.cookie = \"countryCodeSetting=us-schedule\"; \n countryCodeCookieValue = 'us-schedule'\n scheduleClassName = 'us-schedule' \n }\n } // Searched all of Cookie - Update HTML Drop Box\n if(count == tcmCookiesArray.length -1){\n timeZoneScheduleBtn.find('span').text( timeZoneScheduleBtnChg() )\n }\n })\n\n\n\n\n // grab all schedule data\n loader.classList.remove('hidden')\n dynamicContent.classList.add('hidden')\n searchValue.value = '';\n $.ajax({\n url: apiURL+\"/tcmws/MonthSchedule\",\n type: \"GET\",\n headers: {\n \"accept\": \"application/json;odata=verbose\"\n },\n success: function (data) {\n console.log('API connection success:'+apiURL+'/tcmws/MonthSchedule\\nPage schedule-monthly.js');\n let navElementsArray = [];\n // let currentTimeStamp = moment().toISOString(); // ORIGIONAL DON'T TOUCH \n let isCurrentVod = false;\n let isToday = false;\n let hasDateChanged = false;\n let dailyNavContainer = $(\"#pnProductNavContents\")\n dailyNavContainer.empty()\n scheduleContainerMaster.empty()\n\n $.each(data, function (index, item) {\n // garbage content check .. if there' no name .. fkit\n if(item.Name !== null){\n // format startdate and reassign\n item.StartDate = moment(item.StartDate).subtract(timeZoneOffset, 'hours')\n let fullDateYear = moment(item.StartDate).format('MM') +'-'+moment(item.StartDate).format('DD')\n let dayofWeek = moment(item.StartDate).format('dddd').substring(0, 3);\n let monthString = moment(item.StartDate).format('MMMM');\n let monthInt = moment(item.StartDate).format('MM');\n let dayNo = moment(item.StartDate).format('DD');\n let startTime = moment(item.StartDate).format('h:mm');\n let ampm = moment(item.StartDate).format('a');\n let country = item.NetworkFeedCode;\n item.Length = item.Length ? (item.Length > 59 ? ( Math.floor( item.Length / 60) + 'h ' + (item.Length % 60 == 0 ? '': item.Length % 60 + 'm ') ) : item.Length + 'm' ) : '';\n\n hasDateChanged = index == 0 ? true :\n !(moment(data[index -1].StartDate).format('DD') == moment(data[index].StartDate).format('DD'))\n\n // Used for Front-end Runtime | Genre | Rating\n let firstSlash = (item.Length && item.tvGenres) ? ' | ' : ''\n let secondSlash = ( (item.tvGenres && item.tvRating) || (item.Length && item.tvRating)) ? ' | ' : ''\n\n isToday = fullDateYear == dateToDisplay ? true : false;\n\n if (isToday && item.NetworkFeedCode === 'N') {\n itemListSchema.push(item)\n }\n\n let url = '/tcmdb/title/'+ item.TitleId + '/' + item.Name.split(' ').join('-')+ '/';\n if(item.status == \"yes\"){\n url = '/tcmdb/title/'+ item.TitleId + '/' + item.Name.split(' ').join('-')+ '/';\n var month_info_class = \"month-info-class-\"+item.status;\n var itemClose = \"\"\n var itemOpen = ``\n }\n else{\n url = '';\n var month_info_class = \"month-info-class-\"+item.status;\n var itemOpen = `
    `\n var itemClose = \"
    \";\n }\n\n // Image - if no image\n if(!item.profileImage){\n // Image - If no image and vod is a short\n if(item.isShort){\n item.profileImage = 'https://prod-images.tcm.com/img/schedule-page/placeholder-short-film.jpg??h=470&w=273'\n }else{\n item.profileImage = 'https://prod-images.tcm.com/img/schedule-page/placeholder-vod-film.jpg?w=273'\n }\n }\n\n // item.profileImage = (item.isShort || item.profileImage == 'https://prod-images.tcm.com/v5cache/TCM/Images/placeholder_shortfilm_678x381.png') ? 'https://prod-images.tcm.com/img/schedule-page/placeholder-short-film.jpg?w=900' : item.profileImage\n\n // find currently playing vod .. will result in 2, one CAN one US\n if(currentTimeStamp >= moment(item.StartDate).toISOString() && currentTimeStamp <= moment(item.EndDate).toISOString()){\n isCurrentVod = true;\n }\n // Navigation: Iterate through all content, grab and create date ranges, give active state to today's\n // Create array, Remove for duplicate dates then create Nav\n let isDateAlreadyInNav = navElementsArray.find(date => date == (monthInt+'-'+dayNo) );\n if(!isDateAlreadyInNav){\n navElementsArray.push( monthInt+'-'+dayNo);\n }\n\n // Escape quotes in Cast listing\n item.Cast = item.Cast ? item.Cast.replace(/,/g , ', ') : 'No Cast Information Available.' ;\n item.Cast = item.Cast.length > 50 ?item.Cast.substring(0,50) + '...' : item.Cast\n\n // Create the header then grab the header\n // scheduleContainerMaster.append(`${hasDateChanged ? `
    ` : '' }`)\n let currentDayDiv = $(`#header-${dayNo}`)\n // Append all VOD's to the header that has the current date.\n scheduleContainerMaster.append(`\n ${!isDateAlreadyInNav ? `
    ${dayofWeek}, ${monthString} ${dayNo.charAt(0) == '0' ? dayNo.charAt(1) : dayNo}
    ` : ''}\n
    \n
    \n
    ${startTime}
    \n
    ${ampm}
    \n ${isCurrentVod ? '
    On Now
    ': '' }\n
    \n ${itemOpen}\n
    \n \"${item.Name}\n
    \n
    \n
    ${item.Name} (${item.ReleaseYear})
    \n
    ${item.Length ? item.Length : ''} ${firstSlash} ${item.tvGenres ? item.tvGenres : ''} ${secondSlash} ${item.tvRating ? item.tvRating : ''}
    \n
    ${ item.Storyline ? (item.Storyline.length < 90) ? item.Storyline : item.Storyline.substring(0,90)+'...' : 'No Description available' }
    \n
    \n
    Director
    \n
    ${item.Director ? (item.Director.length > 30 ?item.Director.substring(0,30) + '...' : item.Director) : 'No Director Available' }
    \n
    \n
    \n
    Cast
    \n
    ${item.Cast}
    \n
    \n
    \n\n ${itemClose}\n
    `)\n isCurrentVod = false;\n } // end garbage content check .. if there' no name\n }); // end each loop\n createItemListSchema(itemListSchema);\n },\n error: function (error) {\n console.log('API connection error:'+apiURL+'/tcmws/MonthSchedule\\nPage schedule-monthly.js \\n' + error);\n }\n });\n\n\n\n // change inner html of schedule btn based on var scheduleClassName & timeZone\n function timeZoneScheduleBtnChg(){\n let timez, sched;\n sched = scheduleClassName == 'ca-schedule' ? 'ca' : 'us'\n switch(timeZone) {\n case 'ct':\n timez = 'central'\n document.cookie = \"timeZoneSetting=ct\";\n timeZoneCookieValue = \"cst\" \n break;\n case 'mt':\n timez = 'mountain'\n document.cookie = \"timeZoneSetting=mt\";\n timeZoneCookieValue = \"mst\"\n break;\n case 'pt':\n timez = 'pacific'\n document.cookie = \"timeZoneSetting=pt\";\n timeZoneCookieValue = \"pst\"\n break;\n default:\n timez = 'eastern'\n document.cookie = \"timeZoneSetting=et\";\n timeZoneCookieValue = \"est\"\n }\n return sched +'/'+ timez\n } \n\n // ajaxStop is firing mulitiple times unsure why, correcting by using loop\n if(ajaxCall <= 1){\n $(document).ajaxStop(function() {\n let timeout = null;\n\n // timezone and us/canadian click - schedule modification\n // remove previous eventlistner\n timeZoneScheduleBtn.off()\n timeZoneScheduleBtn.on('click', function(event){\n event.stopPropagation();\n // toggle class on timezone btn and flyout menu\n $(this).toggleClass('active');\n timezoneList.toggleClass('active')\n if( $(this).hasClass('active') ){\n $('body').css('overflow-y','hidden')\n }else{\n $('body').css('overflow-y','scroll')\n }\n })\n\n // Close Timezone and us/canadian flyout on window click\n if(window.innerWidth >= 1024){\n $(window).click(function() {\n timeZoneScheduleBtn.removeClass('active');\n timezoneList.removeClass('active')\n $('body').css('overflow-y','scroll')\n });\n }\n\n $('.timezone-overlay-content #close-modal').click(function() {\n resetTimeZoneOverlayMobile(currentScheduleClassName, currentTimeZone);\n closeTimeZoneModal();\n });\n\n $('.timezone-overlay-content #cancel-button').click(function() {\n resetTimeZoneOverlayMobile(currentScheduleClassName, currentTimeZone);\n closeTimeZoneModal();\n });\n\n $('.timezone-overlay-content #apply-button').click(function() {\n closeTimeZoneModal();\n document.cookie = \"timeZoneSetting=\"+timeZone;\n refreshPage(scheduleClassName , timeZone);\n timeZoneScheduleBtn.find('span').text(timeZoneScheduleBtnChg());\n });\n\n // add eventlistner to each flyout nav element\n // remove previous eventlistner\n timezoneList.off()\n timezoneList.children('.timezone-content').children('li').each( function(){\n $(this).off()\n $(this).on('click', function(){\n //console.log('click')\n // identify if schedule portion or timezone was clicked\n let whatChanged = $(this).data('schedule') ? 'schedule' : 'timezone';\n\n // handle Schedule clicks / changes\n if(whatChanged == 'schedule'){\n count ++\n // change style on btn dropdown\n $('.schedule').toggleClass('active')\n scheduleClassName = $(this).data('schedule');\n // Toggle VOD's on page based on Schedule selection\n $('.scheduled--vod ').each(function(){\n // search is active\n if(searchIsActive){\n // remove day filter class\n //$(this).removeClass('dayFilterHidden')\n // current vod is in current schedule\n if( $(this).hasClass(scheduleClassName) && !$(this).hasClass('searchHidden') ) {\n $(this).removeClass('scheduleHidden')\n }else{\n $(this).addClass('scheduleHidden')\n }\n }else{\n // if not in search view // in current schedule if date = today\n if( $(this).hasClass(scheduleClassName) ) {\n $(this).removeClass('scheduleHidden')\n // $(this).removeClass('dayFilterHidden')\n }else{\n $(this).addClass('scheduleHidden')\n // $(this).removeClass('dayFilterHidden')\n }\n }\n });\n // if(count <=1){\n // console.log('timezone Page Refresh() ----')\n // refreshPage( scheduleClassName , timeZone)\n // timeZoneScheduleBtn.find('span').text(timeZoneScheduleBtnChg())\n // }\n timeZoneScheduleBtn.find('span').text(timeZoneScheduleBtnChg())\n document.cookie = \"countryCodeSetting=\"+scheduleClassName;\n }\n // handle Timezone clicks / changes\n else{\n // Style change active states after click\n timeZone = $(this).data('timezone');\n $('.timezone').removeClass('active');\n $('.timezone').each(function(){\n if( $(this).data('timezone') == timeZone){\n $(this).addClass('active');\n }\n })\n // Refresh window and load new data\n if(window.innerWidth >= 1024){\n $('#schedule').empty()\n loader.classList.remove('hidden')\n console.log('timezone Page Refresh() ----')\n document.cookie = \"timeZoneSetting=\"+timeZone;\n refreshPage( scheduleClassName , timeZone)\n timeZoneScheduleBtn.find('span').text(timeZoneScheduleBtnChg())\n }\n }\n })\n })\n\n // Listen for keystroke events\n searchValue.onkeyup = function (e) {\n if(searchValue.value.trim() != ''){\n emptySearchDiv.classList.add('hidden')\n searchIsActive = true\n loader.classList.remove('hidden')\n dynamicContent.classList.add('hidden')\n // prevent retun key from refrehing page.\n e.preventDefault();\n // hide the daily navigation bar when search is activated.\n\n // Clear the timeout if it has already been set.\n // This will prevent the previous task from executing\n // if it has been less than \n clearTimeout(timeout);\n\n // Make a new timeout set to go off in 800ms\n timeout = setTimeout(function () {\n\n // hide all date headers that appear above serched items\n let listedVOodHeader = Array.from(document.querySelectorAll('.scheduled--day-line-break') );\n listedVOodHeader.forEach(header => {\n header.classList.add('headerHidden')\n })\n\n // grab all vods\n let listedVODs = Array.from(document.querySelectorAll('.scheduled--vod') );// use if you only want to filter current schedule\n //let listedVODs = Array.from(document.querySelectorAll('.scheduled--vod') );\n\n listedVODs.map(vod => {\n // remove all dayhidden classes\n vod.classList.remove('dayFilterHidden')\n // remove all searchHidden classes from current schedule\n vod.classList.remove('searchHidden');\n // if title does NOT contain search term .. hide div\n if(!vod.querySelector('.scheduled--vod__monthly__copy__title').textContent.toLowerCase().includes(searchValue.value.toLowerCase().trim())){\n vod.classList.add('searchHidden');\n totalVodCount ++\n }else{\n //console.log('value '+ searchValue.value +\"\\n\"+vod.querySelector('.scheduled--vod__copy__title').textContent)\n // if title contains search term .. show div\n vod.classList.remove('searchHidden');\n // also show the date header associated with serched vod\n var vodDateOfSearchReturn = vod.dataset.vodDate\n var vodDateOfSearchReturnId = document.getElementById('vod-'+vodDateOfSearchReturn)\n vodDateOfSearchReturnId.classList.remove('headerHidden')\n }\n })\n // Empty search?\n // Is Search term is NOT found in any Vods? Then display empty log warning\n if(totalVodCount == listedVODs.length ){\n // If empty log is NOT showing .. show\n if(emptySearchDiv.classList.contains('hidden')){\n emptySearchDiv.classList.remove('hidden')\n }\n }else{\n emptySearchDiv.classList.add('hidden')\n }\n // Reset count for Search\n totalVodCount = 0;\n\n loader.classList.add('hidden')\n dynamicContent.classList.remove('hidden')\n }, 1000);\n\n /* working working working don't touch\n timeout = setTimeout(function () {\n console.log('Input Value:', searchValue.value) + '\\ntypof '+ typeof searchValue.value;\n let listedVODs = Array.from(document.querySelectorAll('.scheduled--vod:not(.hidden) .scheduled--vod__copy__title') );\n\n let searchMatchForTitles = listedVODs\n .map(vodName => vodName.textContent.toLowerCase() )\n .filter(vodName => vodName.toLowerCase().includes(searchValue.value))\n console.log( searchMatchForTitles)\n\n }, 1000); */\n }\n };\n\n loader.classList.add('hidden')\n dynamicContent.classList.remove('hidden')\n });\n searchIsActive = false;\n ajaxCall++\n }\n }\n\n // fire this call on first page load only\n if( count <= 1){\n refreshPage(scheduleClassName , timeZone) \n }\n \n // X-out of Search\n clearSearchBtn.addEventListener('click', function(){\n emptySearchDiv.classList.add('hidden')\n searchIsActive = false;\n refreshPage(scheduleClassName , timeZone)\n })\n\n // Listen for click events on Dom\n window.addEventListener('click', function(){\n //if clicked into searchbox\n if (document.activeElement == searchValue) {\n cancelSearchBtn.classList.remove('hidden')\n } else {\n cancelSearchBtn.classList.add('hidden');\n }\n })\n }\n }\n }\n}\n","/**\n * TODO - Leaving this file in here because compiuled js file needs it (just broken things)\n */\nexport default class VideoPlayer {\n static initialize(UrlPathname, apiURL) {}\n\n} \n","import { createItemListSchema } from './Schema';\nexport default class TrendingPage {\n\n static initialize(UrlPathname, apiURL) {\n\n if(UrlPathname == '/trending' ){\n\n $.ajax({\n url: `${apiURL}/tcmws/trending`,\n type: \"GET\",\n success: function(data) {\n createItemListSchema(data, 'mixed');\n $(document).ready(function() {\n $.each(data, function(index, item) {\n if (item.itemStatus.toLocaleLowerCase() === 'published') {\n if(item.contentType == 'article'){\n console.log(item.titleConsumer)\n $('.tcm-trending').append(`\n
    \n `)\n }else{\n $(\".tcm-trending\").append(`\n \n `);\n }\n }\n })\n });\n },\n error: function(error) {\n console.log('error on page--watchtcm--titles.html.twig Flow Call\\n' + error);\n }\n });\n }\n }\n}\n","export default class sideNav {\n\n static initialize(UrlPathname, apiURL) {\n\n if (UrlPathname === '/hosts' || UrlPathname === '/host' || UrlPathname ===\n '/this-month' || UrlPathname === '/archives') {\n\n // ---------- Create Embedded Articles witnin this-month section\n // --------------// When side nav elements are clicked on /this-month:\n // Either empty the page and rebuild using api data Or link out to a\n // sepearte page\n window.openIn = function(linkType, linkUrl, contentId, contentType, landerText, source = 'nav') {\n if (landerText === '') {\n if (source.indexOf('HTM') >-1 ) {\n landerText = 'Happening This Month';\n } else {\n landerText = 'This Month';\n }\n }\n localStorage.setItem(source, decodeURIComponent(landerText));\n\n // Empty the page and rebuild using api data\n // Example of api return values\n // https://qa-tcmws.tcm.com/tcmws/contentApi/articleById/020635\n if (linkType === 'Content') {\n document.location.href = `/this-month/article/${contentId}?source=${source}`;\n }\n // not sure if this is used anymore.\n else if (linkType === 'Lander') {\n document.location.href = linkUrl;\n }\n\n // Update - Increment Trending Table for the current ContentId\n $.ajax({\n method: 'GET',\n url: `${apiURL}/tcmws/trending/article/${contentId}`,\n }, function(err, res, body) {\n if (err) {\n console.log('Failure Incrementing Trending');\n console.table(err);\n }\n else {\n console.log('Success Incrementing Trending ' + res);\n console.table(res);\n }\n });\n };\n }\n }\n}\n\n\n\n\n\n\n","\nexport default class hosts {\n\n static initialize(UrlPathname, apiURL) {\n\n // const throttle = (func, limit) => {\n // let inThrottle\n // return function () {\n // const args = arguments\n // const context = this\n // if (!inThrottle) {\n // func.apply(context, args)\n // inThrottle = true\n // setTimeout(() => inThrottle = false, limit)\n // }\n // }\n // }\n\n // Sticky Nav -- When the user scrolls the page run function\n if(UrlPathname == '/hosts'){\n\n $(document).ready(function() {\n\n // Admin preview page\n if (window.location.href.indexOf(\"?preview=true\") > -1) {\n //?previewHome=true&2020-06-10T00:00:00\n var dateTime = window.location.href.split(\"preview=true&\")[1];\n //$(\".content-body\").empty();\n //$(\".tcm-intro__header\").empty();\n\n $.ajax({\n url: apiURL+\"tcmws/hosts/categories/all\",\n type: \"GET\",\n cache: false,\n headers: {\n \"accept\": \"application/json;odata=verbose\",\n },\n success: function(data) {\n alert('preview')\n },\n error: function(error) {\n console.log('error connecting to ' +apiURL+\"/tcmws/thisMonth/\"+dateTime +'\\n'+ error );\n }\n });\n }\n // Customer Facing Non-Admin page // qa.tcm.com/this-month?icid=mainnav8-tcm-in-july\n else{\n $.ajax({\n url: apiURL+\"/tcmws/hosts/categories/all\",\n type: \"GET\",\n cache: false,\n headers: {\n \"accept\": \"application/json;odata=verbose\",\n },\n success: function(data) {\n // Add Host Lanes on page .. Primetime Hosts ... Noir Alley Hosts\n $.each(data, function(index, item) {\n var hostTypeId = item.title.replace(/ /g, \"-\");\n $(\".content-body\").append(`\n
    \n

    ${item.title}

    \n
    \n
    \n `)\n // Add Individual Hosts ---\n // Poor man's async\n if(index == (data.length -1)){\n $.ajax({\n url: apiURL+\"/tcmws/hosts/all\",\n type: \"GET\",\n cache: false,\n headers: {\n \"accept\": \"application/json;odata=verbose\",\n },\n success: function(data) {\n console.log('fired')\n $.each(data, function(index, item) {\n var hostTypeId = item.hostType.replace(/ /g, \"-\");\n console.log(hostTypeId)\n console.log(item.name)\n $(`#${hostTypeId}`).append(`\n \n \n
    ${item.name}
    \n
    \n `)\n })\n },\n error: function(error) {\n console.log('Error ' + apiURL+\"/tcmws/hosts/categories/all\\n\" + error);\n }\n });\n }\n })\n },\n error: function(error) {\n console.log('Error ' + apiURL+\"/tcmws/hosts/categories/all\\n\" + error);\n }\n });\n }\n });\n\n // function fillInArticles(articleData){\n // $.each(articleData, function(index, item) {\n // var articles = item.articles;\n // $.each(articles, function(index, item) {\n // var contentType = item.type.replace(/\\s/g, '');\n // if((item.headerImg == null) || (item.headerImg == \"\")){\n // var headerImg = \"https://prod-images.tcm.com/img/global/tcm-clip-no-image.png\";\n // }\n // else{\n // var headerImg = item.headerImg;\n // }\n // $(`#${contentType}Lane`).append(`\n // \n //
    \n // \n //

    ${item.consumerTitle}

    \n //
    \n //
    \n // `)\n // })\n // })\n // }\n\n // highlight hosts sidenav .. until you refactor sidenav film.detail.js\n setTimeout( function(){\n $('.film-detail__sidebar__list__item').removeClass('active');\n $('[data-settings-section=\"hosts\"]').addClass('active');\n }, 900);\n }\n }\n}\n","import { appendSchema, createArticleSchema } from './Schema';\nexport default class thisMonth {\n\n static initialize(UrlPathname, apiURL) {\n\n // Sticky Nav -- When the user scrolls the page run function\n if(UrlPathname == '/this-month'){\n // Set dev/prod variables based off url:\n let envVars = window.location.hostname;\n let s3Pool, s3Bucket, akamaiPre\n switch (envVars) {\n case 'dev.tcm.com':\n s3Pool = \"us-east-1:815c496b-b17c-4d68-87ae-25af39af7d0c\"\n s3Bucket = \"tcm-qa-www\"\n akamaiPre = \"https://qa-images.tcm.com/\"\n break;\n case 'dev-admin.tcm.com':\n s3Pool = \"us-east-1:815c496b-b17c-4d68-87ae-25af39af7d0c\"\n s3Bucket = \"tcm-qa-www\"\n akamaiPre = \"https://qa-images.tcm.com/\"\n break;\n case 'qa.tcm.com':\n s3Pool = \"us-east-1:815c496b-b17c-4d68-87ae-25af39af7d0c\"\n s3Bucket = \"tcm-qa-www\"\n akamaiPre = \"https://qa-images.tcm.com/\"\n break;\n case 'qa-admin.tcm.com':\n s3Pool = \"us-east-1:815c496b-b17c-4d68-87ae-25af39af7d0c\"\n s3Bucket = \"tcm-qa-www\"\n akamaiPre = \"https://qa-images.tcm.com/\"\n break;\n case 'staging.tcm.com':\n s3Pool = \"us-east-1:815c496b-b17c-4d68-87ae-25af39af7d0c\"\n s3Bucket = \"tcm-stage-www\"\n akamaiPre = \"https://staging-images.tcm.com/\"\n break;\n case 'staging-admin.tcm.com':\n s3Pool = \"us-east-1:815c496b-b17c-4d68-87ae-25af39af7d0c\"\n s3Bucket = \"tcm-stage-www\"\n akamaiPre = \"https://staging-images.tcm.com/\"\n break;\n case \"prod.tcm.com\":\n s3Pool = \"us-east-1:30cf1fd4-ac22-4a68-b1e5-05d5f33a12a5\"\n s3Bucket = \"tcm-prod-www\"\n akamaiPre = \"https://prod-images.tcm.com/\"\n break;\n case \"prod-admin.tcm.com\":\n s3Pool = \"us-east-1:30cf1fd4-ac22-4a68-b1e5-05d5f33a12a5\"\n s3Bucket = \"tcm-prod-www\"\n akamaiPre = \"https://prod-images.tcm.com/\"\n break;\n case \"www.tcm.com\":\n s3Pool = \"us-east-1:30cf1fd4-ac22-4a68-b1e5-05d5f33a12a5\"\n s3Bucket = \"tcm-prod-www\"\n akamaiPre = \"https://prod-images.tcm.com/\"\n break;\n default:\n s3Pool = \"us-east-1:815c496b-b17c-4d68-87ae-25af39af7d0c\"\n s3Bucket = \"tcm-develop-www\"\n akamaiPre = \"http://dev-images.tcm.com/\"\n }\n\n $(document).ready(function() {\n // Admin Preview-Page for /this-month -------------------------------\n if (window.location.href.indexOf(\"?preview=true\") > -1) {\n //$(\".tcm-share-hanger\").hide();\n var dateTime = window.location.href.split(\"preview=true&\")[1];\n $.ajax({\n url: apiURL+\"/tcmws/thisMonth/\"+dateTime,\n type: \"GET\",\n cache: false,\n headers: {\n \"accept\": \"application/json;odata=verbose\",\n },\n success: function(data) {\n var heroCount = 0\n // Hero-Banner at Top of Page -----------------\n $.each(data.tcm.thisMonthHeroes, function(index, item) {\n if(heroCount < 1){ // not sure why we loop here\n var landerText = item.landerText || '';\n var url = item.linkUrl;\n var linkType = item.linkType;\n let anchorLinks = ''\n let newWindow = item.newWindow == \"YES\"? true : false;\n\n if(linkType == \"External\"){\n $(\"#thisMonthHeader\").append(`\n
    \n
    \n
    \n \n \n \n
    \n
    \n
    \n `)\n }else if(linkType == \"Content\"){ // if Content or Lander\n let isVideo = url.includes('/video/')\n if(isVideo){ // if video .. use a regular href\n anchorLinks = ``\n }else{ // use the onClick()\n // Api doesn't currenly have articleID .. soo\n // Grab the articleId from the URL key ... split into and array and use the 3nd arr value\n let articleURLArray = url.split('/');\n // Escape quotes used in lander text\n // // landerText = landerText.replace(/'/g, '-html-single-').replace(/\"/g, '-html-double-')\n anchorLinks = ``\n\n }\n $(\"#thisMonthHeader\").append(`\n
    \n \n
    \n `)\n }else if(linkType == \"Lander\"){\n // Escape quotes used in lander text\n // // landerText = landerText.replace(/'/g, '-html-single-').replace(/\"/g, '-html-double-')\n // create onclick()\n anchorLinks = ``\n\n $(\"#thisMonthHeader\").append(`\n
    \n \n
    \n `)\n }\n\n heroCount++\n console.log(\"heroCount = \"+ heroCount)\n }\n })\n\n // Hero Blocks on /this-month page ... 2 of them at top of page -----------------\n var blockOneCount = 0\n var blockTwoCount = 0\n $.each(data.tcm.thisMonthBlocks, function(index, item) {\n var landerText = item.landerText || '';\n if(blockOneCount < 1 && item.itemOrder == \"1\"){\n // All HTM articles should open as embeded articles i.e. this-month?articleId=123456\n let isArticle = item.linkUrl.includes('/articles/')\n let anchorLinks = ''\n item.linkUrl = item.linkUrl.replace(/'/g, '').replace(/\"/g, '').replace(/ /g, '-')\n // need to excape quotes, ascii or char encodes just display a quote .. which breaks onclick()\n // landerText = item.landerText.replace(/'/g, '-html-single-').replace(/\"/g, '-html-double-')\n\n // If HTM Links to an article use the global onclick()\n if(item.linkType == \"Content\" && isArticle){\n\n // Api doesn't currenly have articleID .. soo\n // Grab the articleId from the URL key ... split into and array and use the 3nd arr value\n let articleURLArray = item.linkUrl.split('/');\n\n anchorLinks = ``\n\n }else{\n // Otherwise use the href\n anchorLinks = ``\n }\n\n $(\"#thisMonthBlock1\").append(`\n ${anchorLinks}\n
    \n

    ${item.header}

    \n
    \n

    ${item.subHeader}

    \n ${item.teaserText}\n ${anchorLinks}${item.linkText}\n
    \n `)\n blockOneCount++\n }\n // Hero Block 2\n if(blockTwoCount < 1 && item.itemOrder == \"2\"){\n\n // All HTM articles should open as embeded articles i.e. this-month?articleId=123456\n let isArticle = item.linkUrl.includes('/articles/')\n let anchorLinks = ''\n item.linkUrl = item.linkUrl.replace(/'/g, '').replace(/\"/g, '').replace(/ /g, '-')\n // need to excape quotes, ascii or char encodes just display a quote .. which breaks onclick()\n landerText = escape(item.landerText);\n // If HTM Links to an article use the global onclick()\n if(item.linkType == \"Content\" && isArticle){\n\n // Api doesn't currenly have articleID .. soo\n // Grab the articleId from the URL key ... split into and array and use the 3nd arr value\n let articleURLArray = item.linkUrl.split('/');\n\n\n anchorLinks = ``\n\n }else{\n // Otherwise use the href\n anchorLinks = ``\n }\n $(\"#thisMonthBlock2\").append(`\n ${anchorLinks}\n
    \n

    ${item.header}

    \n
    \n

    ${item.subHeader}

    \n ${item.teaserText}\n ${anchorLinks}${item.linkText} \n
    \n `)\n blockTwoCount++\n }\n })\n\n // Happening This Month - Headers\n var thisMonthHTM = data.tcm.thisMonthHTM.sort((a,b) => a.itemOrder-b.itemOrder )\n if(thisMonthHTM.length > 0){\n $(\"#HTMContentWell\").append(`\n

    Happening This Month

    \n
    \n `);\n }\n\n // Happening This Month - Tiles\n $.each(thisMonthHTM, function(index, item) {\n var landerText = item.landerText || '';\n // All HTM articles should open as embeded articles i.e. this-month?articleId=123456\n let isArticle = item.linkUrl.includes('/articles/')\n let anchorLinks = ''\n item.linkUrl = item.linkUrl.replace(/'/g, '').replace(/\"/g, '').replace(/ /g, '-')\n // need to excape quotes, ascii or char encodes just display a quote .. which breaks onclick()\n landerText = escape(item.landerText);\n item.linkText = item.linkText.replace(/\\'/g, \"'\").replace(/\\\"/g, '\"')\n // If HTM Links to an article use the global onclick()\n if(item.linkType == \"Content\" && isArticle){\n\n // Api doesn't currenly have articleID .. soo\n // Grab the articleId from the URL key ... split into and array and use the 3nd arr value\n let articleURLArray = item.linkUrl.split('/');\n\n anchorLinks = ` `\n\n }else{\n // Otherwise use the href\n anchorLinks = ` `\n }\n\n $(\"#HTMContentWell\").append(`\n ${anchorLinks}\n \n

    ${item.linkText ? item.linkText : item.header}

    \n
    \n `)\n })\n var lanesLength = data.tcm.thisMonthLanes.length;\n var laneCount = lanesLength - 1;\n var i;\n\n // Other lanes Found below Happening This Month ... Movie News, Film Comments\n for (i = 0; i < data.tcm.thisMonthLanes.length; i++) {\n if(lanesLength != i){\n var contentTypeId = data.tcm.thisMonthLanes[i].contentType.replace(/\\s/g, '').replace(\"'\",\"\");\n $(\"#lanesWell\").append(`\n
    \n

    ${data.tcm.thisMonthLanes[i].contentType}

    \n View All \n

    \n
    \n
    \n
    \n `)\n }\n if (laneCount == i){\n var articleData = data.tcm.thisMonthLanes\n fillInArticles(articleData);\n }\n }\n\n // Ad Banner at the footer of /this-month\n let footerAd;\n // Ad Banner - random number generator / if 4 ads are in flight ... rotate.\n if(data.tcm.thisMonthBanners.length > 1){\n let max = data.tcm.thisMonthBanners.length\n let randomInt = Math.floor(Math.random() * max)\n footerAd = data.tcm.thisMonthBanners[randomInt]\n }else{\n footerAd = data.tcm.thisMonthBanners[0]\n }\n\n\n $(\"#TM-Banners\").append(`\n \n \n \n `)\n },\n error: function(error) {\n console.log('Error ' + apiURL+'/tcmws/thisMonth\\n' + error);\n }\n });\n }\n\n // Admin Preview-Page -- Preview Hero\n else if (window.location.href.indexOf(\"?preview=Hero\") > -1){\n var headerImg = $.cookie(\"HeroheaderImg\");\n //var header = $.cookie(\"Heroheader\");\n var landerText = $.cookie(\"HerolanderText\") || '';\n //var link = $.cookie(\"Herolink\");\n var url = $.cookie(\"linkUrl\");\n var linkType = $.cookie(\"linkType\");\n var newWindow = $.cookie(\"newWindow\") == \"YES\"? true : false;\n let anchorLinks = ''\n\n\n if(linkType == \"External\"){\n $(\"#thisMonthHeader\").append(`\n
    \n
    \n
    \n \n \n \n
    \n
    \n
    \n `)\n }else if(linkType == \"Content\"){ // if Content or Lander\n let isVideo = url.includes('/video/')\n if(isVideo){ // if video .. use a regular href\n anchorLinks = ``\n }else{ // use the onClick()\n // Api doesn't currenly have articleID .. soo\n // Grab the articleId from the URL key ... split into and array and use the 3nd arr value\n let articleURLArray = url.split('/');\n // Escape quotes used in lander text\n // // landerText = landerText.replace(/'/g, '-html-single-').replace(/\"/g, '-html-double-')\n // create onclick()\n anchorLinks = ``\n\n }\n $(\"#thisMonthHeader\").append(`\n
    \n \n
    \n `)\n }else if(linkType == \"Lander\"){\n // Escape quotes used in lander text\n // // landerText = landerText.replace(/'/g, '-html-single-').replace(/\"/g, '-html-double-')\n // create onclick()\n anchorLinks = ``\n\n $(\"#thisMonthHeader\").append(`\n
    \n \n
    \n `)\n }\n\n //Block 1 - Dummy Content\n $(\"#thisMonthBlock1\").append(`\n \n
    \n

    Block 2 Header

    \n
    \n

    Block 2 Subheader

    \n Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\n LEARN MORE \n
    \n `)\n //Block 2 - Dummy Content\n $(\"#thisMonthBlock2\").append(`\n \n
    \n

    Block 2 Header

    \n
    \n

    Block 2 Subheader

    \n Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\n LEARN MORE \n
    \n `)\n //HTM Preview and Placeholder Content - Dummy Content\n $(\"#HTMContentWell\").append(`\n \n \n

    HTM Block 1 Placeholder Text Goes Here

    \n
    \n `)\n $(\"#HTMContentWell\").append(`\n \n \n

    HTM Block 2 Placeholder Text Goes Here

    \n
    \n `)\n $(\"#HTMContentWell\").append(`\n \n \n

    HTM Block 3 Placeholder Text Goes Here

    \n
    \n `)\n //Placeholder Lane Content - Dummy Content\n $(\"#lanesWell\").append(`\n
    \n

    Lane Header

    \n View All \n

    \n
    \n
    \n
    \n `)\n $(`#PlaceholderLane`).append(`\n \n
    \n \n

    Placeholder Text Goes Here

    \n
    \n
    \n `);\n $(`#PlaceholderLane`).append(`\n \n
    \n \n

    Placeholder Text Goes Here

    \n
    \n
    \n `)\n $(`#PlaceholderLane`).append(`\n \n
    \n \n

    Placeholder Text Goes Here

    \n
    \n
    \n `)\n //Banner Placeholder - Dummy Content\n $(\"#TM-Banners\").append(`\n \n \n `\n );\n }\n\n // Admin Preview-Page -- Preview Block\n else if (window.location.href.indexOf(\"?preview=Block\") > -1){\n var headerImg = $.cookie(\"BlockheaderImg\");\n var header = $.cookie(\"Blockheader\");\n var landerText = $.cookie(\"BlocklanderText\") || '';\n var link = $.cookie(\"Blocklink\");\n var BlocklinkUrl = $.cookie(\"BlocklinkUrl\");\n var BlocklinkType = $.cookie(\"BlocklinkType\");\n var BlockheroNewWindow = $.cookie(\"BlockheroNewWindow\");\n var BlocklinkText = $.cookie(\"BlocklinkText\");\n var BlockteaserText = $.cookie(\"BlockteaserText\");\n var BlocksubHeader = $.cookie(\"BlocksubHeader\");\n // Sean moved anchor link to scope to other content types\n let anchorLinks = ''\n //$(\".tcm-share-hanger\").hide();\n //Hero\n $(\"#thisMonthHeader\").append(`\n
    \n
    \n
    \n \n \n \n
    \n
    \n
    \n `)\n\n //Block 1\n if(BlocklinkType == \"Content\"){\n\n // All HTM articles should open as embeded articles i.e. this-month?articleId=123456\n let isArticle = BlocklinkUrl.includes('/articles/')\n\n BlocklinkUrl = BlocklinkUrl.replace(/'/g, '').replace(/\"/g, '').replace(/ /g, '-')\n // need to excape quotes, ascii or char encodes just display a quote .. which breaks onclick()\n\n // If HTM Links to an article use the global onclick()\n if(BlocklinkType == \"Content\" && isArticle){\n // Api doesn't currenly have articleID .. soo\n // Grab the articleId from the URL key ... split into and array and use the 3nd arr value\n let articleURLArray = BlocklinkUrl.split('/');\n // landerText = landerText.replace(/'/g, '-html-single-').replace(/\"/g, '-html-double-')\n anchorLinks = ``\n\n }else{\n // Otherwise use the href\n anchorLinks = ``\n }\n $(\"#thisMonthBlock1\").append(`\n ${anchorLinks}\n
    \n

    ${header}

    \n
    \n

    ${BlocksubHeader}

    \n ${BlockteaserText}\n ${anchorLinks}${BlocklinkText} \n
    \n `)\n }\n\n else if(BlocklinkType ==\"External\"){\n // Sean Added anchor links External\n anchorLinks = ``\n\n $(\"#thisMonthBlock1\").append(`\n ${anchorLinks}\n
    \n

    ${header}

    \n
    \n

    ${BlocksubHeader}

    \n ${BlockteaserText}\n ${anchorLinks}${BlocklinkText} \n
    \n `)\n }\n else if(BlocklinkType ==\"Lander\"){\n // Api doesn't currenly have articleID .. soo\n // Grab the articleId from the URL key ... split into and array and use the 3nd arr value\n let articleURLArray = BlocklinkUrl.split('/');\n // landerText = landerText.replace(/'/g, '-html-single-').replace(/\"/g, '-html-double-')\n anchorLinks = ``\n\n $(\"#thisMonthBlock1\").append(`\n ${anchorLinks}\n
    \n

    ${header}

    \n
    \n

    ${BlocksubHeader}

    \n ${BlockteaserText}\n ${anchorLinks}${BlocklinkText} \n
    \n `)\n }\n\n //Block 2\n $(\"#thisMonthBlock2\").append(`\n \n
    \n

    Block 2 Header

    \n
    \n

    Block 2 Subheader

    \n Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\n LEARN MORE \n
    \n `)\n //HTM Preview and Placeholder Content\n $(\"#HTMContentWell\").append(`\n \n \n

    HTM Block 1 Placeholder Text Goes Here

    \n
    \n `)\n $(\"#HTMContentWell\").append(`\n \n \n

    HTM Block 2 Placeholder Text Goes Here

    \n
    \n `)\n $(\"#HTMContentWell\").append(`\n \n \n

    HTM Block 3 Placeholder Text Goes Here

    \n
    \n `)\n //Placeholder Lane Content\n $(\"#lanesWell\").append(`\n
    \n

    Lane Header

    \n View All \n

    \n
    \n
    \n
    \n `)\n $(`#PlaceholderLane`).append(`\n \n
    \n \n

    Placeholder Text Goes Here

    \n
    \n
    \n `);\n $(`#PlaceholderLane`).append(`\n \n
    \n \n

    Placeholder Text Goes Here

    \n
    \n
    \n `)\n $(`#PlaceholderLane`).append(`\n \n
    \n \n

    Placeholder Text Goes Here

    \n
    \n
    \n `)\n //Banner Placeholder\n $(\"#TM-Banners\").append(`\n \n \n `\n );\n }\n\n // Admin Preview-Page - Preview HTM\n else if (window.location.href.indexOf(\"?preview=HTM\") > -1){\n var headerImg = $.cookie(\"HTMheaderImg\");\n var header = $.cookie(\"HTMheader\");\n var landerText = $.cookie(\"HTMlanderText\") || '';\n var link = $.cookie(\"HTMlink\");\n var HTMlinkUrl = $.cookie(\"HTMlinkUrl\");\n var HTMlinkType = $.cookie(\"HTMlinkType\");\n var HTMheroNewWindow = $.cookie(\"HTMheroNewWindow\");\n var HTMlinkText = $.cookie(\"HTMlinkText\");\n //$(\".tcm-share-hanger\").hide();\n //Hero\n $(\"#thisMonthHeader\").append(`\n
    \n
    \n
    \n \n \n \n
    \n
    \n
    \n `)\n //Block 1\n $(\"#thisMonthBlock1\").append(`\n \n
    \n

    Block 1 Header

    \n
    \n

    Block 1 Subheader

    \n Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\n LEARN MORE \n
    \n `)\n //Block 2\n $(\"#thisMonthBlock2\").append(`\n \n
    \n

    Block 2 Header

    \n
    \n

    Block 2 Subheader

    \n Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\n LEARN MORE \n
    \n `)\n //HTM Preview and Placeholder Content\n $(\"#HTMContentWell\").append(`\n

    Happening This Month

    \n
    \n `);\n // All HTM articles should open as embeded articles i.e. this-month?articleId=123456\n let isArticle = HTMlinkUrl.includes('/articles/')\n let anchorLinks = ''\n HTMlinkUrl = HTMlinkUrl.replace(/'/g, '').replace(/\"/g, '').replace(/ /g, '-')\n // need to excape quotes, ascii or char encodes just display a quote .. which breaks onclick()\n // landerText = landerText.replace(/'/g, '-html-single-').replace(/\"/g, '-html-double-')\n HTMlinkText = HTMlinkText.replace(/\\'/g, \"'\").replace(/\\\"/g, '\"')\n // If HTM Links to an article use the global onclick()\n if(HTMlinkType == \"Content\" && isArticle){\n\n // Api doesn't currenly have articleID .. soo\n // Grab the articleId from the URL key ... split into and array and use the 3nd arr value\n let articleURLArray = HTMlinkUrl.split('/');\n\n anchorLinks = ` `\n\n }else{\n // Otherwise use the href\n anchorLinks = ` `\n }\n\n $(\"#HTMContentWell\").append(`\n ${anchorLinks}\n \n

    ${HTMlinkText ? HTMlinkText : header}

    \n
    \n `)\n $(\"#HTMContentWell\").append(`\n \n \n

    HTM Block 2 Placeholder Text Goes Here

    \n
    \n `)\n $(\"#HTMContentWell\").append(`\n \n \n

    HTM Block 3 Placeholder Text Goes Here

    \n
    \n `)\n //Placeholder Lane Content\n $(\"#lanesWell\").append(`\n
    \n

    Lane Header

    \n View All \n

    \n
    \n
    \n
    \n `)\n $(`#PlaceholderLane`).append(`\n \n
    \n \n

    Placeholder Text Goes Here

    \n
    \n
    \n `);\n $(`#PlaceholderLane`).append(`\n \n
    \n \n

    Placeholder Text Goes Here

    \n
    \n
    \n `)\n $(`#PlaceholderLane`).append(`\n \n
    \n \n

    Placeholder Text Goes Here

    \n
    \n
    \n `)\n //Banner Placeholder\n $(\"#TM-Banners\").append(`\n \n \n `\n );\n }\n\n // Customer Facing Non-Admin page // qa.tcm.com/this-month ---------------------------------\n else{\n var cacheStamp = moment.utc().format('YYYY-MM-DD');\n $.ajax({\n url: apiURL+\"/tcmws/thisMonth?\"+cacheStamp,\n type: \"GET\",\n cache: true,\n headers: {\n \"accept\": \"application/json;odata=verbose\",\n },\n success: function(data) {\n console.log('Success 1st api page--this-month.twig:\\n'+ apiURL+\"/tcmws/thisMonth\" )\n var heroCount = 0\n // Hero-Banner at Top of Page -----------------\n $.each(data.tcm.thisMonthHeroes, function(index, item) {\n if(heroCount < 1){ // not sure why we loop here\n var landerText = item.landerText || '';\n var url = item.linkUrl;\n var linkType = item.linkType;\n let anchorLinks = ''\n let newWindow = item.newWindow == \"YES\"? true : false;\n\n if(linkType == \"External\"){\n $(\"#thisMonthHeader\").append(`\n
    \n
    \n
    \n \n \n \n
    \n
    \n
    \n `)\n }else if(linkType == \"Content\"){ // if Content or Lander\n let isVideo = url.includes('/video/')\n if(isVideo){ // if video .. use a regular href\n anchorLinks = ``\n }else{ // use the onClick()\n // Api doesn't currenly have articleID .. soo\n // Grab the articleId from the URL key ... split into and array and use the 3nd arr value\n let articleURLArray = url.split('/');\n // Escape quotes used in lander text\n // landerText = landerText.replace(/'/g, '-html-single-').replace(/\"/g, '-html-double-')\n // create onclick()\n anchorLinks = ``\n\n }\n $(\"#thisMonthHeader\").append(`\n
    \n \n
    \n `)\n }else if(linkType == \"Lander\"){\n // Escape quotes used in lander text\n // landerText = landerText.replace(/'/g, '-html-single-').replace(/\"/g, '-html-double-')\n // create onclick()\n anchorLinks = ``\n\n $(\"#thisMonthHeader\").append(`\n
    \n \n
    \n `)\n }\n\n heroCount++\n console.log(\"heroCount = \"+ heroCount)\n }\n })\n\n // Hero Blocks on /this-month page ... 2 of them at top of page -----------------\n var blockOneCount = 0\n var blockTwoCount = 0\n $.each(data.tcm.thisMonthBlocks, function(index, item) {\n var landerText = item.landerText || '';\n if(blockOneCount < 1 && item.itemOrder == \"1\"){\n\n // All HTM articles should open as embeded articles i.e. this-month?articleId=123456\n let isArticle = item.linkUrl.includes('/articles/')\n let anchorLinks = ''\n item.linkUrl = item.linkUrl.replace(/'/g, '').replace(/\"/g, '').replace(/ /g, '-')\n // need to excape quotes, ascii or char encodes just display a quote .. which breaks onclick()\n // landerText = item.landerText.replace(/'/g, '-html-single-').replace(/\"/g, '-html-double-')\n\n // If HTM Links to an article use the global onclick()\n if(item.linkType == \"Content\" && isArticle){\n\n // Api doesn't currenly have articleID .. soo\n // Grab the articleId from the URL key ... split into and array and use the 3nd arr value\n let articleURLArray = item.linkUrl.split('/');\n\n anchorLinks = ``\n\n }else{\n // Otherwise use the href\n anchorLinks = ``\n }\n\n\n $(\"#thisMonthBlock1\").append(`\n ${anchorLinks}\n
    \n

    ${item.header}

    \n
    \n

    ${item.subHeader}

    \n ${item.teaserText}\n ${anchorLinks}${item.linkText}\n
    \n `)\n blockOneCount++\n }\n // Hero Block 2\n if(blockTwoCount < 1 && item.itemOrder == \"2\"){\n\n // All HTM articles should open as embeded articles i.e. this-month?articleId=123456\n let isArticle = item.linkUrl.includes('/articles/')\n let anchorLinks = ''\n item.linkUrl = item.linkUrl.replace(/'/g, '').replace(/\"/g, '').replace(/ /g, '-')\n // need to excape quotes, ascii or char encodes just display a quote .. which breaks onclick()\n // landerText = item.landerText.replace(/'/g, '-html-single-').replace(/\"/g, '-html-double-')\n // If HTM Links to an article use the global onclick()\n if(item.linkType == \"Content\" && isArticle){\n\n // Api doesn't currenly have articleID .. soo\n // Grab the articleId from the URL key ... split into and array and use the 3nd arr value\n let articleURLArray = item.linkUrl.split('/');\n\n\n anchorLinks = ``\n\n }else{\n // Otherwise use the href\n anchorLinks = ``\n }\n $(\"#thisMonthBlock2\").append(`\n ${anchorLinks}\n
    \n

    ${item.header}

    \n
    \n

    ${item.subHeader}

    \n ${item.teaserText}\n ${anchorLinks}${item.linkText} \n
    \n `)\n blockTwoCount++\n }\n })\n\n // Happening This Month - Headers\n var thisMonthHTM = data.tcm.thisMonthHTM.sort((a,b) => a.itemOrder-b.itemOrder )\n if(thisMonthHTM.length > 0){\n $(\"#HTMContentWell\").append(`\n

    Happening This Month

    \n
    \n `);\n }\n\n // Happening This Month - Tiles\n $.each(thisMonthHTM, function(index, item) {\n // All HTM articles should open as embeded articles i.e. this-month?articleId=123456\n let isArticle = item.linkUrl.includes('/articles/')\n let anchorLinks = ''\n item.linkUrl = item.linkUrl.replace(/'/g, '').replace(/\"/g, '').replace(/ /g, '-')\n // need to excape quotes, ascii or char encodes just display a quote .. which breaks onclick()\n var landerText = item.landerText || '';\n // landerText = item.landerText.replace(/'/g, '-html-single-').replace(/\"/g, '-html-double-')\n item.linkText = item.linkText.replace(/\\'/g, \"'\").replace(/\\\"/g, '\"')\n // If HTM Links to an article use the global onclick()\n if(item.linkType == \"Content\" && isArticle){\n\n // Api doesn't currenly have articleID .. soo\n // Grab the articleId from the URL key ... split into and array and use the 3nd arr value\n let articleURLArray = item.linkUrl.split('/');\n\n anchorLinks = ` `\n\n }else{\n // Otherwise use the href\n anchorLinks = ` `\n }\n\n $(\"#HTMContentWell\").append(`\n ${anchorLinks}\n \n

    ${item.linkText ? item.linkText : item.header}

    \n
    \n `)\n })\n var lanesLength = data.tcm.thisMonthLanes.length;\n var laneCount = lanesLength - 1;\n var i;\n\n // Other lanes Found below Happening This Month ... Movie News, Film Comments\n for (i = 0; i < data.tcm.thisMonthLanes.length; i++) {\n if(lanesLength != i){\n var contentTypeId = data.tcm.thisMonthLanes[i].contentType.replace(/\\s/g, '').replace(\"'\",\"\");\n $(\"#lanesWell\").append(`\n
    \n

    ${data.tcm.thisMonthLanes[i].contentType}

    \n View All \n

    \n
    \n
    \n
    \n `)\n }\n if (laneCount == i){\n var articleData = data.tcm.thisMonthLanes\n fillInArticles(articleData);\n }\n }\n\n // Ad Banner at the footer of /this-month\n let footerAd;\n // Ad Banner - random number generator / if 4 ads are in flight ... rotate.\n if(data.tcm.thisMonthBanners.length > 1){\n let max = data.tcm.thisMonthBanners.length\n let randomInt = Math.floor(Math.random() * max)\n footerAd = data.tcm.thisMonthBanners[randomInt]\n }else{\n footerAd = data.tcm.thisMonthBanners[0]\n }\n\n if (footerAd && footerAd.linkUrl) {\n $(\"#TM-Banners\").append(`\n \n \n \n `)\n }\n },\n error: function(error) {\n console.log('Error ' + apiURL+'/tcmws/thisMonth\\n' + error);\n }\n });\n }\n });\n\n // Article Blocks Found within Lanes on /this-month\n function fillInArticles(articleData){\n $.each(articleData, function(index, item) {\n var articles = item.articles;\n $.each(articles, function(index, item) {\n var contentType = item.type.replace(/\\s/g, '').replace(\"'\",\"\");\n if((item.headerImg == null) || (item.headerImg == \"\")){\n var headerImg = \"https://prod-images.tcm.com/img/global/tcm-clip-no-image.png\";\n }else{\n var headerImg = item.headerImg;\n }\n $(`#${contentType}Lane`).append(`\n \n
    \n \n

    ${item.consumerTitle}

    \n
    \n
    \n `)\n })\n })\n }\n }\n }\n}\n","\nexport default class FooterRibbon {\n\n static initialize() {\n\n document.addEventListener('DOMContentLoaded', closeFooterRibbon, false);\n \n function closeFooterRibbon(){ \n let ribbon = document.querySelector('.universal-footer__ribbon')\n let closeRibbonBtn = document.querySelector('.universal-footer__ribbon__content__clear')\n\n // used for testing\n //deleteCookie('privacyagreement')\n \n // Has user closed agreemnet? // no cookie is found\n // Set cookie, add EventListener on close\n if( !getCookie('privacyagreement')){\n console.log('No Cookie \\nsetting evnt list')\n ribbon.classList.add('active')\n closeRibbonBtn.addEventListener('click', function(){ \n setCookie('privacyagreement', true, 100) \n ribbon.classList.toggle('active')\n console.log('is Set Now')\n }) \n // User has closed agreement\n }else{ \n ribbon.classList.remove('active')\n }\n \n function getCookie(name) {\n var v = document.cookie.match('(^|;) ?' + name + '=([^;]*)(;|$)');\n return v ? v[2] : null;\n } \n function setCookie(name, value, days) {\n var d = new Date;\n d.setTime(d.getTime() + 24*60*60*1000*days);\n document.cookie = name + \"=\" + value + \";path=/;expires=\" + d.toGMTString();\n }\n\n function deleteCookie(name) { setCookie(name, '', -1); }\n\n\n\n // add links behind stupid Drupal stuff in footer\n $('a[href^=\"http://www.tcm.com/code-of-conduct.html\"]').attr('target','_blank');\n $('a[href^=\"https://www.turner.com/pressroom\"]').attr('target','_blank');\n }\n\n\n }\n}","\nexport default class Polyfills {\n /**\n * Mainly for dev & qa environments where Babel isn't used. \n * Create polyfills for missing ECMA2016 methods.\n */\n static initialize() {\n \n // Array.find() polyfill\n // https://tc39.github.io/ecma262/#sec-array.prototype.find\n // Adds .find() method to Array for use in i.e.11 \n if (!Array.prototype.find) {\n Object.defineProperty(Array.prototype, 'find', {\n value: function(predicate) {\n // 1. Let O be ? ToObject(this value).\n if (this == null) {\n throw new TypeError('\"this\" is null or not defined');\n }\n \n var o = Object(this);\n \n // 2. Let len be ? ToLength(? Get(O, \"length\")).\n var len = o.length >>> 0;\n \n // 3. If IsCallable(predicate) is false, throw a TypeError exception.\n if (typeof predicate !== 'function') {\n throw new TypeError('predicate must be a function');\n }\n \n // 4. If thisArg was supplied, let T be thisArg; else let T be undefined.\n var thisArg = arguments[1];\n \n // 5. Let k be 0.\n var k = 0;\n \n // 6. Repeat, while k < len\n while (k < len) {\n // a. Let Pk be ! ToString(k).\n // b. Let kValue be ? Get(O, Pk).\n // c. Let testResult be ToBoolean(? Call(predicate, T, « kValue, k, O »)).\n // d. If testResult is true, return kValue.\n var kValue = o[k];\n if (predicate.call(thisArg, kValue, k, o)) {\n return kValue;\n }\n // e. Increase k by 1.\n k++;\n }\n \n // 7. Return undefined.\n return undefined;\n }\n });\n }\n\n \n // Array.from() polyfill\n // From https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/from\n // Production steps of ECMA-262, Edition 6, 22.1.2.1\n if (!Array.from) {\n Array.from = (function () {\n var toStr = Object.prototype.toString;\n var isCallable = function (fn) {\n return typeof fn === 'function' || toStr.call(fn) === '[object Function]';\n };\n var toInteger = function (value) {\n var number = Number(value);\n if (isNaN(number)) { return 0; }\n if (number === 0 || !isFinite(number)) { return number; }\n return (number > 0 ? 1 : -1) * Math.floor(Math.abs(number));\n };\n var maxSafeInteger = Math.pow(2, 53) - 1;\n var toLength = function (value) {\n var len = toInteger(value);\n return Math.min(Math.max(len, 0), maxSafeInteger);\n };\n\n // The length property of the from method is 1.\n return function from(arrayLike/*, mapFn, thisArg */) {\n // 1. Let C be the this value.\n var C = this;\n\n // 2. Let items be ToObject(arrayLike).\n var items = Object(arrayLike);\n\n // 3. ReturnIfAbrupt(items).\n if (arrayLike == null) {\n throw new TypeError('Array.from requires an array-like object - not null or undefined');\n }\n\n // 4. If mapfn is undefined, then let mapping be false.\n var mapFn = arguments.length > 1 ? arguments[1] : void undefined;\n var T;\n if (typeof mapFn !== 'undefined') {\n // 5. else\n // 5. a If IsCallable(mapfn) is false, throw a TypeError exception.\n if (!isCallable(mapFn)) {\n throw new TypeError('Array.from: when provided, the second argument must be a function');\n }\n\n // 5. b. If thisArg was supplied, let T be thisArg; else let T be undefined.\n if (arguments.length > 2) {\n T = arguments[2];\n }\n }\n\n // 10. Let lenValue be Get(items, \"length\").\n // 11. Let len be ToLength(lenValue).\n var len = toLength(items.length);\n\n // 13. If IsConstructor(C) is true, then\n // 13. a. Let A be the result of calling the [[Construct]] internal method\n // of C with an argument list containing the single item len.\n // 14. a. Else, Let A be ArrayCreate(len).\n var A = isCallable(C) ? Object(new C(len)) : new Array(len);\n\n // 16. Let k be 0.\n var k = 0;\n // 17. Repeat, while k < len… (also steps a - h)\n var kValue;\n while (k < len) {\n kValue = items[k];\n if (mapFn) {\n A[k] = typeof T === 'undefined' ? mapFn(kValue, k) : mapFn.call(T, kValue, k);\n } else {\n A[k] = kValue;\n }\n k += 1;\n }\n // 18. Let putStatus be Put(A, \"length\", len, true).\n A.length = len;\n // 20. Return A.\n return A;\n };\n }());\n } \n\n // Array.includes() polyfill\n // https://tc39.github.io/ecma262/#sec-array.prototype.includes\n if (!Array.prototype.includes) {\n Object.defineProperty(Array.prototype, 'includes', {\n value: function(valueToFind, fromIndex) {\n \n if (this == null) {\n throw new TypeError('\"this\" is null or not defined');\n }\n \n // 1. Let O be ? ToObject(this value).\n var o = Object(this);\n \n // 2. Let len be ? ToLength(? Get(O, \"length\")).\n var len = o.length >>> 0;\n \n // 3. If len is 0, return false.\n if (len === 0) {\n return false;\n }\n \n // 4. Let n be ? ToInteger(fromIndex).\n // (If fromIndex is undefined, this step produces the value 0.)\n var n = fromIndex | 0;\n \n // 5. If n ≥ 0, then\n // a. Let k be n.\n // 6. Else n < 0,\n // a. Let k be len + n.\n // b. If k < 0, let k be 0.\n var k = Math.max(n >= 0 ? n : len - Math.abs(n), 0);\n \n function sameValueZero(x, y) {\n return x === y || (typeof x === 'number' && typeof y === 'number' && isNaN(x) && isNaN(y));\n }\n \n // 7. Repeat, while k < len\n while (k < len) {\n // a. Let elementK be the result of ? Get(O, ! ToString(k)).\n // b. If SameValueZero(valueToFind, elementK) is true, return true.\n if (sameValueZero(o[k], valueToFind)) {\n return true;\n }\n // c. Increase k by 1. \n k++;\n }\n \n // 8. Return false\n return false;\n }\n });\n } \n \n // String.includes() polyfill\n if (!String.prototype.includes) {\n Object.defineProperty(String.prototype, 'includes', {\n value: function(search, start) {\n if (typeof start !== 'number') {\n start = 0\n }\n \n if (start + search.length > this.length) {\n return false\n } else {\n return this.indexOf(search, start) !== -1\n }\n }\n })\n } \n \n // Object.assign() polyfill \n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign\n if (typeof Object.assign !== 'function') {\n // Must be writable: true, enumerable: false, configurable: true\n Object.defineProperty(Object, \"assign\", {\n value: function assign(target, varArgs) { // .length of function is 2\n 'use strict';\n if (target === null || target === undefined) {\n throw new TypeError('Cannot convert undefined or null to object');\n }\n \n var to = Object(target);\n \n for (var index = 1; index < arguments.length; index++) {\n var nextSource = arguments[index];\n \n if (nextSource !== null && nextSource !== undefined) { \n for (var nextKey in nextSource) {\n // Avoid bugs when hasOwnProperty is shadowed\n if (Object.prototype.hasOwnProperty.call(nextSource, nextKey)) {\n to[nextKey] = nextSource[nextKey];\n }\n }\n }\n }\n return to;\n },\n writable: true,\n configurable: true\n });\n } \n }\n}","import truncata from \"../../../../../libraries/truncata/truncata\";\n\nexport default class VideoPage {\n static initialize(UrlPathname) {\n\t\t$( document ).ready(function() {\n if (UrlPathname == '/video'){\n truncata('.video-page__related-video__block__content-header', {lines: 2});\n truncata('.video-page__related-video__block__content-copy', {lines: 3})\n }\n })\n }\n}"],"names":["module","exports","defaults","lines","percentage","decoration","throttlingDelay","dataAttributeName","target","options","els","ctx","settings","API","truncateElements","i","length","elm","content","undefined","dataset","setAttribute","innerHTML","truncateElementContent","width","getBoundingClientRect","style","window","getComputedStyle","font","join","max_parragh_width","measureText","accumulatedSize","founded","split","reduce","acc","cur","arr","size","concat","resizeHandler","event","throttled","setTimeout","destroy","removeEventListener","removeAttribute","merged","Array","prototype","forEach","call","arguments","obj","key","hasOwnProperty","extend","Error","document","querySelectorAll","canvas","createElement","createDocumentFragment","appendChild","getContext","setup","addEventListener","factory","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","n","getter","__esModule","d","a","definition","o","Object","defineProperty","enumerable","get","prop","TrackingMetrics","initialize","$","children","on","trackMetricsObj","type","data","url","this","attr","log","trackMetrics","e","warn","socialType","metricsObj","trackClickInteraction","each","linkObj","find","first","addTrackingToLink","DEBUG","location","href","indexOf","console","apply","name","position","text","linkHref","linkText","formatText","linkParam","bottomMenu","trim","toLowerCase","replace","Modal","constructor","modal_template","onOpen","onClose","custom_open_callback","bind","custom_close_callback","modal_selector","modal_open_class","modal_close_selector","modal_sidebar_close_selector","modal_player_close_selector","is_open","_setupEventListeners","open","close","addClass","append","template","hide","sidebarTemplate","toggleTemplate","fullText","overlay_type","prepend","detach","removeClass","getIsOpen","createBroadcastEventSchema","Storyline","durationISO8601","profileImage","Name","SortDate","StartDate","EndDate","CreatedDate","appendSchema","description","duration","thumbnailUrl","uploadDate","publication","isLiveBroadcast","startDate","endDate","createItemListSchema","scriptText","itemListElement","item","TitleId","itemFormatted","origin","encodeURIComponent","push","contentType","publishedDate","titleConsumer","imageUrl","contentUrl","createVideoObjectSchema","modifiedDate","author","consumerTitleOG","headline","datePublished","dateModified","image","publisher","alternateName","logo","mainEntityOfPage","createArticleSchema","structuredData","scriptEl","getElementById","contentJSON","JSON","parse","textContent","itemListArray","stringify","script","head","SearchFlyout","deviceWidth","apiURL","passedEvent","jqUniversalSearchInput","positionOptions","appendElement","currentOrientation","device","deviceWas","universalSearchIconMoblie","querySelector","universalSearchBar","universalSearchBarClear","from","universalSearchBarClearDesktop","universalSearchBarClearMobile","suggestionsMobileTarget","suggestionDefaultTarget","innerWidth","innerHeight","my","at","of","contentForOrientationChange","runAutoComplete","which","val","searchValue","escape","encodeURI","autocomplete","keyup","classList","add","remove","appendTo","html","delay","source","request","response","elasticsearchEndpoint","drupalSettings","site_env","term","xhr","XMLHttpRequest","withCredentials","onreadystatechange","readyState","res","map","hits","termRegex","RegExp","displayString","_source","substr","label","value","null","setRequestHeader","send","handleObj","css","empty","focus","select","toggle","contains","proto","ui","initSource","_initSource","isArray","array","matcher","escapeRegex","grep","test","_renderItem","ul","jQuery","ModalCarousel","ready","inputData","getAttribute","overlay_img","overlay_copy","overlay_title","overlay_subtitle","vodData","modal_player_template","title","des","custom_options_that_are_not_required","carouselImageArray","carouselImageCopyArrayEscaped","count","img","slick","lazyLoad","dots","customPaging","slider","$slides","nextArrow","prevArrow","infinite","populateOverlayCarousel","alert","modalCreation","FilmDetail","UrlPathname","hash","section","substring","includes","activateSection","pathname","onhashchange","articleId","articleClicked","click","sideNavClicked","hasClass","sectionClicked","readMoreData","settingsSection","scrollTo","metrics","linkTextFormated","interactionlocation","interaction","interactionevent","removeTruncateIfExist","element","truncateOverviewDescription","truncateArticlesTitles","truncateArticlesBodies","truncatePhotosVideoTitles","truncatePhotosVideoBodies","_that","truncata","show","deviceHeight","responsiveChangeCanidate","api_base","tem","ua","M","morePath","inPreview","cookie","consumerTitle","carouselBody","imageLink","imageLinkWindow","linkOne","linkTwo","imageMarkup","body_div","slidesToShow","slidesToScroll","arrows","fade","asNavFor","draggable","focusOnSelect","autoplay","appendArrows","appendDots","ajax","cache","headers","success","tcm","titles","index","imageProfiles","titleID","titleId","error","errorSrc","rightNow","moment","utc","format","archives","id","urlHtml","imagesArray","images","newImagesArray","imageCopyArray","len","myImageUrlsJSON","myimageCopyArray","adConsumerTitle","adCopy","shortAdCopy","oneThirdImage","twoThirdImage","sa1Link","sa2Link","timeStamp","carouselSlides","homeCarousels","homepageCarouselCount","itemType","carouselImage","now","body","dataTitle","editorialTitle","toString","homeAds","firstRoadBlockIndex","secondRoadBlockIndex","is1Roadblocked","is2Roadblocked","filteredArray","sa1Roadblocked","sa2Roadblocked","floor","SA1tries","smallAd","largeAd","adContainer","Math","random","SA1","SA2","adShortCopy","adTitle","gallery","homeGallery","image1","titleEditorialClean","titleEditorial","imageArray","singleDescription","itemImgHttps","cacheStamp","slideLinks","sa1FilteredArray","filter","ad","sa2FilteredArray","sa1Index","findIndex","sa2Index","contentId","splice","imageURL","icid","movieName","releaseYear","usage","isShort","throttle","func","limit","inThrottle","args","loadStickyNav","dailyLineBreaks","mainNav","headerblock","scheduleNav","createStickyNavEle","matchMedia","matches","top","offsetHeight","ele","onscroll","onresize","colType","processedTitle","indexTrending","slice","itemStatus","toLocaleLowerCase","titleCleaned","enterpriseSubNav","enterpriseSubNavMenuItems","menuLenghtArray","link","offsetWidth","stringToBeAppended","loadDailyScheduleFunctionality","isSchemaSet","scheduleClassName","timeZone","searchIsActive","dateToDisplay","cancelSearchBtn","nextElementSibling","timeZoneScheduleBtn","timezoneList","siblings","loader","dynamicContent","clearSearchBtn","emptySearchDiv","totalVodCount","ajaxCall","scheduleContainerMaster","closeTimeZoneModal","resetTimeZoneOverlayMobile","currentScheduleClassName","currentTimeZone","refreshPage","USA","localStorage","getItem","USATable","CAN","CANTable","timeZoneOffset","navElementsArray","currentTimeStamp","toISOString","isCurrentVod","isToday","utcOffset","fullDateYear","dayofWeek","monthString","fullMonthString","monthInt","dayNo","dayNoNoZero","startTime","ampm","country","NetworkFeedCode","Available","urlSlug","Length","isDateAlreadyInNav","date","vodUrlAvalible","status","ReleaseYear","tvGenres","tvRating","Director","Cast","timeout","timeZoneScheduleBtnChg","timez","sched","currentVodScroll","scrollToPoint","currentPlayingVOD","vod","className","pageYOffset","documentElement","behavior","off","stopPropagation","whatChanged","toggleClass","clickedNavElement","headerId","scrollTop","SETTINGS","navBarTravelling","navBarTravelDirection","navBarTravelDistance","pnAdvancerLeft","pnAdvancerRight","pnProductNav","pnProductNavContents","determineOverflow","ticking","container","containerMetrics","containerMetricsRight","right","containerMetricsLeft","left","contentMetrics","contentMetricsRight","contentMetricsLeft","scrollY","requestAnimationFrame","availableScrollLeft","scrollLeft","transform","navBarRightEdge","navBarScrollerRightEdge","availableScrollRight","styleOfTransform","tr","getPropertyValue","amount","abs","parseInt","onkeyup","preventDefault","clearTimeout","sup","listedVODs","vodDateOfSearchReturn","vodDate","vodContainer","playBtn","parentNode","parentElement","urlForTitle","activeElement","timeZoneMoment","todaysDate","emptyDayDiv","itemListSchema","tcmCookiesArray","timeZoneCookieValue","countryCodeCookieValue","correctedOffset","jsDate","Date","trueOffset","startsWith","pop","tz","subtract","guess","isDailyNavHighlight","dayCount","firstSlash","secondSlash","todaysVodCount","dayHasVods","dailyHeader","vodDateOfSearchReturnId","display","table","loadMonthlyScheduleFunctionality","hasDateChanged","itemClose","itemOpen","charAt","ajaxStop","header","truncate","truncateDescriptions","queryString","decodeURIComponent","unescape","search","loadSearchFunctionality","titleLength","peopleLength","dataLength","searchReturnWrap","resultOrResults","fullSearchCountWrap","fullSearchCount","innerText","updateCount","context","parent","sectionfilter","emptySearchReturn","emptySearchReturnTerm","fullSerchTerm","buttonsWrap","fullSearchReturn","fullSearchReturnTitles","fullSearchReturnPeople","fullSearchReturnTitlesAll","fullSearchReturnPeopleAll","method","dataType","jsonpCallback","statusText","replaceWith","done","participants","turner_metadata","synopsis","akaName","AkaName","personId","primaryRole","items","numItems","pagination","itemsOnPage","prevText","nextText","onPageClick","pageNumber","showFrom","showTo","animate","openIn","linkType","linkUrl","landerText","setItem","err","dateTime","hostTypeId","hostType","headerImg","s3Pool","s3Bucket","akamaiPre","hostname","fillInArticles","articleData","articles","heroCount","thisMonthHeroes","anchorLinks","newWindow","imgUrl","articleURLArray","blockOneCount","blockTwoCount","thisMonthBlocks","itemOrder","isArticle","subHeader","teaserText","thisMonthHTM","sort","b","lanesLength","thisMonthLanes","laneCount","contentTypeId","footerAd","thisMonthBanners","max","randomInt","BlocklinkUrl","BlocklinkType","BlockheroNewWindow","BlocklinkText","BlockteaserText","BlocksubHeader","HTMlinkUrl","HTMlinkType","HTMheroNewWindow","HTMlinkText","ribbon","closeRibbonBtn","v","match","days","setTime","getTime","toGMTString","setCookie","toStr","isCallable","maxSafeInteger","toLength","predicate","TypeError","thisArg","k","kValue","fn","pow","number","Number","isNaN","isFinite","toInteger","min","arrayLike","T","mapFn","A","valueToFind","fromIndex","x","y","String","start","assign","varArgs","to","nextSource","nextKey","writable","configurable","height","navigator","browserSpecs","userAgent","version","exec","appName","appVersion","modal"],"sourceRoot":""}