import{L as s}from"./p-6e1ab235.js";const t=new class{constructor(){this.pubSubMap=new Map}register(s,t){if(this.pubSubMap.has(s)){const e=this.pubSubMap.get(s);e&&!e.includes(t)&&e.push(t)}else this.pubSubMap.set(s,[t])}unregister(s,t){if(this.pubSubMap.has(s)){const e=this.pubSubMap.get(s);e&&e.includes(t)&&e.splice(e.indexOf(t),1)}}clearObserversBySubject(s){this.pubSubMap.delete(s)}notify(t,e){this.pubSubMap.has(t)&&this.pubSubMap.get(t).forEach((r=>{try{r.notify(e)}catch(e){s.warn(`Encountered error while notifying observer for subject ${t.getDescription()}`,e)}}))}};export{t as C}