Showing: “powerball” news
No news for “powerball”
> `; // Add CSS styles const styles = ` `; // Add styles to head document.head.insertAdjacentHTML("beforeend", styles); // Add launcher to page document.body.appendChild(customLauncher); // Handle tooltip close customLauncher.querySelector(".tooltip-close").addEventListener("click", function (e) { e.stopPropagation(); if (removeTooltipOnly) { // Remove just the tooltip, but keep the icon customLauncher .querySelector(".custom-launcher-tooltip-container") .classList.add("tooltip-hidden"); } else { // Remove the entire icon customLauncher.remove(); } }); } /** * Subscribes to Genesys Messenger events to update icon state */ function subscribeGenesysEvents(customLauncher) { // Allowed pages to initially show the custom icon on const defaultPaths = [ { path: "/about/contact-us", exact: true }, { path: "/account/money", exact: true }, { path: "/hc/en-us", exact: true }, ]; const launcherButton = customLauncher.querySelector(".custom-launcher-button"); const tooltip = customLauncher.querySelector(".custom-launcher-tooltip-container"); let bMessengerOpened = false; // Set via the Messenger.opened and Messenger.closed subs let hasActiveChat = false; function shouldShowLauncher() { const allowedPathsFromTarget = window.chatbotPathsViaTarget || []; // Merge default paths with configured paths (remove duplicates) const pathsToCheck = [...new Set([...defaultPaths, ...allowedPathsFromTarget])]; const onAllowedPage = pathsToCheck.some(({ path, exact }) => exact ? window.location.pathname === path : window.location.pathname.startsWith(path) ); return onAllowedPage || hasActiveChat; } function updateLauncherVisibility() { customLauncher.style.display = shouldShowLauncher() ? "block" : "none"; } Genesys("subscribe", "Messenger.ready", () => { // Initially show only if page is allowed (no active chat yet) updateLauncherVisibility(); }); // Fires when the messenger is opened via button click or when arriving on another page if the chat window was already opened Genesys("subscribe", "Messenger.opened", () => { bMessengerOpened = true; hasActiveChat = true; launcherButton.classList.add("messenger-open"); if (tooltip) tooltip.classList.add("tooltip-hidden"); updateLauncherVisibility(); }); // Fires when the messenger is closed via button click or when using the minimise icon located inside the chat window Genesys("subscribe", "Messenger.closed", () => { bMessengerOpened = false; launcherButton.classList.remove("messenger-open"); }); launcherButton.addEventListener("click", () => { Genesys("command", bMessengerOpened ? "Messenger.close" : "Messenger.open"); }); }