(function () { // Create a container for the bar var container = document.createElement("div"); container.id = "timerbar-container"; document.body.insertBefore(container, document.body.firstChild); const storeId = window.LS?.store?.id || 4969458; // Check if the script is already loaded if (!document.getElementById("timerbar-script")) { // Load the React app's bundled JavaScript var script = document.createElement("script"); script.id = "timerbar-script"; script.src = `https://d3oqe9vvkcp78i.cloudfront.net/scripts/bundle.js`; script.async = true; script.onload = function () { // Once the script is loaded, mount the React app if (window.TimerBar && typeof window.TimerBar.mount === "function") { window.TimerBar.mount("timerbar-container", storeId); } }; document.head.appendChild(script); } else { // If script is already loaded, just mount the React app if (window.TimerBar && typeof window.TimerBar.mount === "function") { window.TimerBar.mount("timerbar-container", storeId); } } })();