Honkai Star Rail Penacony Food Fest event: Recipes, rewards, locations, and complete guide

March 18, 2024

The Penacony Food Fest marks the final event of the Honkai Star Rail version 2.0 update. During the event, players will have to obtain several in-game materials and submit them to the event vendor, Jay, to obtain various rewards such as Stellar Jades, Credits, and Traveler’s Guide. The Penacony Food Fest consists of seven stages, each of which is unlocked daily.

For those curious, this article covers the necessary ingredients and their locations for each Penacony Food Fest recipe, as well as the rewards for each level in Honkai Star Rail.


Penacony Food Fest Interwoven Dreams in Honkai Star Rail: Ingredients, location, and rewards

The Interwoven Dreams stage (Image via HoYoverse)” srcset=”https://static.beescdn.com/recipes4men.com/2024/03/20240312150136310.jpg?w=190 190w, https://static.beescdn.com/recipes4men.com/2024/03/20240312150136310.jpg?w=720 720w, https://static.beescdn.com/recipes4men.com/2024/03/20240312150136310.jpg?w=840 840w, https://static.beescdn.com/recipes4men.com/2024/03/20240312150136310.jpg?w=1045 1045w, https://static.beescdn.com/recipes4men.com/2024/03/20240312150136310.jpg?w=1200 1200w, https://static.beescdn.com/recipes4men.com/2024/03/20240312150136310.jpg?w=1460 1460w, https://static.beescdn.com/recipes4men.com/2024/03/20240312150136310.jpg?w=1600 1600w, https://static.beescdn.com/recipes4men.com/2024/03/20240312150136310.jpg 1920w”>
The Interwoven Dreams stage (Image via HoYoverse)

The Penacony Food Fest’s first stage features Interwoven Dreams, in which you are required to submit the following in-game materials to start the shipping process of the item.

  • 2x Rusty Gear
  • 1x Core of Ice

To obtain Rusty Gears, you can defeat the Dreamjolt Troupe’s Mr. Domescreen or other adversaries located in The Reverie Hotel. You can also purchase the item from Ferdinand in Oti Mall with Credits.

As for Core of Ice, defeat Everwinter Shadewalkers and other similar enemies in Corridor of Fading Echoes. You can also purchase this ingredient from the Administrative District Shop for 390 Credits.

After the shipping process finishes, you will be able to obtain the following items as a reward for completing the stage:

  • 70x Stellar Jades
  • 3x Traveler’s Guide
  • 1x Hundred-Layer Sundae (Zero Calories)
  • 40,000 Credits

Penacony Food Fest Sour Dreams Candy in Honkai Star Rail: Ingredients, location, and rewards

The Sour Dreams Candy stage (Image via HoYoverse)” srcset=”https://static.beescdn.com/recipes4men.com/2024/03/20240312150201928.jpg?w=190 190w, https://static.beescdn.com/recipes4men.com/2024/03/20240312150201928.jpg?w=720 720w, https://static.beescdn.com/recipes4men.com/2024/03/20240312150201928.jpg?w=840 840w, https://static.beescdn.com/recipes4men.com/2024/03/20240312150201928.jpg?w=1045 1045w, https://static.beescdn.com/recipes4men.com/2024/03/20240312150201928.jpg?w=1200 1200w, https://static.beescdn.com/recipes4men.com/2024/03/20240312150201928.jpg?w=1460 1460w, https://static.beescdn.com/recipes4men.com/2024/03/20240312150201928.jpg?w=1600 1600w, https://static.beescdn.com/recipes4men.com/2024/03/20240312150201928.jpg 1920w”>
The Sour Dreams Candy stage (Image via HoYoverse)

The second stage of Penacony Food Fest, Sour Dreams Candy, will require players to submit the ingredients listed in the section below:

  • 1x Old Molar
  • 1x Virtual Particle

To acquire Old Molar, you will need to defeat Dreamjolt Troupe’s Mr. Domescreen and other opponents in The Reverie Hotel or purchase it from Ferdinand.

Buy Virtual Particles from the Grocery Store Owner located in Central Starskiff Haven or defeat Baryons or other similar enemies in the Storage Zone of the Herta Space Station.

Completing the stage will allow players to obtain the following rewards in Honkai Star Rail:

  • 70x Stellar Jades
  • 3x Traveler’s Guide
  • 1x “Sour Dreams” Soft Candy
  • 40,000 Credits

Penacony Food Fest Stargazer Layer Cake in Honkai Star Rail: Ingredients, location, and rewards

The Stargazer Layer Cake stage (Image via HoYoverse)” srcset=”https://static.beescdn.com/recipes4men.com/2024/03/20240312150226679.jpg?w=190 190w, https://static.beescdn.com/recipes4men.com/2024/03/20240312150226679.jpg?w=720 720w, https://static.beescdn.com/recipes4men.com/2024/03/20240312150226679.jpg?w=840 840w, https://static.beescdn.com/recipes4men.com/2024/03/20240312150226679.jpg?w=1045 1045w, https://static.beescdn.com/recipes4men.com/2024/03/20240312150226679.jpg?w=1200 1200w, https://static.beescdn.com/recipes4men.com/2024/03/20240312150226679.jpg?w=1460 1460w, https://static.beescdn.com/recipes4men.com/2024/03/20240312150226679.jpg?w=1600 1600w, https://static.beescdn.com/recipes4men.com/2024/03/20240312150226679.jpg 1920w”>
The Stargazer Layer Cake stage (Image via HoYoverse)

In the Penacony Food Fest Stargazer layer Cake stage, you need to submit the ingredients listed in the section below:

  • 2x Rusty Gear
  • 2x Basic Ingredients

The Rusty Gear can be obtained from defeating Dreamjolt Troupe’s Mr. Domescreen or similar opponents in The Reverie Hotel. You can also obtain this by sending your Harmony and Erudition characters on .

Basic Ingredients can be purchased from the Administrative District Shop and can be found in the destructible objects in the Herta Space Station. Completing the Stargazer layer Cake stage will allow you to obtain the following rewards:

  • 70x Stellar Jades
  • 3x Traveler’s Guide
  • 1x Sliced Cake Stargazer
  • 40,000 Credits

Penacony Food Fest Sweet Dreams SoulGlad in Honkai Star Rail: Ingredients, location, and rewards

The Sweet Dreams SoulGlad stage (Image via HoYoverse)” srcset=”https://static.beescdn.com/recipes4men.com/2024/03/20240312150255114.jpg?w=190 190w, https://static.beescdn.com/recipes4men.com/2024/03/20240312150255114.jpg?w=720 720w, https://static.beescdn.com/recipes4men.com/2024/03/20240312150255114.jpg?w=840 840w, https://static.beescdn.com/recipes4men.com/2024/03/20240312150255114.jpg?w=1045 1045w, https://static.beescdn.com/recipes4men.com/2024/03/20240312150255114.jpg?w=1200 1200w, https://static.beescdn.com/recipes4men.com/2024/03/20240312150255114.jpg?w=1460 1460w, https://static.beescdn.com/recipes4men.com/2024/03/20240312150255114.jpg?w=1600 1600w, https://static.beescdn.com/recipes4men.com/2024/03/20240312150255114.jpg 1920w”>
The Sweet Dreams SoulGlad stage (Image via HoYoverse)

To complete the fourth stage, Sweet Dreams SoulGlad, submit the following ingredients:

  • 1x Old Molar
  • 2x Solid Water

Old Molar can be obtained from Daily Assignments or purchased from Ferdinand. As for Solid Water, defeat Baryons in the Storage Zone of the Herta Space Station. You can also purchase it from the Administrative District Shop.

Finishing the stage will allow you to obtain the rewards detailed in the section below:

  • 70x Stellar Jades
  • 3x Traveler’s Guide
  • 1x Classic SoulGlad
  • 40,000 Credits

Penacony Food Fest Cheers! My Friend in Honkai Star Rail: Ingredients, location, and rewards

The Cheers! My Friend stage (Image via HoYoverse)” srcset=”https://static.beescdn.com/recipes4men.com/2024/03/20240312150320917.jpg?w=190 190w, https://static.beescdn.com/recipes4men.com/2024/03/20240312150320917.jpg?w=720 720w, https://static.beescdn.com/recipes4men.com/2024/03/20240312150320917.jpg?w=840 840w, https://static.beescdn.com/recipes4men.com/2024/03/20240312150320917.jpg?w=1045 1045w, https://static.beescdn.com/recipes4men.com/2024/03/20240312150320917.jpg?w=1200 1200w, https://static.beescdn.com/recipes4men.com/2024/03/20240312150320917.jpg?w=1460 1460w, https://static.beescdn.com/recipes4men.com/2024/03/20240312150320917.jpg?w=1600 1600w, https://static.beescdn.com/recipes4men.com/2024/03/20240312150320917.jpg 1920w”>
The Cheers! My Friend stage (Image via HoYoverse)

Cheers! My Friends, the fifth stage of the Penacony Food Fest, will require you to turn in the materials detailed in the section below:

  • 1x Thermal Gel
  • 2x Basic Ingredients

You can also acquire Thermal Gel by defeating the Dreamjolt Troupe’s Mr. Domescreen or other similar opponents in The Reverie Hotel. It is also available for purchase from Ferdinand located in Oti Mall in Golden Hour.

As mentioned earlier, basic ingredients can be obtained from the destructible objects in the Herta Space Station.

Send the food to acquire the following rewards:

  • 70x Stellar Jades
  • 3x Traveler’s Guide
  • 1x Mr. Herring’s Lemon Tart
  • 40,000 Credits

Penacony Food Fest Single-Serving Clockie Pizza in Honkai Star Rail: Ingredients, location, and rewards

The Single-Serving Clockie Pizza stage (Image via HoYoverse)” srcset=”https://static.beescdn.com/recipes4men.com/2024/03/20240312150345303.jpg?w=190 190w, https://static.beescdn.com/recipes4men.com/2024/03/20240312150345303.jpg?w=720 720w, https://static.beescdn.com/recipes4men.com/2024/03/20240312150345303.jpg?w=840 840w, https://static.beescdn.com/recipes4men.com/2024/03/20240312150345303.jpg?w=1045 1045w, https://static.beescdn.com/recipes4men.com/2024/03/20240312150345303.jpg?w=1200 1200w, https://static.beescdn.com/recipes4men.com/2024/03/20240312150345303.jpg?w=1460 1460w, https://static.beescdn.com/recipes4men.com/2024/03/20240312150345303.jpg?w=1600 1600w, https://static.beescdn.com/recipes4men.com/2024/03/20240312150345303.jpg 1920w”>
The Single-Serving Clockie Pizza stage (Image via HoYoverse)

To complete the Single-Serving Clockie Pizza stage, submit the following in-game materials:

  • 2x Tranquility
  • 2x Phlogiston

You can acquire Tranquility by defeating the Memory Zone Meme “Allseer” in The Reverie Hotel. It can also be obtained from the Daily Assignments.

Phlogiston can be obtained by defeating the Flamespawns or other similar enemies in Backwater Pass in Honkai Star Rail. Those who don’t want to defeat the enemies to obtain the material can also purchase it from the Administrative District Shop.

After completing the stage, you will be able to obtain the following rewards:

  • 70x Stellar Jades
  • 3x Traveler’s Guide
  • 1x Clockie Pizza (Single Slice)
  • 40,000 Credits

Penacony Food Fest Assorted Flavors Dreamy Candy in Honkai Star Rail: Ingredients, location, and rewards

The Assorted Flavors Dreamy Candy stage (Image via HoYoverse)” srcset=”https://static.beescdn.com/recipes4men.com/2024/03/20240312150410614.jpg?w=190 190w, https://static.beescdn.com/recipes4men.com/2024/03/20240312150410614.jpg?w=720 720w, https://static.beescdn.com/recipes4men.com/2024/03/20240312150410614.jpg?w=840 840w, https://static.beescdn.com/recipes4men.com/2024/03/20240312150410614.jpg?w=1045 1045w, https://static.beescdn.com/recipes4men.com/2024/03/20240312150410614.jpg?w=1200 1200w, https://static.beescdn.com/recipes4men.com/2024/03/20240312150410614.jpg?w=1460 1460w, https://static.beescdn.com/recipes4men.com/2024/03/20240312150410614.jpg?w=1600 1600w, https://static.beescdn.com/recipes4men.com/2024/03/20240312150410614.jpg 1920w”>
The Assorted Flavors Dreamy Candy stage (Image via HoYoverse)

After completing the previous six stages, you will be able to submit the following rewards to complete the seventh stage, Assorted Flavors Dreamy Candy:

  • 2x Broken Dreams
  • 1x Virtual Particles

Broken Dreams can be obtained from any destructible objects in Penacony, Daily Assignments, and defeating the Memory Zone Meme “All seer” in The Reverie Hotel.

As mentioned earlier, Virtual Particles can be obtained by defeating Baryons in the Storage Zone or by breaking destructible objects in the Herta Space Station.

You will obtain the following rewards upon completing the seventh stage:

  • 70x Stellar Jades
  • 3x Traveler’s Guide
  • 1x “Dreamlight” Mixed Sweets
  • 40,000 Credits

After completing the event, you will receive a delicately wrapped letter from Pom-Pom that contains a message expressing her gratitude.


Check out more Honkai Star Rail articles:

|| ||

function KeedaCarousalControlsHelper(input) {
var self = this;
this.target = input.target;
this.whenCarouselInViewport = input.whenCarouselInViewport;
this.whenCarouselNotInViewport = input.whenCarouselNotInViewport;
this.whenFistItemInViewport = input.whenFistItemInViewport;
this.whenFistItemNotInViewport = input.whenFistItemNotInViewport;
this.whenLastItemInViewport = input.whenLastItemInViewport;
this.whenLastItemNotInViewport = input.whenLastItemNotInViewport;
this.options = input.intersectionObserverOptions || {
threshold: 1
};
}
KeedaCarousalControlsHelper.prototype.observeTarget = function() {
var self = this;
var firstItem = this.target.firstElementChild;
var lastItem = this.target.lastElementChild;
var allChildren = this.target.children;
var firstItem, lastItem;
for (var i = 0; i < allChildren.length; i++) { if (!allChildren[i].classList.contains("hidden")) { firstItem = allChildren[i]; break; } } for (var i = allChildren.length - 1; i >= 0; i–) {
if (!allChildren[i].classList.contains(“hidden”)) {
lastItem = allChildren[i];
break;
}
}
this.firstItemObserver = new IntersectionObserver(function(entries) {
entries.forEach(function(entry) {
if (entry.isIntersecting) {
self.whenFistItemInViewport(entry);
} else {
self.whenFistItemNotInViewport(entry);
}
})
}, this.options);
this.lastItemObserver = new IntersectionObserver(function(entries) {
entries.forEach(function(entry) {
if (entry.isIntersecting) {
self.whenLastItemInViewport(entry);
} else {
self.whenLastItemNotInViewport(entry);
}
})
}, this.options);
firstItem && this.firstItemObserver.observe(firstItem);
lastItem && this.lastItemObserver.observe(lastItem);
if (typeof self.whenCarouselInViewport == “function” && typeof self.whenCarouselNotInViewport == “function”) {
this.carouselObserver = new IntersectionObserver(function(entries) {
entries.forEach(function(entry) {
if (entry.isIntersecting) {
self.whenCarouselInViewport(entry);
} else {
self.whenCarouselNotInViewport(entry);
}
})
}, {
threshold: 1
});
this.carouselObserver.observe(this.target);
}
return this;
}
KeedaCarousalControlsHelper.prototype.unobserveTarget = function() {
if (this.carouselObserver) {
this.carouselObserver.disconnect();
}
if (this.firstItemObserver) {
this.firstItemObserver.disconnect();
}
if (this.lastItemObserver) {
this.lastItemObserver.disconnect();
}
return this;
}
KeedaCarousalControlsHelper.prototype.reset = function() {
return this.unobserveTarget().observeTarget();
}

Quick Links

image

image

var scrollableMenuLength = “1”;
var isMenuFromExplore = false;
function initScrollableMenu() {
if (scrollableMenuLength > 0) {
var pnProductNav = $(“#pnProductNav”);
var pnProductNavContents = $(“#pnProductNavContents”);
// Out advancer buttons
var pnAdvancerLeft = $(“#pnAdvancerLeft”);
var pnAdvancerRight = $(“#pnAdvancerRight”);
var scrollAmount = 0;
var scrollMin = 0
var scrollMax = pnProductNavContents.clientWidth;
pnAdvancerRight.onclick = function() {
pnProductNav.scrollTo({
top: 0,
left: Math.max(scrollAmount += 240, scrollMax),
behavior: ‘smooth’
});
};
pnAdvancerLeft.onclick = function() {
pnProductNav.scrollTo({
top: 0,
left: Math.max(scrollAmount -= 240, scrollMin),
behavior: ‘smooth’
});
};
new KeedaCarousalControlsHelper({
target: pnProductNavContents,
whenFistItemInViewport: function(entry) {
pnAdvancerLeft.style.display = “none”;
},
whenFistItemNotInViewport: function(entry) {
pnAdvancerLeft.style.display = “inline-block”;
},
whenLastItemInViewport: function(entry) {
pnAdvancerRight.style.display = “none”;
},
whenLastItemNotInViewport: function(entry) {
pnAdvancerRight.style.display = “inline-block”;
}
}).observeTarget();
}
}
var topOfDropDown = ”;
function toggleWikiDropDown(slug, level, tag, flag, fromExplore) {
var node = $(“#” + slug);
if (!node) {
return;
}
if (hasClass(node, “hidden”)) {
showDropDown(slug, level, tag, flag, fromExplore);
} else {
closeAllDropDown();
}
}
function setDropDownPosition(element) {
var WIKI_HEADER_HEIGHT = 150;
if (window.scrollY > WIKI_HEADER_HEIGHT) {
element.style.position = “fixed”;
element.style.top = “50px”;
} else if (window.scrollY < WIKI_HEADER_HEIGHT) { element.style.position = "absolute"; element.style.top = "236px"; } } function showDropDown(slug, level, tag, flag, fromExplore) { var nodeId = "#" + slug; var dropDownNode = $(nodeId); if (!dropDownNode) { return; } var rec = tag.parentNode.getBoundingClientRect(); isMenuFromExplore = fromExplore == null ? isMenuFromExplore : fromExplore; closeAllDropDown(); updateMenu(nodeId); if (flag && (level == 0 || level == -1)){ level == 0 ? tag.lastChild.style.transform = "rotate(180deg) scale(1.5)" : true; topOfDropDown = rec.top + window.scrollY + 35 + "px"; } setDropDownPosition(dropDownNode); $('body').appendChild(dropDownNode); dropDownNode.classList.remove("hidden"); } function updateMenu(nodeId) { node = $(nodeId).querySelector('#back-block-0'); if (isMenuFromExplore && $(nodeId).getAttribute('data-level') == '0') { node.classList.remove('hidden'); } else if (!isMenuFromExplore && $(nodeId).getAttribute('data-level') == '0') { node.classList.add('hidden'); } } window.addEventListener("DOMContentLoaded", function() { document.addEventListener('click', function(e) { if (e.target.className != 'drop-down-icon' && e.target.className != 'explore-icon' && e.target.className != 'back-block' && e.target.className != 'wiki-submenu-item' && e.target.className != 'wiki-menu-toggle' ) { closeAllDropDown(); } }) }); function closeAllDropDown() { var nodes = $all(".drop-down-menu"); var menu = $all(".wiki-menu-item .drop-down-icon"); if (menu && menu.length) { for(var i = 0; i < menu.length; i++) { menu[i].style.transform = "scale(1.5)"; } } if (nodes && nodes.length) { for(var i = 0; i < nodes.length; i++) { nodes[i].classList.add("hidden"); } } } function trackScrollableMenuClick(name, pageType) { if (!gtag || !name) return; ga_event('Tag Cloud Click', 'Mobile', name); // older event, keeping it for legacy purposes gtag('event', 'click', { "event_category": pageType, "event_label": name }); } (function() { if (typeof initScrollableMenu === "function") { initScrollableMenu(); } })();

Edited by Abu Amjad Khan

(function() {
var maxScrollCaptured = 0;
var eventTriggered = false;
var gaScrollObject = {
‘event_label’: “percentage_scrolled”
}
var sessionCookieValue = getCookie(“keeda-session-uuid”);
if (sessionCookieValue) {
gaScrollObject[‘keeda-session-uuid’] = sessionCookieValue;
}
var userID = getCookie(“fw_ID”);
if (userID) {
gaScrollObject[‘loggedIn_user_id’] = userID;
}
function calculateScrollDepth() {
var targetEle = document.getElementById(“in-house-ads”);
gaScrollObject[‘event_category’] = “article_read_depth”;
gaScrollObject[“post_id”] = “1901149”;
gaScrollObject[‘content_total_pages’] = “1”;
gaScrollObject[‘content_current_page’] = “1”;
if (!targetEle) return;
var scrollDepth = window.scrollY.toFixed(2);
var targetScrollHeight = targetEle.offsetTop.toFixed(2);
var percentageScrolled = (100 – ((targetScrollHeight-scrollDepth)/targetScrollHeight)*100).toFixed(2);
if (percentageScrolled > 100) {
percentageScrolled = 100;
}
if (maxScrollCaptured < percentageScrolled) { maxScrollCaptured = percentageScrolled; } if (!eventTriggered && maxScrollCaptured == 100) { sendPageDepthScrollGAEvent(); window.removeEventListener('pagehide', recalculateDepthAndSendGAEvent); eventTriggered = true; } } function sendPageDepthScrollGAEvent() { gaScrollObject["scrolled_depth"] = Math.round(maxScrollCaptured); gtag('event', 'scroll', gaScrollObject); } var timeoutScroll = 0; function articleDepthDebounce(fn, delay) { clearTimeout(timeoutScroll); timeoutScroll = setTimeout(fn, delay); } function recalculateDepthAndSendGAEvent() { calculateScrollDepth(); sendPageDepthScrollGAEvent(); } document.addEventListener('scroll', function(e) { articleDepthDebounce(calculateScrollDepth, 100); }) window.addEventListener('pagehide', recalculateDepthAndSendGAEvent); })(); (function(){ var pageType = "Articlepage"; var pageLoadedTime = Date.now(); var postId = "1901149"; var timeSpentHandlerLoaded = false; function loadTimeSpentHandler() { if (timeSpentHandlerLoaded) return; timeSpentHandlerLoaded = true; function timeSpentHandler() { var timeSpentDifference = Date.now() - pageLoadedTime; var timeSpentSeconds = Math.floor(timeSpentDifference/1000); var payload = { "transport_type": "beacon", "time_spent_seconds": timeSpentSeconds }; var sessionCookieValue = getCookie("keeda-session-uuid"); if (sessionCookieValue) { payload['keeda-session-uuid'] = sessionCookieValue; } if (postId && (pageType == "Articlepage" || pageType == "slideshow" || pageType == "Singlepageslideshow")) { payload["post_id"] = postId; gtag("event", "time_spent_on_article", payload); } else if (pageType == "Homepage") { payload["device"] = IS_MOBILE ? "Mobile" : "Desktop"; gtag("event", "time_spent_on_homepage", payload); } else if (pageType == "wikipage" || pageType == "WikiHomepage" || pageType == "wiki_tagpage") { payload["wiki_page"] = window.location.href; payload["page_id"] = ""; payload["wiki_lang"] = ""; gtag("event", "time_spent_on_wikipage", payload); } else if (pageType == "Tagpage" || pageType == "playerpage" || pageType == "teampage" || pageType == "Eventpage" || "") { payload["tag_page"] = window.location.href; payload["page_id"] = ""; gtag("event", "time_spent_on_staticpage", payload); } } document.addEventListener("visibilitychange", function() { if (document.visibilityState === "visible") { pageLoadedTime = Date.now(); } else { timeSpentHandler(); } }); } document.addEventListener("scroll", loadTimeSpentHandler, { once: true }); document.addEventListener("mousemove", loadTimeSpentHandler, { once: true }); document.addEventListener("touchmove", loadTimeSpentHandler, { once: true }); })(); var trackedClick = false; function trackBelowContentFeedClick(event) { if(trackedClick) { return true; } var clickedElement = event.target; while(!!clickedElement.parentNode) { if(hasClass(clickedElement, "story-wrapper")) { trackedClick = true; gtag('event', 'click', { 'event_category': "All Sports_Articles_Related Articles_Below Article_Desktop_17March2021", 'event_label': Array.prototype.indexOf.call(clickedElement.parentNode.getElementsByClassName("story-wrapper"), clickedElement) + 1, 'non_interaction': true }); return true; } clickedElement = clickedElement.parentNode; } return true; } if ($(".comments-total-container")) { $(".comments-total-container").addEventListener("click", function () { var gaObject = { 'event_category': "Comments", 'event_label': "No_of_comments", } var sessionCookieValue = getCookie("keeda-session-uuid"); if (sessionCookieValue) { gaObject['keeda-session-uuid'] = sessionCookieValue; } var userID = getCookie("fw_ID"); if (userID) { gaObject['loggedIn_user_id'] = userID; } gtag('event', 'click', gaObject); }) } if ($(".comments-total-container-bottom")) { $(".comments-total-container-bottom").addEventListener("click", function () { var gaObject = { 'event_category': "Comments", 'event_label': "No_of_comments_bottom", } var sessionCookieValue = getCookie("keeda-session-uuid"); if (sessionCookieValue) { gaObject['keeda-session-uuid'] = sessionCookieValue; } var userID = getCookie("fw_ID"); if (userID) { gaObject['loggedIn_user_id'] = userID; } gtag('event', 'click', gaObject); }) } document.addEventListener("click", trackBelowContentFeedClick.bind(this)); var followButtons = $all('.btn-follow'); var followButtons = $all('.follow-btn'); var authorId; var source; /* for user profile page */ function displayFollowContent() { addClass($('.follow-pc'),'hidden'); removeClass($('.follow-content .author-profile-info'), 'hidden'); removeClass($('.follow-content .follow-author'),'hidden'); } function followCallback (resp) { data = JSON.parse(resp); displayFollowContent(); for(i=0;i 0) ? userName.substring(0, userName.indexOf(' ')) : userName; if (myUserId) { var ths = this; var action = 'follow'; if(ths.innerText == "Following") { action = 'un-follow'; } pureJSAjaxPut('https://a-login.sportskeeda.com/en/user/' + authorId + '/' + action,'{}', function (resp) { data = JSON.parse(resp); if (data.status == true) { flipFollowStatus(action); if (source == 'profile') { getFollowsCount(); } if(action == 'follow') { showMessage("Hey! You've just followed “+firstName+”. We will notify you when they publish new content.”);
}
gtag(‘event’, action, {
‘event_category’: ‘FOLLOW’,
‘event_label’: source,
‘non_interaction’: true
});
} else {
var actionRevert = (action == ‘follow’) ? ‘un-follow’ : ‘follow’;
flipFollowStatus(actionRevert);
}
},
function (error) {
console.log(error);
var actionRevert = (action == ‘follow’) ? ‘un-follow’ : ‘follow’;
flipFollowStatus(actionRevert);
}
);
flipFollowStatus(action);
} else {
window.location = (‘/login?after-login=’ + window.location.href );
}
};
function setAdFloatingParams() {
if ($(“.rightStickyTopWrap”) && $(‘.fragments-container’)) {
$(“.rightStickyTopWrap”).style.height = ($(‘.fragments-container’).clientHeight – 44) + “px”;
}
}
setInterval(function() {
setAdFloatingParams();
}, 2000);
window.addEventListener(“load”, setAdFloatingParams.bind(this));
window.addEventListener(“DOMContentLoaded”, function() {
var trackCopyURL = “https://a-login.sportskeeda.com/en” + “/track-events”;
document.addEventListener(“scroll”, addevents_youtube_embeds.bind(this));
document.addEventListener(“mousemove”, addevents_youtube_embeds.bind(this));
document.addEventListener(‘copy’, logCopyEvent.bind(this));
function addevents_youtube_embeds() {
var youtube = document.getElementsByClassName(“youtube”);
for (var i = 0; i < youtube.length; i++) { var ytURL = youtube[i].dataset.embed; var youtubeWrapper = youtube[i].parentElement; var youtubeCoverImg = youtube[i].getElementsByTagName("img")[0]; var iframe = document.createElement( "iframe" ); iframe.setAttribute( "width", youtubeCoverImg.width ); iframe.setAttribute( "height", youtubeCoverImg.height ); iframe.setAttribute( "src", "https://www.youtube.com/embed/"+ ytURL); iframe.setAttribute( "frameborder", "0" ); iframe.setAttribute( "allowfullscreen", ""); youtubeWrapper.innerHTML = ""; youtubeWrapper.appendChild( iframe ); }; var iframeEmbeds = document.getElementsByClassName("iframe-embeds"); for (var i = 0; i < iframeEmbeds.length; i++) { var iframeSRC = iframeEmbeds[i].dataset.embed; var aspectRatio = iframeEmbeds[i].dataset.aspectratio; var height = iframeEmbeds[i].dataset.height; var source = iframeEmbeds[i].dataset.source; var allowValue = iframeEmbeds[i].dataset.allow; var iframeWrapper = iframeEmbeds[i].parentElement; var iframe = document.createElement( "iframe" ); iframe.setAttribute( "width", "100%"); if(aspectRatio) { iframe.setAttribute( "style", "height: calc(" + iframeEmbeds[i].clientWidth + "px * " + aspectRatio + ")"); } else if (height) { iframe.setAttribute("style", "height: "+ height + "px"); } iframe.setAttribute( "src", iframeSRC); iframe.setAttribute( "frameborder", "0" ); iframe.setAttribute( "allowfullscreen", ""); if (allowValue) { iframe.setAttribute("allow", allowValue); } if (source && iframeWrapper.parentElement) { iframeWrapper.parentElement.classList.add(source); } iframeWrapper.innerHTML = ""; iframeWrapper.appendChild( iframe ); } } function logCopyEvent() { var payload = { event_type: "copy", post_id: 1901149 }; pureJSAjaxPost(trackCopyURL, payload, function() {}, function () { console.error('Failed to save copy event'); }, null, true); } }); (function() { var followUsCTA = $(".follow-us-cta"); function followUsGoogleNews(){ if (!followUsCTA) return; var st = window.pageYOffset || document.documentElement.scrollTop; if ( st < 0 ) { st = 0; } if ( st > 300 ) {
followUsCTA.classList.remove(“hidden”);
} else {
followUsCTA.classList.add(“hidden”);
}
}
window.addEventListener(“scroll”, followUsGoogleNews);
})();
var followUsCTAs = $all(“.follow-action”);
for (var i = 0; i < followUsCTAs.length; i++) { followUsCTAs[i].addEventListener("click", function(e) { var element = e.currentTarget; var elementClass = element.getAttribute("class"); var payload = { "title": document.title, "category": "esports" || "honkai-star-rail-penacony-food-fest-event-recipes-rewards-locations-complete-guide", "device": "Desktop" } if (elementClass.includes("follow-us-cta")) { payload["position"] = "header"; } else if (elementClass.includes("follow-action-bottom")) { payload["position"] = "bottom"; } else { payload["position"] = "top"; } gtag("event", "Follow_Us", payload); }); } (function() { var article_sponserd_links = $all(".sponsored_link"); for (var i = 0; i < article_sponserd_links.length; i++) { article_sponserd_links[i].addEventListener("click", function(element) { var sportCategory = "esports" || "honkai-star-rail-penacony-food-fest-event-recipes-rewards-locations-complete-guide"; var isDesktop = "1"; var payload = { "sponsed_link": element.target.href, "sponsed_link_text": element.target.innerHTML, "page_url": window.location.href, "category": sportCategory, } if (isDesktop) { payload["device"] = "Desktop" } else { payload["device"] = "Mobile" } gtag("event", "Article_Sponsered_Link_Click", payload); }); } var bottom_tagline_links = document.querySelectorAll('.bottom_tagline_link'); for (var i = 0; i < bottom_tagline_links.length; i++) { bottom_tagline_links[i].addEventListener('click', trackBottomTaglineClickEvent.bind(this)); } var bottom_tagline_video_links = document.querySelectorAll('.bottom-tagline-video-link'); for (var i = 0; i < bottom_tagline_video_links.length; i++) { bottom_tagline_video_links[i].addEventListener('click', trackBottomTaglineClickEvent.bind(this)); } function trackBottomTaglineClickEvent(element) { var taglinePosition = element.currentTarget.getAttribute("data-tab"); var taglineUrl = element.currentTarget.getAttribute("href"); var payload = { "tagline_position": taglinePosition, "destination_url": taglineUrl } trackGAEvent("Clicks_BottomTagline", payload); } var bottom_tagline_text_container = document.querySelectorAll('.bottom-tagline'); for (var i = 0; i < bottom_tagline_text_container.length; i++) { trackBottomTaglineImpression(bottom_tagline_text_container[i]); } var bottom_tagline_video_container = document.querySelectorAll('.bottom-tagline-video'); for (var i = 0; i < bottom_tagline_video_container.length; i++) { trackBottomTaglineImpression(bottom_tagline_video_container[i]); } var bottom_tagline_promo_container = document.querySelectorAll('.bottom-tagline-banner'); for (var i = 0; i < bottom_tagline_promo_container.length; i++) { trackPromoBannerImpression(bottom_tagline_promo_container[i]); var bannerLink = bottom_tagline_promo_container[i].querySelector('.bottom-tagline-banner-link'); if (bannerLink) { bannerLink.addEventListener('click', trackPromoBannerClickEvent); } } function trackPromoBannerClickEvent(e) { var target = e.target.closest(".bottom-tagline-banner-link"); if (!target) return; var taglinePosition = target.getAttribute("data-tab"); var taglineUrl = target.getAttribute("href"); trackGAEvent("TAGLINE_CLICK", { "position": taglinePosition, "variant": "promo-banner", "destination_url": taglineUrl }); } function trackBottomTaglineImpression(element) { var taglinePosition = element.getAttribute("data-tab"); trackImpressionGAEventWhenInViewport({ element: element, identifier: "element_" + taglinePosition, eventName: "Tagline_Impression", eventParams: { "tagline_position": taglinePosition, } }); } function trackPromoBannerImpression(element) { var taglinePosition = element.getAttribute("data-tab"); trackImpressionGAEventWhenInViewport({ element: element, identifier: "tagline_promo_banner_" + taglinePosition, eventName: "TAGLINE_IMPRESSION", eventParams: { "position": taglinePosition, "variant": "promo-banner", } }); } // this will fire ga event on anchor tag clicks in article page var hyperLinks = $all("#article-content p a, #article-content table a"); for (var i = 0; i < hyperLinks.length; i++) { var hyperLink = hyperLinks[i]; hyperLink.addEventListener("click", sendHyperlinkClickedGAEvent); } function sendHyperlinkClickedGAEvent() { trackGAEvent("Clicks_hyperlinks", { destURL: this.href, }); } })(); (function() { var spotifyMonitor = setInterval(function() { var elem = document.activeElement; if (elem && elem.tagName == "IFRAME") { var src = elem.getAttribute("src"); if (src && src.indexOf("open.spotify.com") > -1) {
clearInterval(spotifyMonitor);
gtag(“event”, “ARTICLE_EMBED_CLICK__SPOTIFY”, {
link: window.location.href
});
}
}
}, 100);
})();
(function() {
function lazyTweetLoader() {
var twitterEmbeds = document.querySelectorAll(“.hidden-lazy”);
var intersectionObserverForLazyHidden = new IntersectionObserver(
function(entries) {
entries.forEach(function(entry) {
if (entry.isIntersecting) {
var verifiedElement = entry.target.querySelector(“.verified”);
removeClass(verifiedElement, “hidden”);
var likeElement = entry.target.querySelector(“.tweet-like-icon”);
removeClass(likeElement, “hidden”);
var retweetElement = entry.target.querySelector(“.tweet-retweet-icon”);
removeClass(retweetElement, “hidden”);
var twitterLogoElement = entry.target.querySelector(“.tweet-logo”);
removeClass(twitterLogoElement, “hidden”);
}
});
}, {
threshold: 0.1
}
);
twitterEmbeds.forEach(function(element) {
intersectionObserverForLazyHidden.observe(element);
});
}
window.addEventListener(“DOMContentLoaded”, function() {
lazyTweetLoader();
});
}());

(function() {
var storyMap = {};
const storyGAObserver = new IntersectionObserver (function (entries) {
entries.forEach(function (story, index) {
if(story.isIntersecting) {
var storyLink = story.target.querySelector(“.list-story-link”);
var storyID = storyLink.getAttribute(“data-id”);
var storyNumber = storyLink.getAttribute(“story-sequence”);
var destination = story.target.querySelector(“.story-link-overlay”).href;
var title = story.target.querySelector(“.block-story-title”).innerText;
trackGAEvent(“MORE_FROM_SK_IMPRESSION”, {
“sequence”: storyNumber,
“destinationURL” : destination,
“destinationTitle” : title
});
story.target.addEventListener(“click”, function() {
trackGAEvent(“MORE_FROM_SK_CLICKS”, {
“sequence”: storyNumber,
“destinationURL” : destination,
“destinationTitle” : title
});
});
storyMap[storyID] = true;
}
storyGAObserver.unobserve(story.target);
});
},
{
threshold: 0.5
});
function observeStoryWrapper() {
var storyWrappers = document.querySelectorAll(“.story-wrapper, .social-story-wrapper”);
storyWrappers.forEach(function(story, index) {
storyLink = story.querySelector(“.list-story-link”);
storyLink.setAttribute(“story-sequence”, index + 1);
storyID = storyLink.getAttribute(“data-id”);
if(!storyMap[storyID]) {
storyGAObserver.observe(story);
}
});
}
window.addEventListener(“DOMContentLoaded”, function() {
document.addEventListener(“scroll”, debounce(observeStoryWrapper, 500) , { passive: true })
});
})();

var taboolaScriptLoaded = false;
window._taboola = window._taboola || [];
_taboola.push({ article: ‘auto’ });
(function() {
var userCountry = getCookie(“country_code”);
var IS_GDPR_APPLICABLE = getCookie(COOKIE_GDPR) == “true”;
if (![“IN”].includes(userCountry)) {
if (window.performance && typeof window.performance.mark == ‘function’) {
window.performance.mark(‘tbl_ic’);
}
var scriptInput = {
src: “https://cdn.taboola.com/libtrc/sportskeedaindia/loader.js”,
loadWithDefer: true,
onUserInteraction: true,
attributes: [{
key: “id”,
value: “tb_loader_script”
}]
};
function loadTaboolaScript() {
if (!taboolaScriptLoaded) {
taboolaScriptLoaded = true;
asyncScriptLoader(scriptInput);
}
}
loadTaboolaScript();
}
})();

_taboola.push({
mode: “thumbnails-a”,
container: “taboola-below-article-thumbnails”,
placement: “Below Article Thumbnails”,
target_type: “mix”
});

window._taboola = window._taboola || [];
_taboola.push({ flush: true });

(function () {
function lazyLoadArticle() {
var lazyImages = $all(‘img.lazy-img’);
for (var i = 0; i < lazyImages.length; i++) { var lazyElement = lazyImages[i]; if (isScrolledIntoView(lazyElement)) { lazyLoadImage(lazyElement); } } } function lazyLoadImage(image) { if(!!image.dataset.srcset) { image.setAttribute("srcset", image.dataset.srcset) } if (screen.width > 500) {
image.src = image.attributes[‘data-img’].value;
}
else {
image.src = image.attributes[‘data-img-low’].value;
}
image.className = image.className.replace(‘lazy-img’, ”);
}
window.lazyLoadImages = lazyLoadArticle;
lazyLoadAll();
lazyLoadArticle();
window.addEventListener(‘scroll’, lazyLoadAll);
window.addEventListener(‘scroll’, lazyLoadArticle);
window.addEventListener(‘load’, lazyLoadAll);
})();

(function() {
var comScoreFired = false;
function lazyLoadComscoreScript() {
if (comScoreFired) {
return;
}
comScoreFired = true;
var _comscore = _comscore || [];
_comscore.push({ c1: “2”, c2: “13438550” });
(function() {
var s = document.createElement(“script”),
el = document.getElementsByTagName(“script”)[0];
s.async = true;
s.src =
(document.location.protocol == “https:”
? “https://sb”
: “http://b”) + “.scorecardresearch.com/beacon.js”;
el.parentNode.insertBefore(s, el);
})();
}
document.addEventListener(“scroll”, lazyLoadComscoreScript, { passive: true, once: true });
document.addEventListener(“mousemove”, lazyLoadComscoreScript, { passive: true, once: true });
document.addEventListener(“touchmove”, lazyLoadComscoreScript, { passive: true, once: true });
})();

/* */

$(‘.message-close’).addEventListener(“click”, function (event) {
addClass($(“.message-card”), ‘hidden’);
addClass($(“.message-background”), ‘hidden’);
});
function showMessage(message) {
removeClass($(“.message-card”), ‘hidden’);
removeClass($(“.message-background”), ‘hidden’);
$(“.message-txt”).innerHTML = message;
setTimeout(function(){
addClass($(“.message-card”), ‘hidden’);
addClass($(“.message-background”), ‘hidden’);
}, 10*1000);
}

var fbPixelFired = false;
var pixelID = “952063904834769”;
document.addEventListener(“scroll”, function() { loadFBPixel() });
document.addEventListener(“mousemove”, function() { loadFBPixel() });
function loadFBPixel() {
if(fbPixelFired) {
return;
}
fbPixelFired = true;
!function(f,b,e,v,n,t,s){if(f.fbq)return;n=f.fbq=function(){n.callMethod?
n.callMethod.apply(n,arguments):n.queue.push(arguments)};if(!f._fbq)f._fbq=n;
n.push=n;n.loaded=!0;n.version=’2.0′;n.queue=[];t=b.createElement(e);t.async=!0;
t.src=v;s=b.getElementsByTagName(e)[0];s.parentNode.insertBefore(t,s)}(window,
document,’script’,’https://connect.facebook.net/en_US/fbevents.js’);
fbq(‘init’, pixelID);
fbq(‘track’, “PageView”);
fbq(‘track’, ‘ViewContent’);
}

var SKTrackingModule = (function () {
var COOKIE_NAME = ‘HP_ALGO_DATA_V2’;
var DATASET_SIZE = 10;
var CLIPPING_SIZE = 100;
function getTrackingCookie(cname, defaultValue) {
var name = cname + “=”;
var ca = document.cookie.split(‘;’);
for(var i = 0; i < ca.length; i++) { var c = ca[i].trim(); if (c.indexOf(name) === 0) { return c.substring(name.length,c.length).trim(); } } return defaultValue; } function setTrackingCookie(cname, cvalue) { document.cookie = cname + '=' + cvalue + ';domain=.sportskeeda.com;path=/;expires=Fri, 31 Dec 9999 23:59:59 GMT'; } function initializeJSONDataStructure (data, key, identifier, title) { if (!data.hasOwnProperty(key) || key == 'sport') { data[key] = []; } data[key].push({ name: identifier, value: "99", title: title }); return data; } function incrementTrackingLogic(item) { var clipAll = false; item['value'] = parseInt(item['value']) + 1; if (item['value'] >= CLIPPING_SIZE) {
item[‘value’] = CLIPPING_SIZE.toString();
var clipAll = true;
} else {
item[‘value’] = item[‘value’].toString();
}
return {
‘value’: item,
‘clipAll’: clipAll
};
}
function clippingMechanism(data, key) {
if (data[key].length >= DATASET_SIZE * 2) {
return data[key].slice(0, DATASET_SIZE);
} else {
return data[key];
}
}
function track(cname, key, identifier, title) {
var data = getTrackingCookie(cname, ‘{}’);
data = JSON.parse(data);
if (!data.hasOwnProperty(key) || key == ‘sport’) {
data = initializeJSONDataStructure(data, key, identifier, title);
} else {
var item = data[key].filter(function(item) {
return item.name == identifier;
});
if (item.length > 0) {
item = item[0];
var incrementResponse = incrementTrackingLogic(item);
item = incrementResponse[‘value’];
if (incrementResponse[‘clipAll’]) {
data[key].forEach(function(item){
item[‘value’] = parseInt(item[‘value’] / 2).toString();
});
}
} else {
data = initializeJSONDataStructure(data, key, identifier, title);
}
}
data[key].sort(function(a, b) {
return b[‘value’] > a[‘value’] ? 1 : -1;
});
data[key] = clippingMechanism (data, key);
setTrackingCookie(COOKIE_NAME, JSON.stringify(data));
}
function trackSport(identifier, title) {
track(COOKIE_NAME, ‘sport’, identifier, title);
}
function trackEvent(identifier) {
track(COOKIE_NAME, ‘event’, identifier, “”);
}
function trackTeam(identifier) {
track(COOKIE_NAME, ‘team’, identifier, “”);
}
return {
getTrackingCookie: getTrackingCookie,
setTrackingCookie: setTrackingCookie,
trackSport: trackSport,
trackEvent: trackEvent,
trackTeam: trackTeam
};
})();
var hpAlgoCookie = SKTrackingModule.getTrackingCookie(‘HP_ALGO’, null);
if (!hpAlgoCookie) {
var hpAlgoCookieRange = [‘false’, ‘hp_algo_1’];
var hpAlgoCookie = hpAlgoCookieRange[Math.floor(Math.random() * hpAlgoCookieRange.length)];
SKTrackingModule.setTrackingCookie(‘HP_ALGO’, hpAlgoCookie);
}
var category;
try {
var category = JSON.parse(‘{“slug”:”esports”,”title”:”Esports & Gaming”}’);
SKTrackingModule.trackSport(category.slug, category.title);
} catch (e) {}

function trackHashValueContentSource() {
var keyValueArray = window.location.hash.replace(‘#’, ”).split(‘=’);
console.log(“VALUES: “, keyValueArray);
if(keyValueArray.length === 2 && keyValueArray[0] === “src”) {
history.replaceState({}, document.title, window.location.pathname + window.location.search); // keep the url with query string
if(keyValueArray[1] === “ARTICLE_PAGE”) {
gtag(‘event’, ‘TRENDING’, {
‘event_category’: “BELOW_CONTENT_FEED_PAGE_LOADED”,
‘event_label’: “1”,
‘non_interaction’: true
});
} else if(keyValueArray[1] === “RELATED_WIDGET”) {
var currentPagePath = window.location.pathname;
gtag(‘event’, ‘RELATED’, {
‘event_category’: “BELOW_CONTENT_FEED_PAGE_LOADED”,
‘event_label’: currentPagePath,
‘non_interaction’: true
});
}
}
}
trackHashValueContentSource();

//see more logic
var contentHolder = $(‘.event-content’) || $(‘.taxonomy-content’);
var taxonomyImg = $(‘.taxonomy-img’);
var taxonomyInfo = $(‘.taxonomy-info’);
$(‘#hp_feed_select’) && $(‘#hp_feed_select’).addEventListener(‘change’, function() {
document.body.scrollTop = document.documentElement.scrollTop = 0;
});
function seeMoreStats(ele) { //show all stats rows
var rows = $all(‘.season-stats-tr’);
for (i in rows) {
if(hasClass(rows[i], “hidden”)) {
removeClass(rows[i], “hidden”);
}
}
var toggleButton = $(‘.see-less-stats’);
if(hasClass(toggleButton, “hidden”)) {
removeClass(toggleButton, “hidden”);
}
addClass(ele, “hidden”);
}
function seeLessStats(ele) { //show less stats rows
var rows = $all(‘.season-stats-tr’);
for (i in rows) {
if(!hasClass(rows[i], “hidden”) && i >= 5) {
addClass(rows[i], “hidden”);
}
}
var toggleButton = $(‘.see-more-stats’);
if(hasClass(toggleButton, “hidden”)) {
removeClass(toggleButton, “hidden”);
}
addClass(ele, “hidden”);
}
function seeMoreToggle(ele) {
if(hasClass(ele, ‘toggled’)) { //expanded
contentHolder.style.height = ’50px’;
addClass(contentHolder, ‘fade-out-bottom’);
ele.classList.remove(‘toggled’);
}
else { //collapsed
contentHolder.style.height = ‘auto’;
removeClass(contentHolder, ‘fade-out-bottom’);
ele.classList.add(‘toggled’);
if(taxonomyImg) {
removeClass(taxonomyImg, ‘hidden’);
}
if(taxonomyInfo) {
removeClass(taxonomyInfo, ‘hidden’);
}
}
}
if(contentHolder) {
removeClass(contentHolder, ‘hidden’);
contentHolder.style.height = ‘auto’;
}
if(taxonomyImg) {
removeClass(taxonomyImg, ‘hidden’);
}
if(taxonomyInfo) {
removeClass(taxonomyInfo, ‘hidden’);
}
//Check for collapsed_by_default’s value if set

function lazyLoadInFeedNativeAds() {
}

var articleContent = $(‘#article-content’);
var articleTitle = $(‘#heading’).innerText;
var scrollPercent = 0;
var scrollEventRecorded = false;
window.addEventListener(‘scroll’, function() {
var rect = articleContent.getBoundingClientRect();
var height = rect.height, bottom = rect.bottom;
if (bottom


var countryCodeCookie = getCookie(“country_code”);
if (countryCodeCookie == “US” || countryCodeCookie == “CA”) {
removeClass($(“#advertise-sk-hamburger”), “hidden”);
addClass($(“#app-download-hamburger”), “hidden”);
}
function onSideMenuSearchFocus() {
trackGAEvent(“SEARCH_BUTTON_CLICK”, {
“position”: “hamburger”,
});
}
function onSideMenuSearchValueChanged(input) {
trackGAEvent(“SEARCH_ACTION”, {
“position”: “hamburger”,
“query”: input.value,
});
}
const onSearchTrack = debounce(function (input) {
onSideMenuSearchValueChanged(input);
}, 500);

function loadContentPagesAdDefinitionsScript() {
asyncScriptLoader({
src: CONTENT_PAGES_AD_DEFINITION_SCRIPT_LOCATION,
loadWithAsync: true,
attributes: [
{
key: “id”,
value: “CONTENT_PAGES_AD_DEFINITION_SCRIPT_LOCATION”,
},
],
}).then(function() {
return asyncScriptLoader({
src: CONTENT_PAGES_AD_REFRESH_SCRIPT_LOCATION,
loadWithAsync: true,
attributes: [
{
key: “id”,
value: “CONTENT_PAGES_AD_REFRESH_SCRIPT_LOCATION”,
},
],
});
}).then(function() {
var adCounter = 0;
var infiniteContentAdSlotsNodeList = document.querySelectorAll(‘[id^=infinite-content-ad-]’);
var infiniteContentAdSlots = [];
for(var i = infiniteContentAdSlotsNodeList.length; i–; infiniteContentAdSlots.unshift(infiniteContentAdSlotsNodeList[i]));
var optionsArticleContentAd = { threshold: 0 , rootMargin: ‘200% 0px 200% 0px’};
var intersectionObserverArticleContent = new IntersectionObserver(function(entries) {
entries.forEach(function (oneEntry) {
if (oneEntry.isIntersecting) {
intersectionObserverArticleContent.unobserve(oneEntry.target);
console.log(“ENTERED, infinite content ad viewport”);
googletag.cmd.push(function() {
var adSlot = initInfiniteContentAdUnit(“Desktop_300250_3”);
insertInfiniteContentAdSlot(‘Desktop_300250_3’, adSlot, oneEntry.target, ‘desktop’, adCounter++);
});
}
});
}, optionsArticleContentAd);
infiniteContentAdSlots.forEach(function(adElement) {
intersectionObserverArticleContent.observe(adElement);
});
});
}

var NewCommentNotification = (function () {
var commentsLoaded = false;
var COMMENT_ACTION_STATUS = {
APPROVED: “approved”,
REJECTED: “rejected”,
DELETE: “delete”
}
var commentsCount = 0;
var COMMENT_ACTION_RESPONSE_ITEMS = {
“approved”: {
“text”: “This comment is approved 👍”,
“class”: “approved-text”
},
“delete”: {
“text”: “This comment is deleted ❌”,
“class”: “rejected-text”
}
}
var moderationCountHTMLElement;
function getPendingCommentsCount() {
return new Promise(function (resolve, reject) {
pureJSAjaxGetWithCredentialsFlag(‘https://a-login.sportskeeda.com/en/comment-moderation/pending/count’, function (data) {
try {
var parsedData = JSON.parse(data);
resolve(parsedData);
} catch (exception) {
reject(exception)
}
}, function (err) {
reject(err)
}, true)
})
}
function getIncomingComments() {
return new Promise(function (resolve, reject) {
pureJSAjaxGetWithCredentialsFlag(‘https://a-login.sportskeeda.com/en/comment-moderation/incoming’, function (data) {
if (typeof data === “string”) {
data = JSON.parse(data);
}
resolve(data);
}, function (err) {
reject(err)
}, true)
});
}
function onCommentActionClick(container, comment, statusToBeUpdated) {
// invalid status update check
if (!Object.values(COMMENT_ACTION_STATUS).includes(statusToBeUpdated)) {
return;
}
pureJSAjaxPut(‘https://a-login.sportskeeda.com/en/comment-moderation/update-status’,
Object.assign(comment, { id: comment.ID, status: statusToBeUpdated }),
function (result) {
commentsCount = Math.max(0, commentsCount – 1);
moderationCountHTMLElement.innerText = commentsCount > 0 ? commentsCount : ”;
var commentResponseItem = COMMENT_ACTION_RESPONSE_ITEMS && COMMENT_ACTION_RESPONSE_ITEMS[statusToBeUpdated];
if (commentResponseItem) {
var card = container.querySelector(‘div[data-notification-id=”‘ + comment.ID + ‘”]’);
var cardActionResult = card.getElementsByClassName(‘kcn-action’)[0];
if (cardActionResult) {
cardActionResult.innerText = commentResponseItem.text;
cardActionResult.classList.add(commentResponseItem.class);
}
}
},
function (err) {
console.log(err);
},
null, true
);
}
function displayNewCommentNotifications(container) {
getIncomingComments().then(function (comments) {
if (comments.error == true) {
container.style.display = “none”;
return;
}
var cardsContainer = container.querySelector(‘.kcn-card-container’);
if(comments.length > 0) {
container.style.display = “block”;
cardsContainer.innerHTML = ”;
comments.forEach(function (comment, index) {
var notificationCardTemplate = container.querySelector(‘#kcn-card’);
var notificationCard = notificationCardTemplate.content.cloneNode(true);
var notificationCardWrapper = notificationCard.querySelector(‘.kcn-card-wrapper’);
notificationCardWrapper.setAttribute(‘data-notification-id’, comment.ID);
var notificationText = notificationCard.querySelector(‘.kcn-comment-text’);
notificationText.innerHTML = comment.comment_text;
var keedaPostLink = notificationCard.querySelector(‘.keeda-posts-link’);
keedaPostLink.href = comment.permalink;
notificationCardWrapper.querySelector(‘.approve’).addEventListener(‘click’, function () {
onCommentActionClick(container, comment, COMMENT_ACTION_STATUS.APPROVED);
});
notificationCardWrapper.querySelector(‘.delete’).addEventListener(‘click’, function () {
onCommentActionClick(container, comment, COMMENT_ACTION_STATUS.DELETE);
});
cardsContainer.appendChild(notificationCard);
});
} else {
container.style.display = “block”;
cardsContainer.innerHTML = “No new comments”;
}
}).catch(function (err) {
console.log(err);
});
}
function displayPendingCommentsCount(container) {
getPendingCommentsCount().then(function (res) {
if (res.count && res.count > 0) {
commentsCount = res.count;
moderationCountHTMLElement.innerText = res.count;
}
})
}
function toggleContainerVisibility(container) {
var kcnContentContainer = container.querySelector(‘#kcn-comment-container’);
var kcnPointer = container.querySelector(‘#kcn-pointer’);
if (kcnContentContainer) {
kcnContentContainer.classList.toggle(‘hidden’);
}
if (kcnPointer) {
kcnPointer.classList.toggle(‘hidden’);
}
}
function addClickHandler(container, clickCallback) {
var iconContainerElement = container.querySelector(‘#kcn-comment-info-holder’);
iconContainerElement.addEventListener(“click”, function (event) {
toggleContainerVisibility(container);
if (!commentsLoaded) {
commentsLoaded = true;
var cardsContainer = container.querySelector(‘.kcn-card-container’);
if (cardsContainer) {
cardsContainer.innerHTML = “Loading comments…”;
}
displayNewCommentNotifications(container);
}
});
}
function init (element) {
addClickHandler(element);
displayPendingCommentsCount(element);
moderationCountHTMLElement = document.getElementById(“kcn-comment-count”);
}
return {
init: init
}
})();
function initCommentNotifications(capabilities) {
if(window.innerWidth < 340 || !capabilities) { return; } var notificationContainer = document.getElementById("keeda-comment-notifications-container"); if (notificationContainer) { if (capabilities.includes('superAdmin') || capabilities.includes('canModerate')) { NewCommentNotification.init(notificationContainer); notificationContainer.classList.remove('hidden'); } else { notificationContainer.parentNode.removeChild(notificationContainer); } } }

Close
Your custom text © Copyright 2024. All rights reserved.
Close