if (targetOrigin) this.#targetOrigin = targetOrigin
this.#applyCallbacks(callbacks)
this.#subscriptions = subscribe
if (window === window.parent) {
this.#active = false
console.log('[AGL] Not in Epic...')
this.#log('AGL is not initialized')
return
}
this.#controller = new AbortController()
window.addEventListener('message', e => this.#receive(e as MessageEvent), { signal: this.#controller.signal })
const args: Record<string, any> = {}
if (Object.keys(this.#subscriptions!).length)
args['SubscriptionRequests'] = Object.entries(this.#subscriptions!)