(()=>{"use strict";if(window.__AHT_MARK_CHATS_CONFIG_SYNC__)return;window.__AHT_MARK_CHATS_CONFIG_SYNC__=!0;const t="aht_settings_v1",e="data-aht-mark-chats-config",a="AHT_MARK_CHATS_CONFIG";function i(t){const e=t&&"object"==typeof t&&t.features&&"object"==typeof t.features?t.features:null,a=t&&"object"==typeof t&&t.modules&&"object"==typeof t.modules?t.modules.markChats:void 0;return!1!==a||e?!0!==a||e?{inactiveChatLabels:!0===e?.inactiveChatLabels,personalBadge:!0===e?.personalBadge,chatLimitHighlight:!0===e?.chatLimitHighlight,personalTimer:!0===e?.personalTimer,personalTimerSound:!0===e?.personalTimerSound,personalTimerSoundUrl:"string"==typeof e?.personalTimerSoundUrl?e.personalTimerSoundUrl:""}:{inactiveChatLabels:!0,personalBadge:!0,chatLimitHighlight:!0,personalTimer:!1,personalTimerSound:!1,personalTimerSoundUrl:""}:{inactiveChatLabels:!1,personalBadge:!1,chatLimitHighlight:!1,personalTimer:!1,personalTimerSound:!1,personalTimerSoundUrl:""}}function n(t){const i=document.documentElement;if(!i)return;const n=JSON.stringify(t);i.getAttribute(e)!==n&&i.setAttribute(e,n),document.dispatchEvent(new CustomEvent(a,{detail:t}))}async function o(){try{const e=await chrome.storage.local.get(t);n(i(e?.[t]))}catch(t){console.debug("[AHT mark-chats] config sync fallback:",t),n(i(null))}}chrome.storage.onChanged.addListener(((e,a)=>{"local"===a&&e&&Object.prototype.hasOwnProperty.call(e,t)&&o().catch((()=>{}))})),o().catch((()=>{}))})();