import { l as loadEmberDebugInWebpage, o as onEmberReady, s as startInspector } from './start-inspector-BPAW_WLv.js';
import { B as BasicAdapter } from './basic-DfbgtngO.js';
import './versions.js';
import './base-object-HAEdWjmg.js';

class adapter extends BasicAdapter {
  // eslint-disable-next-line ember/classic-decorator-hooks
  init() {
    super.init();
    this._listen();
  }
  sendMessage(options) {
    options = options || {};
    window.emberInspector.w.postMessage(options, window.emberInspector.url);
  }
  _listen() {
    window.addEventListener('message', e => {
      if (e.origin !== window.emberInspector.url) {
        return;
      }
      const message = e.data;
      if (message.from === 'devtools') {
        this._messageReceived(message);
      }
    });
    window.onunload = () => {
      this.sendMessage({
        unloading: true
      });
    };
  }
}

loadEmberDebugInWebpage(() => onEmberReady(startInspector(adapter)));
