1var e=`peach_trusted_networks`,t=`peach_paired_devices`;async function n(){try{return(await chrome.storage.local.get(e))[e]??[]}catch{return[]}}async function r(t){try{let r=await n();r.push(t),await chrome.storage.local.set({[e]:r})}catch(e){throw Error(`Failed to add trusted network: ${e}`)}}async function i(t){try{let r=(await n()).filter(e=>e.addedAt!==t);await chrome.storage.local.set({[e]:r})}catch(e){throw Error(`Failed to remove trusted network: ${e}`)}}async function a(){try{return(await chrome.storage.local.get(t))[t]??[]}catch{return[]}}async function o(e){try{let n=(await a()).filter(t=>t.deviceId!==e);await chrome.storage.local.set({[t]:n})}catch(e){throw Error(`Failed to remove paired device: ${e}`)}}export{r as addTrustedNetwork,a as getPairedDevices,n as getTrustedNetworks,o as removePairedDevice,i as removeTrustedNetwork};