import{i as e,t,u as n}from"./analysisRulesConfig-CcWGfATn.js";var r=null,i=null,a=new Set,o=!1;function s(){o||typeof chrome>`u`||!chrome.storage?.onChanged||(o=!0,chrome.storage.onChanged.addListener((e,i)=>{if(i!==`local`||!e.xyxp_analysis_rules)return;let o=n(e[t].newValue);r=o;for(let e of a)try{e(o)}catch(e){console.warn(`[xyxp] analysis rules listener error`,e)}}))}async function c(){return r||(i||=(async()=>{s();try{r=n((await chrome.storage.local.get(t))[t])}catch{r=e()}return r})(),i)}function l(){return r??e()}function u(){r=null,i=null}function d(e){return s(),a.add(e),()=>{a.delete(e)}}export{d as i,l as n,u as r,c as t};