import{c as t,M as s,V as e}from"./p-6e1ab235.js";import{O as i}from"./p-331a62d5.js";import{C as c}from"./p-2d0d575f.js";import{b as n}from"./p-6e70d3cc.js";var o=function(t,s,e,i){var c,n=arguments.length,o=n<3?s:null===i?i=Object.getOwnPropertyDescriptor(s,e):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,s,e,i);else for(var a=t.length-1;a>=0;a--)(c=t[a])&&(o=(n<3?c(o):n>3?c(s,e,o):c(s,e))||o);return n>3&&o&&Object.defineProperty(s,e,o),o};class a extends e{constructor(t,s,e){super(),this.acceptableResultMap=new WeakMap,this.isAcceptableObserverPayload=t=>{let s=!1;return"function"==typeof this.customAcceptableHandle?s=this.customAcceptableHandle(t):this.host&&t.host&&(this.acceptableResultMap.has(t.host)?s=!!this.acceptableResultMap.get(t.host):(s=this.host!==t.host&&n(t.host,this.host),this.acceptableResultMap.set(t.host,s))),s},this.handleObserver=t=>{"function"==typeof this.callback&&this.callback(t)},this.subject=t,this.callback=s,this.customAcceptableHandle=e}connectedCallback(){this.subject&&(this.notifyObserver=new i(this.isAcceptableObserverPayload.bind(this),this.handleObserver),c.register(this.subject,this.notifyObserver))}disconnectedCallback(){this.subject&&c.unregister(this.subject,this.notifyObserver)}}o([t()],a.prototype,"host",void 0),o([s("connectedCallback")],a.prototype,"connectedCallback",null),o([s("disconnectedCallback")],a.prototype,"disconnectedCallback",null);export{a as C}