(()=>{"use strict";const e="https://group-speed-dial.fastaddons.com";browser.runtime.getManifest(),self.location.pathname;const t=e=>browser.runtime.sendMessage(e),s="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?Promise.resolve():new Promise((e=>"complete"===document.readyState||"interactive"===document.readyState?e():document.addEventListener("DOMContentLoaded",(()=>e())))),a=new Promise((e=>document&&"complete"===document.readyState?e():window.addEventListener("load",(()=>e()))));new Promise((e=>window.addEventListener("load",e))),(async()=>{if(!await t({type:"cs_is_default_container"}))return;window.addEventListener("message",(async s=>{if(s.source===window&&s.origin===e&&s.data.type.startsWith("gsd_"))switch(s.data.type){case"gsd_return_home":t({type:"cs_return_home"});break;case"gsd_update_token":t({type:"cs_web_token_update",token:s.data.token});break;case"gsd_get_token":const a=await t({type:"cs_get_token"});a&&window.postMessage({type:"gsd_token",token:a},e);break;case"gsd_shared_groups":const o=s.data.groups;Array.isArray(o)&&o.length&&await t({type:"cs_shared_groups_import",groups:o}).catch(console.error)}}),!1);const o=()=>window.postMessage({type:"gsd_ext_ready"},e);await s,o(),await a,o(),self.setTimeout(o,1e3)})()})();