/*
* Hides the chat widget only on page ID 16334.
* Uses a small delay (setTimeout) to ensure the widget's own script
* has finished creating the 'lc_text-widget' element.
*/
function hideChatWidget() {
// 1. Check if the current page has the unique class for page ID 16334
const isTargetPage = document.body.classList.contains('page-id-16334');
if (isTargetPage) {
// 2. Find the main container element by its ID (External to the Shadow DOM)
const widget = document.getElementById('lc_text-widget');
// 3. Hide the entire widget container
if (widget) {
widget.style.display = 'none';
} else {
// If the widget isn't ready yet, try again after a small delay
setTimeout(hideChatWidget, 50);
}
}
}
// Start the check after a slight delay to allow the widget's JS to run
setTimeout(hideChatWidget, 100);